bool MainBook::DoSelectPage(wxWindow* win) { LEditor* editor = dynamic_cast<LEditor*>(win); if(editor) { editor->SetActive(); m_quickFindBar->SetEditor(editor); } else { m_quickFindBar->ShowForPlugins(); } // Remove context menu if needed DoHandleFrameMenu(editor); if(!editor) { clMainFrame::Get()->SetFrameTitle(NULL); clMainFrame::Get()->GetStatusBar()->SetLinePosColumn(wxEmptyString); UpdateNavBar(NULL); SendCmdEvent(wxEVT_CMD_PAGE_CHANGED, win); } else { // if(editor->GetContext()->GetName() == wxT("C++")) { // if(clMainFrame::Get()->GetMenuBar()->FindMenu(wxT("C++")) == wxNOT_FOUND) { // clMainFrame::Get()->GetMenuBar()->Append(wxXmlResource::Get()->LoadMenu(wxT("editor_right_click")), // wxT("C++")); // } // } wxCommandEvent event(wxEVT_ACTIVE_EDITOR_CHANGED); EventNotifier::Get()->AddPendingEvent(event); } return true; }
bool MainBook::DoSelectPage(wxWindow* win) { LEditor *editor = dynamic_cast<LEditor*>(win); if ( editor ) { editor->SetActive(); m_quickFindBar->SetEditor( editor ); } else { m_quickFindBar->ShowForPlugins(); } // Remove context menu if needed DoHandleFrameMenu(editor); if (!editor) { clMainFrame::Get()->SetFrameTitle(NULL); clMainFrame::Get()->SetStatusMessage(wxEmptyString, 1); // clear line & column indicator UpdateNavBar(NULL); SendCmdEvent(wxEVT_CMD_PAGE_CHANGED, win); } else { if (editor->GetContext()->GetName() == wxT("C++")) { if (clMainFrame::Get()->GetMenuBar()->FindMenu(wxT("C++")) == wxNOT_FOUND) { clMainFrame::Get()->GetMenuBar()->Append(wxXmlResource::Get()->LoadMenu(wxT("editor_right_click")), wxT("C++")); } } SendCmdEvent(wxEVT_ACTIVE_EDITOR_CHANGED, (IEditor*)editor); } return true; }
void MainBook::ShowNavBar(bool s) { m_navBar->DoShow(s); UpdateNavBar(GetActiveEditor()); }