本文整理汇总了C++中NppParameters::reloadStylers方法的典型用法代码示例。如果您正苦于以下问题:C++ NppParameters::reloadStylers方法的具体用法?C++ NppParameters::reloadStylers怎么用?C++ NppParameters::reloadStylers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NppParameters
的用法示例。
在下文中一共展示了NppParameters::reloadStylers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switchToTheme
void WordStyleDlg::switchToTheme()
{
auto iSel = ::SendMessage(_hSwitch2ThemeCombo, CB_GETCURSEL, 0, 0);
generic_string prevThemeName(_themeName);
_themeName.clear();
NppParameters *nppParamInst = NppParameters::getInstance();
ThemeSwitcher & themeSwitcher = nppParamInst->getThemeSwitcher();
pair<generic_string, generic_string> & themeInfo = themeSwitcher.getElementFromIndex(iSel);
_themeName = themeInfo.second;
if (_isThemeDirty)
{
TCHAR themeFileName[MAX_PATH];
lstrcpy(themeFileName, prevThemeName.c_str());
PathStripPath(themeFileName);
PathRemoveExtension(themeFileName);
int mb_response =
::MessageBox( _hSelf,
TEXT(" Unsaved changes are about to be discarded!\n")
TEXT(" Do you want to save your changes before switching themes?"),
themeFileName,
MB_ICONWARNING | MB_YESNO | MB_APPLMODAL | MB_SETFOREGROUND );
if ( mb_response == IDYES )
(NppParameters::getInstance())->writeStyles(_lsArray, _globalStyles);
}
nppParamInst->reloadStylers(&_themeName[0]);
loadLangListFromNppParam();
_restoreInvalid = true;
}
示例2: run_dlgProc
//.........这里部分代码省略.........
notifyDataModified();
apply();
}
}
else
{
switch (wParam)
{
case IDC_BOLD_CHECK :
updateFontStyleStatus(BOLD_STATUS);
notifyDataModified();
apply();
break;
case IDC_ITALIC_CHECK :
updateFontStyleStatus(ITALIC_STATUS);
notifyDataModified();
apply();
break;
case IDC_UNDERLINE_CHECK :
updateFontStyleStatus(UNDERLINE_STATUS);
notifyDataModified();
apply();
break;
case IDCANCEL :
if (_isDirty)
{
NppParameters *nppParamInst = NppParameters::getInstance();
if (_restoreInvalid)
{
generic_string str( nppParamInst->getNppGUI()._themeName );
nppParamInst->reloadStylers( &str[0] );
}
LexerStylerArray & lsArray = nppParamInst->getLStylerArray();
StyleArray & globalStyles = nppParamInst->getGlobalStylers();
if (_restoreInvalid)
{
_lsArray = _styles2restored = lsArray;
_globalStyles = _gstyles2restored = globalStyles;
}
else
{
globalStyles = _globalStyles = _gstyles2restored;
lsArray = _lsArray = _styles2restored;
}
restoreGlobalOverrideValues();
_restoreInvalid = false;
_isDirty = false;
_isThemeDirty = false;
setVisualFromStyleList();
//(nppParamInst->getNppGUI())._themeName
::SendMessage(_hSwitch2ThemeCombo, CB_SETCURSEL, _currentThemeIndex, 0);
::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0);
}
::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), FALSE/*!_isSync*/);
display(false);
return TRUE;