void CppCheckPlugin::OnEditorContextMenu(clContextMenuEvent& event) { event.Skip(); IEditor* editor = m_mgr->GetActiveEditor(); CHECK_PTR_RET(editor); if(FileExtManager::IsCxxFile(editor->GetFileName())) { event.GetMenu()->Append(wxID_ANY, _("CppCheck"), CreateEditorPopMenu()); } }
void SnipWiz::OnEditorContextMenu(clContextMenuEvent& event) { event.Skip(); IEditor* editor = m_mgr->GetActiveEditor(); CHECK_PTR_RET(editor); if(FileExtManager::IsCxxFile(editor->GetFileName())) { wxMenu* newMenu = CreateSubMenu(); event.GetMenu()->Append(wxID_ANY, _("Snippets"), newMenu); } }
void wxFormBuilder::OnShowFileContextMenu(clContextMenuEvent& event) { event.Skip(); wxFileName file(event.GetFileName()); if(file.GetExt() == "fbp") { wxMenu* menu = event.GetMenu(); menu->PrependSeparator(); menu->Prepend( new wxMenuItem(menu, XRCID("wxfb_open"), _("Open with wxFormBuilder..."), wxEmptyString, wxITEM_NORMAL)); } }
void CMakePlugin::OnProjectContextMenu(clContextMenuEvent& event) { event.Skip(); CHECK_COND_RET(clCxxWorkspaceST::Get()->IsOpen()); ProjectPtr p = GetSelectedProject(); CHECK_COND_RET(p); BuildConfigPtr buildConf = p->GetBuildConfiguration(); CHECK_COND_RET(buildConf); CHECK_COND_RET(buildConf->GetBuilder()->GetName() == "CMake"); // The selected project is using CMake builder // Add our context menu wxMenu* menu = event.GetMenu()->GetParent(); // We want to attach this action to the main menu, not the subclass CHECK_PTR_RET(menu); const wxMenuItemList& items = menu->GetMenuItems(); size_t buildPos = 0; size_t settingsPos = 0; size_t curpos = 0; wxMenuItemList::const_iterator iter = items.begin(); for(; iter != items.end(); ++iter) { if((*iter)->GetId() == XRCID("build_project")) { buildPos = curpos; } if((*iter)->GetId() == XRCID("project_properties")) { settingsPos = curpos; } ++curpos; } wxFileName projectFile = p->GetFileName(); projectFile.SetFullName(CMAKELISTS_FILE); if(projectFile.FileExists()) { wxMenuItem* item = new wxMenuItem(NULL, XRCID("cmake_open_cmake"), _("Open CMakeLists.txt")); item->SetBitmap(m_mgr->GetStdIcons()->LoadBitmap("cmake")); menu->Insert(settingsPos, item); } menu->Insert(buildPos, XRCID("cmake_run_cmake"), _("Run CMake")); menu->InsertSeparator(buildPos); menu->Insert(buildPos, XRCID("cmake_export_cmakelists"), _("Export CMakeLists.txt")); menu->Bind(wxEVT_MENU, &CMakePlugin::OnRunCMake, this, XRCID("cmake_run_cmake")); menu->Bind(wxEVT_MENU, &CMakePlugin::OnOpenCMakeLists, this, XRCID("cmake_open_cmake")); menu->Bind(wxEVT_MENU, &CMakePlugin::OnExportCMakeLists, this, XRCID("cmake_export_cmakelists")); }
void CodeLiteDiff::OnTabContextMenu(clContextMenuEvent& event) { event.Skip(); DoClear(); IEditor* activeEditor = m_mgr->GetActiveEditor(); CHECK_PTR_RET(activeEditor); m_leftFile = activeEditor->GetFileName(); // Edit the context menu wxMenuItem* mi = new wxMenuItem(event.GetMenu(), XRCID("diff_compare_with"), _("Compare with..."), ""); mi->SetBitmap(m_mgr->GetStdIcons()->LoadBitmap("diff")); event.GetMenu()->Append(mi); event.GetMenu()->Bind(wxEVT_MENU, &CodeLiteDiff::OnDiff, this, XRCID("diff_compare_with")); }
void Copyright::OnEditorContextMenu(clContextMenuEvent& event) { event.Skip(); event.GetMenu()->Append(XRCID("CR_insert_copyrights"), _("Insert Copyrights Block")); }