Esempio n. 1
0
SymbolViewPlugin::SymbolViewPlugin(IManager* manager)
    : IPlugin(manager)
{
    m_longName = _("Outline Plugin");
    m_shortName = wxT("Outline");

    OutlineSettings os;
    os.Load();

    Notebook* book = m_mgr->GetWorkspacePaneNotebook();
    if(IsPaneDetached()) {
        // Make the window child of the main panel (which is the grand parent of the notebook)
        DockablePane* cp =
            new DockablePane(book->GetParent()->GetParent(), book, _("Outline"), false, wxNullBitmap, wxSize(200, 200));
        m_view = new OutlineTab(cp, m_mgr);
        cp->SetChildNoReparent(m_view);
        m_view->m_isEnabled = true; // Enabled when detached
    } else {
        m_view = new OutlineTab(book, m_mgr);
        book->AddPage(m_view, _("Outline"), false);
    }
    EventNotifier::Get()->Bind(wxEVT_SHOW_WORKSPACE_TAB, &SymbolViewPlugin::OnToggleTab, this);
    m_mgr->AddWorkspaceTab(_("Outline"));
    m_mgr->GetWorkspacePaneNotebook()->Bind(wxEVT_BOOK_PAGE_CHANGED, &SymbolViewPlugin::OnPageChanged, this);
}
Esempio n. 2
0
CMakePlugin::CMakePlugin(IManager* manager)
    : IPlugin(manager)
    , m_configuration(NULL)
    , m_cmake(NULL)
    , m_settingsManager(new CMakeSettingsManager(this))
    , m_panel(NULL)
{
    m_longName = _("CMake integration with CodeLite");
    m_shortName = "CMakePlugin";

    // Create CMake configuration file
    m_configuration.reset(new CMakeConfiguration(clStandardPaths::Get().GetUserDataDir() +
                                                 wxFileName::GetPathSeparator() + "config/cmake.ini"));

    // Create cmake application
    m_cmake.reset(new CMake(m_configuration->GetProgramPath()));
    
    Notebook* book = m_mgr->GetWorkspacePaneNotebook();
    cmakeImages images;
    const wxBitmap& bmp = images.Bitmap("cmake_16");
    
    if(IsPaneDetached()) {
        DockablePane* cp = new DockablePane(book->GetParent()->GetParent(), book, HELP_TAB_NAME, bmp, wxSize(200, 200));
        m_helpTab = new CMakeHelpTab(cp, this);
        cp->SetChildNoReparent(m_helpTab);
    } else {
        m_helpTab = new CMakeHelpTab(book, this);
        book->AddPage(m_helpTab, HELP_TAB_NAME, false, bmp);
        m_mgr->AddWorkspaceTab(HELP_TAB_NAME);
    }

    // Bind events
    EventNotifier::Get()->Bind(
        wxEVT_CMD_PROJ_SETTINGS_SAVED, clProjectSettingsEventHandler(CMakePlugin::OnSaveConfig), this);
    EventNotifier::Get()->Bind(wxEVT_GET_PROJECT_BUILD_CMD, clBuildEventHandler(CMakePlugin::OnGetBuildCommand), this);
    EventNotifier::Get()->Bind(wxEVT_GET_PROJECT_CLEAN_CMD, clBuildEventHandler(CMakePlugin::OnGetCleanCommand), this);
    EventNotifier::Get()->Bind(
        wxEVT_GET_IS_PLUGIN_MAKEFILE, clBuildEventHandler(CMakePlugin::OnGetIsPluginMakefile), this);
    EventNotifier::Get()->Bind(wxEVT_PLUGIN_EXPORT_MAKEFILE, clBuildEventHandler(CMakePlugin::OnExportMakefile), this);
    EventNotifier::Get()->Bind(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(CMakePlugin::OnWorkspaceLoaded), this);
    EventNotifier::Get()->Bind(wxEVT_SHOW_WORKSPACE_TAB, &CMakePlugin::OnToggleHelpTab, this);
}
Esempio n. 3
0
SymbolViewPlugin::SymbolViewPlugin(IManager *manager)
    : IPlugin(manager)
{
    m_longName = _("Outline Plugin");
    m_shortName = wxT("Outline");
    
    OutlineSettings os;
    os.Load();
    
    Notebook *book = m_mgr->GetWorkspacePaneNotebook();
    if( IsPaneDetached() ) {
        // Make the window child of the main panel (which is the grand parent of the notebook)
        DockablePane *cp = new DockablePane(book->GetParent()->GetParent(), book, _("Outline"), wxNullBitmap, wxSize(200, 200));
        m_view = new OutlineTab(cp, m_mgr);
        cp->SetChildNoReparent(m_view);

    } else {
        m_view = new OutlineTab(book, m_mgr);
        book->AddPage(m_view, _("Outline"), false);
    }
}
Esempio n. 4
0
CMakePlugin::CMakePlugin(IManager* manager)
    : IPlugin(manager)
    , m_configuration(NULL)
    , m_cmake(NULL)
{
    m_longName = _("CMake integration with CodeLite");
    m_shortName = "CMakePlugin";

    // Create CMake configuration file
    m_configuration.reset(new CMakeConfiguration(
        clStandardPaths::Get().GetUserDataDir() + wxFileName::GetPathSeparator() + "config/cmake.ini"));

    // Create cmake application
    m_cmake.reset(new CMake(m_configuration->GetProgramPath()));

    Notebook* book = m_mgr->GetWorkspacePaneNotebook();
    cmakeImages images;
    const wxBitmap& bmp = images.Bitmap("cmake_16");

    if(IsPaneDetached()) {
        DockablePane* cp =
            new DockablePane(book->GetParent()->GetParent(), book, HELP_TAB_NAME, false, bmp, wxSize(200, 200));
        m_helpTab = new CMakeHelpTab(cp, this);
        cp->SetChildNoReparent(m_helpTab);
    } else {
        m_helpTab = new CMakeHelpTab(book, this);
        book->AddPage(m_helpTab, HELP_TAB_NAME, false, bmp);
        m_mgr->AddWorkspaceTab(HELP_TAB_NAME);
    }

    // Bind events
    EventNotifier::Get()->Bind(wxEVT_SHOW_WORKSPACE_TAB, &CMakePlugin::OnToggleHelpTab, this);
    EventNotifier::Get()->Bind(wxEVT_CONTEXT_MENU_PROJECT, &CMakePlugin::OnProjectContextMenu, this);
    EventNotifier::Get()->Bind(wxEVT_CONTEXT_MENU_WORKSPACE, &CMakePlugin::OnWorkspaceContextMenu, this);
    EventNotifier::Get()->Bind(wxEVT_PROJ_FILE_ADDED, &CMakePlugin::OnFileAdded, this);
    EventNotifier::Get()->Bind(wxEVT_PROJ_FILE_REMOVED, &CMakePlugin::OnFileRemoved, this);
    Bind(wxEVT_ASYNC_PROCESS_OUTPUT, &CMakePlugin::OnCMakeOutput, this);
    Bind(wxEVT_ASYNC_PROCESS_TERMINATED, &CMakePlugin::OnCMakeTerminated, this);
}
Esempio n. 5
0
void SymbolViewPlugin::OnPageChanged(wxBookCtrlEvent& e)
{
    e.Skip();
    if(m_view->IsShown()) {
        m_view->m_isEnabled = true;
        m_view->EditorChanged();
    } else if(IsPaneDetached()) {
        m_view->m_isEnabled = true;
        m_view->EditorChanged();
    } else {
        m_view->m_isEnabled = false;
        int sel = m_mgr->GetWorkspacePaneNotebook()->GetSelection();
        if(sel != wxNOT_FOUND) {
            wxString seletionText = m_mgr->GetWorkspacePaneNotebook()->GetPageText(sel);
            m_view->m_isEnabled = (seletionText == _("Outline"));
            if(m_view->m_isEnabled) { m_view->EditorChanged(); }
        } else {
            // the page is detached
            m_view->m_isEnabled = true; // just mark as active
        }
    }
}