Ejemplo n.º 1
0
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); }
    }
}
Ejemplo n.º 2
0
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);
        }
    }
}
Ejemplo n.º 3
0
void MainBook::OnWorkspaceReloadStarted(clCommandEvent& e)
{
    e.Skip();
    m_isWorkspaceReloading = true;
}
Ejemplo n.º 4
0
void MainBook::OnWorkspaceReloadEnded(clCommandEvent& e)
{
    e.Skip();
    m_isWorkspaceReloading = false;
}
Ejemplo n.º 5
0
void MainBook::OnDetachedEditorClosed(clCommandEvent& e)
{
    e.Skip();
    DoEraseDetachedEditor((IEditor*)e.GetClientData());
}
Ejemplo n.º 6
0
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);
}
Ejemplo n.º 7
0
void PhpSFTPHandler::OnFileSaved(clCommandEvent& e)
{
    e.Skip();
    if(!PHPWorkspace::Get()->IsOpen()) { return; }
    DoSyncFileWithRemote(e.GetFileName());
}
Ejemplo n.º 8
0
void PhpPlugin::OnGoingDown(clCommandEvent& event) { event.Skip(); }
Ejemplo n.º 9
0
void CodeCompletionManager::OnEnvironmentVariablesModified(clCommandEvent& event)
{
    event.Skip();
    Project::ClearBacktickCache();
    RefreshPreProcessorColouring();
}
Ejemplo n.º 10
0
void WebTools::OnFileLoaded(clCommandEvent& event)
{
    event.Skip();
    DoRefreshColours(event.GetFileName());
}
Ejemplo n.º 11
0
void OpenWindowsPanel::OnEditorSaved(clCommandEvent& event)
{
    event.Skip();
    if(!m_initDone) return;
    DoMarkModify(event.GetFileName(), false);
}
Ejemplo n.º 12
0
void LanguageServerCluster::OnCompileCommandsGenerated(clCommandEvent& event)
{
    event.Skip();
    this->Reload(); // restart the servers
}
Ejemplo n.º 13
0
void DebuggerCallstackView::OnUpdateBacktrace(clCommandEvent& e)
{
    e.Skip();
    Update(static_cast<DebuggerEventData*>(e.GetClientObject())->m_stack);
}
Ejemplo n.º 14
0
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 );
    }
}
Ejemplo n.º 15
0
void PhpPlugin::OnIsWorkspaceOpen(clCommandEvent& e)
{
    e.Skip();
    e.SetAnswer(PHPWorkspace::Get()->IsOpen());
}
Ejemplo n.º 16
0
void NewBuildTab::OnBuildAddLine(clCommandEvent& e)
{
    e.Skip(); // Allways call skip..
    m_output << e.GetString();
    DoProcessOutput(false, false);
}
Ejemplo n.º 17
0
void DebuggerDisassemblyTab::OnQueryFileLineDone(clCommandEvent& e) { e.Skip(); }