void OutputPane::OnToggleTab(clCommandEvent& event) { // Handle the core tabs if(m_tabs.count(event.GetString()) == 0) { event.Skip(); return; } const Tab& t = m_tabs.find(event.GetString())->second; if(event.IsSelected()) { // Insert the page int where = clTabTogglerHelper::IsTabInNotebook(GetNotebook(), t.m_label); if(where == wxNOT_FOUND) { GetNotebook()->AddPage(t.m_window, t.m_label, false, t.m_bmp); } else { GetNotebook()->SetSelection(where); } } else { // hide the tab int where = GetNotebook()->GetPageIndex(t.m_label); if(where != wxNOT_FOUND) { GetNotebook()->RemovePage(where); } } }
void clTabTogglerHelper::OnToggleOutputTab(clCommandEvent& event) { if(event.GetString() != m_outputTabName) { event.Skip(); return; } Notebook* book = clGetManager()->GetOutputPaneNotebook(); if(event.IsSelected()) { // show it int where = IsTabInNotebook(book, m_outputTabName); if(where == wxNOT_FOUND) { // Only show it if it does not exists in the notebook clGetManager()->GetOutputPaneNotebook()->AddPage(m_outputTab, m_outputTabName, false, m_outputTabBmp); } else { clGetManager()->GetOutputPaneNotebook()->SetSelection(where); } } else { int where = clGetManager()->GetOutputPaneNotebook()->GetPageIndex(m_outputTabName); if(where != wxNOT_FOUND) { clGetManager()->GetOutputPaneNotebook()->RemovePage(where); } } }
void MainBook::OnWorkspaceReloadStarted(clCommandEvent& e) { e.Skip(); m_isWorkspaceReloading = true; }
void MainBook::OnWorkspaceReloadEnded(clCommandEvent& e) { e.Skip(); m_isWorkspaceReloading = false; }
void MainBook::OnDetachedEditorClosed(clCommandEvent& e) { e.Skip(); DoEraseDetachedEditor((IEditor*)e.GetClientData()); }
void NewBuildTab::OnBuildEnded(clCommandEvent& e) { e.Skip(); CL_DEBUG("Build Ended!"); m_buildInProgress = false; DoProcessOutput(true, false); std::vector<clEditor*> editors; clMainFrame::Get()->GetMainBook()->GetAllEditors(editors, MainBook::kGetAll_Default); for(size_t i = 0; i < editors.size(); i++) { MarkEditor(editors.at(i)); } // Add a summary line wxString problemcount = wxString::Format(wxT("%d %s, %d %s"), m_errorCount, _("errors"), m_warnCount, _("warnings")); wxString term = problemcount; long elapsed = m_sw.Time() / 1000; if(elapsed > 10) { long sec = elapsed % 60; long hours = elapsed / 3600; long minutes = (elapsed % 3600) / 60; term << wxString::Format(wxT(", %s: %02ld:%02ld:%02ld %s"), _("total time"), hours, minutes, sec, _("seconds")); } m_output = term; DoProcessOutput(true, true); if(m_buildInterrupted) { wxString InterruptedMsg; InterruptedMsg << _("(Build Cancelled)") << wxT("\n\n"); m_output = InterruptedMsg; DoProcessOutput(true, false); } // Hide / Show the build tab according to the settings DoToggleWindow(); // make it invalid m_curError = m_errorsAndWarningsList.begin(); CL_DEBUG("Posting wxEVT_BUILD_ENDED event"); // 0 = first error // 1 = first error or warning // 2 = to the end if(m_buildTabSettings.GetBuildPaneScrollDestination() == ScrollToFirstError && !m_errorsList.empty()) { BuildLineInfo* bli = m_errorsList.front(); DoSelectAndOpen(bli->GetLineInBuildTab(), true); } if(m_buildTabSettings.GetBuildPaneScrollDestination() == ScrollToFirstItem && !m_errorsAndWarningsList.empty()) { BuildLineInfo* bli = m_errorsAndWarningsList.front(); DoSelectAndOpen(bli->GetLineInBuildTab(), true); } if(m_buildTabSettings.GetBuildPaneScrollDestination() == ScrollToEnd) { m_view->ScrollToEnd(); } // notify the plugins that the build has ended clBuildEvent buildEvent(wxEVT_BUILD_ENDED); buildEvent.SetErrorCount(m_errorCount); buildEvent.SetWarningCount(m_warnCount); EventNotifier::Get()->AddPendingEvent(buildEvent); }
void PhpSFTPHandler::OnFileSaved(clCommandEvent& e) { e.Skip(); if(!PHPWorkspace::Get()->IsOpen()) { return; } DoSyncFileWithRemote(e.GetFileName()); }
void PhpPlugin::OnGoingDown(clCommandEvent& event) { event.Skip(); }
void CodeCompletionManager::OnEnvironmentVariablesModified(clCommandEvent& event) { event.Skip(); Project::ClearBacktickCache(); RefreshPreProcessorColouring(); }
void WebTools::OnFileLoaded(clCommandEvent& event) { event.Skip(); DoRefreshColours(event.GetFileName()); }
void OpenWindowsPanel::OnEditorSaved(clCommandEvent& event) { event.Skip(); if(!m_initDone) return; DoMarkModify(event.GetFileName(), false); }
void LanguageServerCluster::OnCompileCommandsGenerated(clCommandEvent& event) { event.Skip(); this->Reload(); // restart the servers }
void DebuggerCallstackView::OnUpdateBacktrace(clCommandEvent& e) { e.Skip(); Update(static_cast<DebuggerEventData*>(e.GetClientObject())->m_stack); }
void NewBuildTab::OnBuildStarted(clCommandEvent& e) { e.Skip(); if ( IS_WINDOWS ) { m_cygwinRoot.Clear(); EnvSetter es; wxString cmd; cmd << "cygpath -w /"; wxArrayString arrOut; ProcUtils::SafeExecuteCommand(cmd, arrOut); if ( arrOut.IsEmpty() == false ) { m_cygwinRoot = arrOut.Item(0); } } m_buildInProgress = true; // Reload the build settings data EditorConfigST::Get()->ReadObject ( wxT ( "build_tab_settings" ), &m_buildTabSettings ); m_textRenderer->SetErrFgColor( m_buildTabSettings.GetErrorColour() ); m_textRenderer->SetWarnFgColor( m_buildTabSettings.GetWarnColour() ); m_autoHide = m_buildTabSettings.GetAutoHide(); m_showMe = (BuildTabSettingsData::ShowBuildPane)m_buildTabSettings.GetShowBuildPane(); m_skipWarnings = m_buildTabSettings.GetSkipWarnings(); if ( e.GetEventType() != wxEVT_SHELL_COMMAND_STARTED_NOCLEAN) { DoClear(); DoCacheRegexes(); } // Show the tab if needed OutputPane *opane = clMainFrame::Get()->GetOutputPane(); wxWindow *win(NULL); size_t sel = opane->GetNotebook()->GetSelection(); if(sel != Notebook::npos) win = opane->GetNotebook()->GetPage(sel); if(m_showMe == BuildTabSettingsData::ShowOnStart) { ManagerST::Get()->ShowOutputPane(OutputPane::BUILD_WIN, true); } else if (m_showMe == BuildTabSettingsData::ShowOnEnd && m_autoHide && ManagerST::Get()->IsPaneVisible(opane->GetCaption()) && win == this ) { // user prefers to see build/errors tabs only at end of unsuccessful build ManagerST::Get()->HidePane(opane->GetName()); } m_sw.Start(); BuildEventDetails* bed = dynamic_cast<BuildEventDetails*>(e.GetClientObject()); if ( bed ) { // notify the plugins that the build had started clBuildEvent buildEvent(wxEVT_BUILD_STARTED); buildEvent.SetProjectName( bed->GetProjectName() ); buildEvent.SetConfigurationName( bed->GetConfiguration() ); EventNotifier::Get()->AddPendingEvent( buildEvent ); } }
void PhpPlugin::OnIsWorkspaceOpen(clCommandEvent& e) { e.Skip(); e.SetAnswer(PHPWorkspace::Get()->IsOpen()); }
void NewBuildTab::OnBuildAddLine(clCommandEvent& e) { e.Skip(); // Allways call skip.. m_output << e.GetString(); DoProcessOutput(false, false); }
void DebuggerDisassemblyTab::OnQueryFileLineDone(clCommandEvent& e) { e.Skip(); }