本文整理汇总了C++中NppParameters::getLocalizationSwitcher方法的典型用法代码示例。如果您正苦于以下问题:C++ NppParameters::getLocalizationSwitcher方法的具体用法?C++ NppParameters::getLocalizationSwitcher怎么用?C++ NppParameters::getLocalizationSwitcher使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NppParameters
的用法示例。
在下文中一共展示了NppParameters::getLocalizationSwitcher方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
//.........这里部分代码省略.........
::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_ALWAYSONTOP, 0);
}
nppGUI._isCmdlineNosessionActivated = cmdLineParams->_isNoSession;
if (nppGUI._rememberLastSession && !cmdLineParams->_isNoSession)
{
_notepad_plus_plus_core.loadLastSession();
}
if (!cmdLineParams->_isPreLaunch)
{
if (cmdLineParams->isPointValid())
::ShowWindow(_hSelf, SW_SHOW);
else
::ShowWindow(_hSelf, nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
}
else
{
_notepad_plus_plus_core._pTrayIco = new trayIconControler(_hSelf, IDI_M30ICON, IDC_MINIMIZED_TRAY, ::LoadIcon(_hInst, MAKEINTRESOURCE(IDI_M30ICON)), TEXT(""));
_notepad_plus_plus_core._pTrayIco->doTrayIcon(ADD);
}
if (cmdLine)
{
_notepad_plus_plus_core.loadCommandlineParams(cmdLine, cmdLineParams);
}
vector<generic_string> fileNames;
vector<generic_string> patterns;
patterns.push_back(TEXT("*.xml"));
generic_string nppDir = pNppParams->getNppPath();
#ifdef UNICODE
LocalizationSwitcher & localizationSwitcher = pNppParams->getLocalizationSwitcher();
wstring localizationDir = nppDir;
PathAppend(localizationDir, TEXT("localization\\"));
_notepad_plus_plus_core.getMatchedFileNames(localizationDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size(); i < len ; ++i)
{
localizationSwitcher.addLanguageFromXml(fileNames[i].c_str());
}
#endif
fileNames.clear();
ThemeSwitcher & themeSwitcher = pNppParams->getThemeSwitcher();
// Get themes from both npp install themes dir and app data themes dir with the per user
// overriding default themes of the same name.
generic_string themeDir;
if (pNppParams->getAppDataNppDir() && pNppParams->getAppDataNppDir()[0])
{
themeDir = pNppParams->getAppDataNppDir();
PathAppend(themeDir, TEXT("themes\\"));
_notepad_plus_plus_core.getMatchedFileNames(themeDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size() ; i < len ; ++i)
{
themeSwitcher.addThemeFromXml(fileNames[i].c_str());
}
}
fileNames.clear();
themeDir.clear();
themeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
PathAppend(themeDir, TEXT("themes\\"));
_notepad_plus_plus_core.getMatchedFileNames(themeDir.c_str(), patterns, fileNames, false, false);
示例2: init
//.........这里部分代码省略.........
::SetMenu(_hSelf, NULL);
if (cmdLineParams->_isNoTab || (nppGUI._tabStatus & TAB_HIDE))
{
::SendMessage(_hSelf, NPPM_HIDETABBAR, 0, TRUE);
}
if (cmdLineParams->_alwaysOnTop)
{
::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_ALWAYSONTOP, 0);
}
_notepad_plus_plus_core._rememberThisSession = !cmdLineParams->_isNoSession;
if (nppGUI._rememberLastSession && !cmdLineParams->_isNoSession)
{
_notepad_plus_plus_core.loadLastSession();
}
if (!cmdLineParams->_isPreLaunch)
{
if (cmdLineParams->isPointValid())
::ShowWindow(_hSelf, SW_SHOW);
else
::ShowWindow(_hSelf, nppGUI._isMaximized?SW_MAXIMIZE:SW_SHOW);
}
else
{
_notepad_plus_plus_core._pTrayIco = new trayIconControler(_hSelf, IDI_M30ICON, IDC_MINIMIZED_TRAY, ::LoadIcon(_hInst, MAKEINTRESOURCE(IDI_M30ICON)), TEXT(""));
_notepad_plus_plus_core._pTrayIco->doTrayIcon(ADD);
}
if (cmdLine)
{
_notepad_plus_plus_core.loadCommandlineParams(cmdLine, cmdLineParams);
}
vector<generic_string> fileNames;
vector<generic_string> patterns;
patterns.push_back(TEXT("*.xml"));
generic_string nppDir = pNppParams->getNppPath();
#ifdef UNICODE
LocalizationSwitcher & localizationSwitcher = pNppParams->getLocalizationSwitcher();
wstring localizationDir = nppDir;
PathAppend(localizationDir, TEXT("localization\\"));
_notepad_plus_plus_core.getMatchedFileNames(localizationDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0 ; i < fileNames.size() ; i++)
{
localizationSwitcher.addLanguageFromXml(fileNames[i].c_str());
}
#endif
fileNames.clear();
ThemeSwitcher & themeSwitcher = pNppParams->getThemeSwitcher();
// Get themes from both npp install themes dir and app data themes dir with the per user
// overriding default themes of the same name.
generic_string themeDir;
if (pNppParams->getAppDataNppDir() && pNppParams->getAppDataNppDir()[0])
{
themeDir = pNppParams->getAppDataNppDir();
PathAppend(themeDir, TEXT("themes\\"));
_notepad_plus_plus_core.getMatchedFileNames(themeDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0 ; i < fileNames.size() ; i++)
{
themeSwitcher.addThemeFromXml(fileNames[i].c_str());
}
}
fileNames.clear();
themeDir.clear();
themeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
PathAppend(themeDir, TEXT("themes\\"));
_notepad_plus_plus_core.getMatchedFileNames(themeDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0 ; i < fileNames.size() ; i++)
{
generic_string themeName( themeSwitcher.getThemeFromXmlFileName(fileNames[i].c_str()) );
if (! themeSwitcher.themeNameExists(themeName.c_str()) )
{
themeSwitcher.addThemeFromXml(fileNames[i].c_str());
}
}
// Notify plugins that Notepad++ is ready
SCNotification scnN;
scnN.nmhdr.code = NPPN_READY;
scnN.nmhdr.hwndFrom = _hSelf;
scnN.nmhdr.idFrom = 0;
_notepad_plus_plus_core._pluginsManager.notify(&scnN);
if (cmdLineParams->_showLoadingTime)
{
time_t timestampEnd = time(NULL);
double loadTime = difftime(timestampEnd, timestampBegin);
char dest[256];
sprintf(dest, "Loading time : %.2lf seconds", loadTime);
::MessageBoxA(NULL, dest, "", MB_OK);
}
}
示例3: init
//.........这里部分代码省略.........
nppGUI._tabStatus = tabStatusOld;
}
}
if (cmdLineParams->_alwaysOnTop)
::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_ALWAYSONTOP, 0);
nppGUI._isCmdlineNosessionActivated = cmdLineParams->_isNoSession;
if (nppGUI._rememberLastSession && !cmdLineParams->_isNoSession)
_notepad_plus_plus_core.loadLastSession();
if (not cmdLineParams->_isPreLaunch)
{
if (cmdLineParams->isPointValid())
::ShowWindow(_hSelf, SW_SHOW);
else
::ShowWindow(_hSelf, nppGUI._isMaximized ? SW_MAXIMIZE : SW_SHOW);
}
else
{
_notepad_plus_plus_core._pTrayIco = new trayIconControler(_hSelf, IDI_M30ICON, IDC_MINIMIZED_TRAY, ::LoadIcon(_hInst, MAKEINTRESOURCE(IDI_M30ICON)), TEXT(""));
_notepad_plus_plus_core._pTrayIco->doTrayIcon(ADD);
}
if (cmdLine)
_notepad_plus_plus_core.loadCommandlineParams(cmdLine, cmdLineParams);
std::vector<generic_string> fileNames;
std::vector<generic_string> patterns;
patterns.push_back(TEXT("*.xml"));
generic_string nppDir = pNppParams->getNppPath();
LocalizationSwitcher & localizationSwitcher = pNppParams->getLocalizationSwitcher();
std::wstring localizationDir = nppDir;
PathAppend(localizationDir, TEXT("localization\\"));
_notepad_plus_plus_core.getMatchedFileNames(localizationDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size(); i < len; ++i)
localizationSwitcher.addLanguageFromXml(fileNames[i].c_str());
fileNames.clear();
ThemeSwitcher & themeSwitcher = pNppParams->getThemeSwitcher();
// Get themes from both npp install themes dir and app data themes dir with the per user
// overriding default themes of the same name.
generic_string themeDir;
if (pNppParams->getAppDataNppDir() && pNppParams->getAppDataNppDir()[0])
{
themeDir = pNppParams->getAppDataNppDir();
PathAppend(themeDir, TEXT("themes\\"));
_notepad_plus_plus_core.getMatchedFileNames(themeDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size() ; i < len ; ++i)
{
themeSwitcher.addThemeFromXml(fileNames[i].c_str());
}
}
fileNames.clear();
themeDir.clear();
themeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
PathAppend(themeDir, TEXT("themes\\"));
_notepad_plus_plus_core.getMatchedFileNames(themeDir.c_str(), patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size(); i < len ; ++i)
{