本文整理汇总了C++中NativeLangSpeaker::getSpecialMenuEntryName方法的典型用法代码示例。如果您正苦于以下问题:C++ NativeLangSpeaker::getSpecialMenuEntryName方法的具体用法?C++ NativeLangSpeaker::getSpecialMenuEntryName怎么用?C++ NativeLangSpeaker::getSpecialMenuEntryName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NativeLangSpeaker
的用法示例。
在下文中一共展示了NativeLangSpeaker::getSpecialMenuEntryName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateMenu
void LastRecentFileList::updateMenu()
{
NppParameters *pNppParam = NppParameters::getInstance();
if (!_hasSeparators && _size > 0)
{
//add separators
NativeLangSpeaker *pNativeLangSpeaker = pNppParam->getNativeLangSpeaker();
generic_string recentFileList = pNativeLangSpeaker->getSpecialMenuEntryName("RecentFiles");
generic_string openAllFiles = pNativeLangSpeaker->getNativeLangMenuString(IDM_OPEN_ALL_RECENT_FILE);
generic_string cleanFileList = pNativeLangSpeaker->getNativeLangMenuString(IDM_CLEAN_RECENT_FILE_LIST);
if (recentFileList == TEXT(""))
recentFileList = TEXT("&Recent Files");
if (openAllFiles == TEXT(""))
openAllFiles = TEXT("Open All Recent Files");
if (cleanFileList == TEXT(""))
cleanFileList = TEXT("Empty Recent Files List");
if (!isSubMenuMode())
::InsertMenu(_hMenu, _posBase + 0, MF_BYPOSITION, UINT(-1), 0);
::InsertMenu(_hMenu, _posBase + 1, MF_BYPOSITION, IDM_OPEN_ALL_RECENT_FILE, openAllFiles.c_str());
::InsertMenu(_hMenu, _posBase + 2, MF_BYPOSITION, IDM_CLEAN_RECENT_FILE_LIST, cleanFileList.c_str());
::InsertMenu(_hMenu, _posBase + 3, MF_BYPOSITION, UINT(-1), 0);
_hasSeparators = true;
if (isSubMenuMode())
{
::InsertMenu(_hParentMenu, _posBase + 0, MF_BYPOSITION | MF_POPUP, UINT(_hMenu), (LPCTSTR)recentFileList.c_str());
::InsertMenu(_hParentMenu, _posBase + 1, MF_BYPOSITION, UINT(-1), 0);
}
}
else if (_hasSeparators && _size == 0) //remove separators
{
::RemoveMenu(_hMenu, _posBase + 3, MF_BYPOSITION);
::RemoveMenu(_hMenu, IDM_CLEAN_RECENT_FILE_LIST, MF_BYCOMMAND);
::RemoveMenu(_hMenu, IDM_OPEN_ALL_RECENT_FILE, MF_BYCOMMAND);
::RemoveMenu(_hMenu, _posBase + 0, MF_BYPOSITION);
_hasSeparators = false;
if (isSubMenuMode())
{
// Remove "Recent Files" Entry and the separator from the main menu
::RemoveMenu(_hParentMenu, _posBase + 1, MF_BYPOSITION);
::RemoveMenu(_hParentMenu, _posBase + 0, MF_BYPOSITION);
// Remove the last left separator from the submenu
::RemoveMenu(_hMenu, 0, MF_BYPOSITION);
}
}
//Remove all menu items
for(int i = 0; i < _size; ++i)
{
::RemoveMenu(_hMenu, _lrfl.at(i)._id, MF_BYCOMMAND);
}
//Then readd them, so everything stays in sync
for(int j = 0; j < _size; ++j)
{
generic_string strBuffer(BuildMenuFileName(pNppParam->getRecentFileCustomLength(), j, _lrfl.at(j)._name));
::InsertMenu(_hMenu, _posBase + j, MF_BYPOSITION, _lrfl.at(j)._id, strBuffer.c_str());
}
}