Esempio n. 1
0
void PluginsManager::setMenu(HMENU hMenu, const TCHAR *menuName)
{
	if (hasPlugins())
	{
		//std::vector<PluginCmdShortcut> & pluginCmdSCList = (NppParameters::getInstance())->getPluginCommandList();
		const TCHAR *nom_menu = (menuName && menuName[0])?menuName:TEXT("Plugins");

        if (!_hPluginsMenu)
        {
		    _hPluginsMenu = ::CreateMenu();
		    ::InsertMenu(hMenu, 9, MF_BYPOSITION | MF_POPUP, (UINT_PTR)_hPluginsMenu, nom_menu);
        }

		for (size_t i = 0 ; i < _pluginInfos.size() ; i++)
		{
            addInMenuFromPMIndex(i);
		}
	}
}
Esempio n. 2
0
HMENU PluginsManager::setMenu(HMENU hMenu, const TCHAR *menuName)
{
	if (hasPlugins())
	{
		const TCHAR *nom_menu = (menuName && menuName[0])?menuName:TEXT("Plugins");

        if (!_hPluginsMenu)
        {
		    _hPluginsMenu = ::CreateMenu();
		    ::InsertMenu(hMenu,  MENUINDEX_PLUGINS, MF_BYPOSITION | MF_POPUP, (UINT_PTR)_hPluginsMenu, nom_menu);
        }

        size_t i = 0;
		for ( ; i < _pluginInfos.size() ; i++)
		{
            addInMenuFromPMIndex(i);
		}
        return _hPluginsMenu;
	}
	return NULL;
}