本文整理汇总了C++中IPlugin::GetShortName方法的典型用法代码示例。如果您正苦于以下问题:C++ IPlugin::GetShortName方法的具体用法?C++ IPlugin::GetShortName怎么用?C++ IPlugin::GetShortName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlugin
的用法示例。
在下文中一共展示了IPlugin::GetShortName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
//.........这里部分代码省略.........
pname.MakeLower().Trim().Trim(false);
// Check the policy
if(pp == CodeLiteApp::PP_FromList && allowedPlugins.Index(pname) == wxNOT_FOUND) {
// Policy is set to 'from list' and this plugin does not match any plugins from
// the list, don't allow it to be loaded
continue;
}
// Add the plugin information
m_pluginsData.AddPlugin(pluginInfo);
// Can we load it?
if(!m_pluginsData.CanLoad(pluginInfo.GetName())) {
CL_WARNING(wxT("Plugin ") + pluginInfo.GetName() + wxT(" is not enabled"));
continue;
}
// try and load the plugin
GET_PLUGIN_CREATE_FUNC pfn = (GET_PLUGIN_CREATE_FUNC)dl->GetSymbol(wxT("CreatePlugin"), &success);
if(!success) {
CL_WARNING(wxT("Failed to find CreatePlugin() in dll: ") + fileName);
if(!dl->GetError().IsEmpty()) {
CL_WARNING(dl->GetError());
}
m_pluginsData.DisablePlugin(pluginInfo.GetName());
continue;
}
// Construct the plugin
IPlugin* plugin = pfn((IManager*)this);
CL_DEBUG(wxT("Loaded plugin: ") + plugin->GetLongName());
m_plugins[plugin->GetShortName()] = plugin;
// Load the toolbar
clToolBar* tb = plugin->CreateToolBar((wxWindow*)clMainFrame::Get());
if(tb) {
#if USE_AUI_TOOLBAR
// When using AUI toolbars, use our own custom art-provider
tb->SetArtProvider(new CLMainAuiTBArt());
#endif
clMainFrame::Get()->GetDockingManager().AddPane(tb,
wxAuiPaneInfo()
.Name(plugin->GetShortName())
.LeftDockable(true)
.RightDockable(true)
.Caption(plugin->GetShortName())
.ToolbarPane()
.Top()
.Row(0));
// Add menu entry at the 'View->Toolbars' menu for this toolbar
wxMenuItem* item = clMainFrame::Get()->GetMenuBar()->FindItem(XRCID("toolbars_menu"));
if(item) {
wxMenu* submenu = NULL;
submenu = item->GetSubMenu();
// add the new toolbar entry at the end of this menu
int id = wxNewId();
wxString text(plugin->GetShortName());
text << _(" ToolBar");
wxMenuItem* newItem = new wxMenuItem(submenu, id, text, wxEmptyString, wxITEM_CHECK);
submenu->Append(newItem);
clMainFrame::Get()->RegisterToolbar(id, plugin->GetShortName());
}