コード例 #1
0
ファイル: outline_tab.cpp プロジェクト: AndrianDTR/codelite
OutlineTab::OutlineTab(wxWindow* parent, IManager* mgr)
    : OutlineTabBaseClass(parent)
    , m_mgr(mgr)
{
    m_tree = new svSymbolTree(this, m_mgr, wxID_ANY);
    m_tree->Connect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(OutlineTab::OnMenu), NULL, this);
    
    m_tree->AssignImageList( svSymbolTree::CreateSymbolTreeImages() );

    GetSizer()->Add(m_tree, 1, wxEXPAND);

    EventNotifier::Get()->Connect(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(OutlineTab::OnWorkspaceLoaded), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(OutlineTab::OnActiveEditorChanged), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_EDITOR_CLOSING, wxCommandEventHandler(OutlineTab::OnEditorClosed), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_ALL_EDITORS_CLOSED, wxCommandEventHandler(OutlineTab::OnAllEditorsClosed), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(OutlineTab::OnWorkspaceClosed), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_CMD_RETAG_COMPLETED, wxCommandEventHandler(OutlineTab::OnFilesTagged), NULL, this);
    
    Connect(wxEVT_SV_GOTO_DEFINITION,  wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Connect(wxEVT_SV_GOTO_DECLARATION, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Connect(wxEVT_SV_FIND_REFERENCES,  wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Connect(wxEVT_SV_RENAME_SYMBOL,    wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    m_themeHelper = new ThemeHandlerHelper(this);
    
}
コード例 #2
0
void OccurrencesHighlighting::OnRelease(bool appShutDown)
{
    // do de-initialization for your plugin
    // if appShutDown is true, the plugin is unloaded because Code::Blocks is being shut down,
    // which means you must not use any of the SDK Managers
    // NOTE: after this function, the inherited member variable
    // m_IsAttached will be FALSE...

    Manager::Get()->RemoveAllEventSinksFor(this);

    EditorHooks::UnregisterHook(m_FunctorId);

    delete m_pHighlighter;
    m_pHighlighter = NULL;

    m_pPanel->GetListCtrl()->Disconnect(wxEVT_COMMAND_LIST_KEY_DOWN, wxListEventHandler(OccurrencesHighlighting::OnListKeyDown), NULL, this);
    Disconnect(idMenuEntryPermanent, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(OccurrencesHighlighting::OnHighlightPermanently), NULL, (wxEvtHandler*)this);
    Disconnect(idMenuEntryRemove,    wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(OccurrencesHighlighting::OnHighlightRemove),      NULL, (wxEvtHandler*)this);

    m_pPanel->GetListCtrl()->Disconnect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(OccurrencesHighlighting::OnPanelPopupMenu), NULL, this);
    Disconnect(idContextRemove, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(OccurrencesHighlighting::OnRemove), NULL, this);

    // remove panel from docking system
    if ( m_pPanel && !appShutDown )
    {
        CodeBlocksDockEvent docevt(cbEVT_REMOVE_DOCK_WINDOW);
        docevt.pWindow = m_pPanel;
        Manager::Get()->ProcessEvent(docevt);
        // and destroy the panel
        m_pPanel->Destroy();
        m_pPanel = NULL;
    }
}
コード例 #3
0
OutlineTab::~OutlineTab()
{
    wxDELETE(m_themeHelper);
    m_tree->Disconnect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(OutlineTab::OnMenu), NULL, this);

    EventNotifier::Get()->Disconnect(
        wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(OutlineTab::OnActiveEditorChanged), NULL, this);
    EventNotifier::Get()->Unbind(wxEVT_CMD_PAGE_CHANGED, &OutlineTab::OnActiveEditorChanged, this);
    EventNotifier::Get()->Disconnect(
        wxEVT_EDITOR_CLOSING, wxCommandEventHandler(OutlineTab::OnEditorClosed), NULL, this);
    EventNotifier::Get()->Disconnect(
        wxEVT_ALL_EDITORS_CLOSED, wxCommandEventHandler(OutlineTab::OnAllEditorsClosed), NULL, this);
    EventNotifier::Get()->Disconnect(
        wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(OutlineTab::OnWorkspaceClosed), NULL, this);
    EventNotifier::Get()->Disconnect(
        wxEVT_CMD_RETAG_COMPLETED, wxCommandEventHandler(OutlineTab::OnFilesTagged), NULL, this);
    EventNotifier::Get()->Disconnect(wxEVT_FILE_SAVED, clCommandEventHandler(OutlineTab::OnEditorSaved), NULL, this);
    Disconnect(
        wxEVT_SV_GOTO_DEFINITION, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Disconnect(
        wxEVT_SV_GOTO_DECLARATION, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Disconnect(
        wxEVT_SV_FIND_REFERENCES, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Disconnect(
        wxEVT_SV_RENAME_SYMBOL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
}
コード例 #4
0
OutlineTab::OutlineTab(wxWindow* parent, IManager* mgr)
    : OutlineTabBaseClass(parent)
    , m_mgr(mgr)
    , m_sortCxxTreeAlphabetically(false)
{
    m_tree = new svSymbolTree(m_panelCxx, m_mgr, wxID_ANY);
    m_sortCxxTreeAlphabetically =
        clConfig::Get().Read("OutlineView/SortCxxAlphabetically", m_sortCxxTreeAlphabetically);
    m_tree->SetSortByLineNumber(!m_sortCxxTreeAlphabetically);
    
    m_panelCxx->GetSizer()->Add(m_tree, 1, wxEXPAND);
    m_tree->Connect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(OutlineTab::OnMenu), NULL, this);
    m_tree->AssignImageList(svSymbolTree::CreateSymbolTreeImages());
    m_treeCtrlPhp->SetManager(m_mgr);

    EventNotifier::Get()->Connect(
        wxEVT_ACTIVE_EDITOR_CHANGED, wxCommandEventHandler(OutlineTab::OnActiveEditorChanged), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_EDITOR_CLOSING, wxCommandEventHandler(OutlineTab::OnEditorClosed), NULL, this);
    EventNotifier::Get()->Connect(
        wxEVT_ALL_EDITORS_CLOSED, wxCommandEventHandler(OutlineTab::OnAllEditorsClosed), NULL, this);
    EventNotifier::Get()->Connect(
        wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(OutlineTab::OnWorkspaceClosed), NULL, this);
    EventNotifier::Get()->Connect(
        wxEVT_CMD_RETAG_COMPLETED, wxCommandEventHandler(OutlineTab::OnFilesTagged), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_FILE_SAVED, clCommandEventHandler(OutlineTab::OnEditorSaved), NULL, this);
    EventNotifier::Get()->Bind(wxEVT_CMD_PAGE_CHANGED, &OutlineTab::OnActiveEditorChanged, this);
    Connect(
        wxEVT_SV_GOTO_DEFINITION, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Connect(
        wxEVT_SV_GOTO_DECLARATION, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Connect(
        wxEVT_SV_FIND_REFERENCES, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    Connect(wxEVT_SV_RENAME_SYMBOL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(OutlineTab::OnItemSelectedUI), NULL, this);
    m_themeHelper = new ThemeHandlerHelper(this);
}
コード例 #5
0
void OccurrencesHighlighting::OnAttach()
{
    // do whatever initialization you need for your plugin
    // NOTE: after this function, the inherited member variable
    // m_IsAttached will be TRUE...
    // You should check for it in other functions, because if it
    // is FALSE, it means that the application did *not* "load"
    // (see: does not need) this plugin...

    m_pHighlighter = new Highlighter(m_texts);

    EditorHooks::HookFunctorBase *editor_hook = new EditorHooks::HookFunctor<OccurrencesHighlighting>(this, &OccurrencesHighlighting::OnEditorHook);
    m_FunctorId = EditorHooks::RegisterHook(editor_hook);

    m_pPanel = new OccurrencesPanel(Manager::Get()->GetAppWindow());

    // add the foldpanel to the docking system
    CodeBlocksDockEvent dockevt(cbEVT_ADD_DOCK_WINDOW);
    dockevt.name = _T("HighlightedOccurrences");
    dockevt.title = _("Highlighted Occurrences");
    dockevt.pWindow = m_pPanel;
    dockevt.minimumSize.Set(50, 50);
    dockevt.desiredSize.Set(150, 100);
    dockevt.floatingSize.Set(100, 150);
    dockevt.dockSide = CodeBlocksDockEvent::dsLeft;
    dockevt.stretch = true;
    Manager::Get()->ProcessEvent(dockevt);

    m_pPanel->GetListCtrl()->Connect(wxEVT_COMMAND_LIST_KEY_DOWN, wxListEventHandler(OccurrencesHighlighting::OnListKeyDown), NULL, this);
    Connect(idMenuEntryPermanent, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(OccurrencesHighlighting::OnHighlightPermanently), NULL, this);
    Connect(idMenuEntryRemove,    wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(OccurrencesHighlighting::OnHighlightRemove),      NULL, this);

    m_pPanel->GetListCtrl()->Connect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(OccurrencesHighlighting::OnPanelPopupMenu), NULL, this);
    Connect(idContextRemove, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(OccurrencesHighlighting::OnRemove), NULL, this);
}
コード例 #6
0
ファイル: new_build_tab.cpp プロジェクト: Hmaal/codelite
NewBuildTab::~NewBuildTab()
{
    m_listctrl->Disconnect(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxContextMenuEventHandler(NewBuildTab::OnMenu), NULL, this);
    
    EventNotifier::Get()->Disconnect( wxEVT_SHELL_COMMAND_STARTED,         clCommandEventHandler ( NewBuildTab::OnBuildStarted ),    NULL, this );
    EventNotifier::Get()->Disconnect( wxEVT_SHELL_COMMAND_STARTED_NOCLEAN, clCommandEventHandler ( NewBuildTab::OnBuildStarted ),    NULL, this );
    EventNotifier::Get()->Disconnect( wxEVT_SHELL_COMMAND_ADDLINE,         clCommandEventHandler ( NewBuildTab::OnBuildAddLine ),    NULL, this );
    EventNotifier::Get()->Disconnect( wxEVT_SHELL_COMMAND_PROCESS_ENDED,   clCommandEventHandler ( NewBuildTab::OnBuildEnded ),      NULL, this );
    wxTheApp->Disconnect(XRCID("next_build_error"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler ( NewBuildTab::OnNextBuildError ),   NULL, this );
    wxTheApp->Disconnect(XRCID("next_build_error"), wxEVT_UPDATE_UI,             wxUpdateUIEventHandler ( NewBuildTab::OnNextBuildErrorUI ), NULL, this );
}
コード例 #7
0
CompilerMainPageBase::~CompilerMainPageBase()
{
    m_button222->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnAddCompilers), NULL, this);
    m_listBoxCompilers->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(CompilerMainPageBase::OnCompilerSelected), NULL, this);
    m_listBoxCompilers->Disconnect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(CompilerMainPageBase::OnContextMenu), NULL, this);
    m_pgMgrTools->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCustomEditorButtonClicked), NULL, this);
    m_pgMgrTools->Disconnect(wxEVT_PG_CHANGED, wxPropertyGridEventHandler(CompilerMainPageBase::OnValueChanged), NULL, this);
    m_listErrPatterns->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnErrItemActivated), NULL, this);
    m_btnAddErrPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnAddErrPattern), NULL, this);
    m_btnDelErrPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnDelErrPattern), NULL, this);
    m_btnDelErrPattern->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnErrorPatternSelectedUI), NULL, this);
    m_btnUpdateErrPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnUpdateErrPattern), NULL, this);
    m_btnUpdateErrPattern->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnErrorPatternSelectedUI), NULL, this);
    m_listWarnPatterns->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnWarnItemActivated), NULL, this);
    m_btnAddWarnPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnAddWarnPattern), NULL, this);
    m_btnDelWarnPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnDelWarnPattern), NULL, this);
    m_btnDelWarnPattern->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnWarningPatternSelectedUI), NULL, this);
    m_btnUpdateWarnPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnUpdateWarnPattern), NULL, this);
    m_btnUpdateWarnPattern->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnWarningPatternSelectedUI), NULL, this);
    m_listCompilerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionActivated), NULL, this);
    m_listCompilerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionDeSelected), NULL, this);
    m_listCompilerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionSelected), NULL, this);
    m_buttonCompilerOption->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewCompilerOption), NULL, this);
    m_buttonDeleteCompilerOption->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteCompilerOption), NULL, this);
    m_listLinkerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionActivated), NULL, this);
    m_listLinkerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionDeSelected), NULL, this);
    m_listLinkerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionSelected), NULL, this);
    m_buttonLinkerOption->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewLinkerOption), NULL, this);
    m_buttonDeleteLinkerOption->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteLinkerOption), NULL, this);
    m_listSwitches->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnItemActivated), NULL, this);
    m_listSwitches->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnItemSelected), NULL, this);
    m_listCtrlFileTypes->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnFileTypeActivated), NULL, this);
    m_listCtrlFileTypes->Disconnect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnFileTypeDeSelected), NULL, this);
    m_listCtrlFileTypes->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnFileTypeSelected), NULL, this);
    m_buttonNewFileType->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewFileType), NULL, this);
    m_buttonDeleteFileType->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteFileType), NULL, this);
    m_textCtrlGlobalIncludePath->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_button67->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnEditIncludePaths), NULL, this);
    m_textCtrlGlobalLibPath->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_button69->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnEditLibraryPaths), NULL, this);
    m_textObjectExtension->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_textDependExtension->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_textPreprocessExtension->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_checkBoxGenerateDependenciesFiles->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_checkBoxObjectNameSameAsFileName->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_checkBoxReadObjectsFromFile->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    
}
コード例 #8
0
Notebook::Notebook(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style)
    : wxNotebook(parent, id, pos, size, wxNB_DEFAULT)
    , m_popupWin(NULL)
    , m_contextMenu(NULL)
    , m_style(style)
    , m_notify (true)
    , m_imgList(NULL)
    , m_startingTab(Notebook::npos)
{
    Initialize();
    SetPadding(wxSize(0, 0));
    Connect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,  wxNotebookEventHandler(Notebook::OnIternalPageChanged),  NULL, this);
    Connect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, wxNotebookEventHandler(Notebook::OnIternalPageChanging), NULL, this);
    Connect(wxEVT_NAVIGATION_KEY,                 wxNavigationKeyEventHandler(Notebook::OnNavigationKey),  NULL, this);
    Connect(wxEVT_MIDDLE_DOWN,                    wxMouseEventHandler(Notebook::OnMouseMiddle),            NULL, this);
    Connect(wxEVT_LEFT_DCLICK,                    wxMouseEventHandler(Notebook::OnMouseLeftDClick),        NULL, this);
    Connect(wxEVT_CONTEXT_MENU,                   wxContextMenuEventHandler(Notebook::OnMenu),             NULL, this);
}
コード例 #9
0
ファイル: StatusView.cpp プロジェクト: idgaf/FileZilla3
CStatusView::CStatusView(wxWindow* parent, wxWindowID id)
	: wxWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER)
{
	m_pTextCtrl = 0;
	m_pTextCtrl = new CFastTextCtrl(this);
	m_pTextCtrl->SetFont(GetFont());

	m_pTextCtrl->Connect(wxID_ANY, wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(CStatusView::OnContextMenu), 0, this);

	m_nLineCount = 0;

	InitDefAttr();

	m_shown = IsShown();
	
#ifdef __WXMAC__
	m_insertionPoint = 0;
#endif
}
コード例 #10
0
clTreeCtrlPanelDefaultPageBase::clTreeCtrlPanelDefaultPageBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC9D6CInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* boxSizer167 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer167);
    
    m_panel169 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL|wxBORDER_NONE);
    m_panel169->SetBackgroundColour(wxColour(wxT("rgb(220,220,220)")));
    
    boxSizer167->Add(m_panel169, 1, wxALL|wxEXPAND, 0);
    
    wxBoxSizer* boxSizer171 = new wxBoxSizer(wxVERTICAL);
    m_panel169->SetSizer(boxSizer171);
    
    boxSizer171->Add(0, 0, 1, wxALL, 5);
    
    m_staticText177 = new wxStaticText(m_panel169, wxID_ANY, _("DRAG AND DROP\nA FOLDER HERE"), wxDefaultPosition, wxSize(-1,-1), wxALIGN_CENTRE);
    m_staticText177->SetForegroundColour(wxColour(wxT("rgb(128,128,128)")));
    wxFont m_staticText177Font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    m_staticText177Font.SetWeight(wxFONTWEIGHT_BOLD);
    m_staticText177->SetFont(m_staticText177Font);
    
    boxSizer171->Add(m_staticText177, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
    
    boxSizer171->Add(0, 0, 1, wxALL, 5);
    
    SetName(wxT("clTreeCtrlPanelDefaultPageBase"));
    SetSize(500,300);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    // Connect events
    m_panel169->Connect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(clTreeCtrlPanelDefaultPageBase::OnDefaultPageContextMenu), NULL, this);
    
}
コード例 #11
0
Notebook::~Notebook()
{
    Disconnect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,  wxNotebookEventHandler(Notebook::OnIternalPageChanged),  NULL, this);
    Disconnect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, wxNotebookEventHandler(Notebook::OnIternalPageChanging), NULL, this);
    Disconnect(wxEVT_NAVIGATION_KEY,                 wxNavigationKeyEventHandler(Notebook::OnNavigationKey),  NULL, this);
    Disconnect(wxEVT_MIDDLE_DOWN,                    wxMouseEventHandler(Notebook::OnMouseMiddle),            NULL, this);
    Disconnect(wxEVT_LEFT_DCLICK,                    wxMouseEventHandler(Notebook::OnMouseLeftDClick),        NULL, this);
    Disconnect(wxEVT_CONTEXT_MENU,                   wxContextMenuEventHandler(Notebook::OnMenu),             NULL, this);

    std::map<wxWindow*, MyGtkPageInfo*>::iterator iter = m_gtk_page_info.begin();
    for(; iter != m_gtk_page_info.end(); iter++) {
        gtk_widget_destroy(iter->second->m_button);
        delete iter->second;
    }
    m_gtk_page_info.clear();

    if(m_imgList) {
        delete m_imgList;
        m_imgList = NULL;
    }
}
コード例 #12
0
ファイル: compiler_pages.cpp プロジェクト: HTshandou/codelite
CompilerMainPageBase::~CompilerMainPageBase()
{
    m_button222->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnAddCompilers), NULL, this);
    m_listBoxCompilers->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(CompilerMainPageBase::OnCompilerSelected), NULL, this);
    m_listBoxCompilers->Disconnect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(CompilerMainPageBase::OnContextMenu), NULL, this);
    m_pgMgrTools->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCustomEditorButtonClicked), NULL, this);
    m_pgMgrTools->Disconnect(wxEVT_PG_CHANGED, wxPropertyGridEventHandler(CompilerMainPageBase::OnValueChanged), NULL, this);
    m_listErrPatterns->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnErrItemActivated), NULL, this);
    m_btnAddErrPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnAddErrPattern), NULL, this);
    m_btnDelErrPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnDelErrPattern), NULL, this);
    m_btnDelErrPattern->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnErrorPatternSelectedUI), NULL, this);
    m_btnUpdateErrPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnUpdateErrPattern), NULL, this);
    m_btnUpdateErrPattern->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnErrorPatternSelectedUI), NULL, this);
    m_listWarnPatterns->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnWarnItemActivated), NULL, this);
    m_btnAddWarnPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnAddWarnPattern), NULL, this);
    m_btnDelWarnPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnDelWarnPattern), NULL, this);
    m_btnDelWarnPattern->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnWarningPatternSelectedUI), NULL, this);
    m_btnUpdateWarnPattern->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnUpdateWarnPattern), NULL, this);
    m_btnUpdateWarnPattern->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnWarningPatternSelectedUI), NULL, this);
    m_listCompilerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionActivated), NULL, this);
    m_listCompilerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionDeSelected), NULL, this);
    m_listCompilerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionSelected), NULL, this);
    m_buttonCompilerOption->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewCompilerOption), NULL, this);
    m_buttonDeleteCompilerOption->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteCompilerOption), NULL, this);
    m_listLinkerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionActivated), NULL, this);
    m_listLinkerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionDeSelected), NULL, this);
    m_listLinkerOptions->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionSelected), NULL, this);
    m_buttonLinkerOption->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewLinkerOption), NULL, this);
    m_buttonDeleteLinkerOption->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteLinkerOption), NULL, this);
    m_listSwitches->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnItemActivated), NULL, this);
    m_listSwitches->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnItemSelected), NULL, this);
    m_listCtrlFileTypes->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnFileTypeActivated), NULL, this);
    m_listCtrlFileTypes->Disconnect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnFileTypeDeSelected), NULL, this);
    m_listCtrlFileTypes->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnFileTypeSelected), NULL, this);
    m_buttonNewFileType->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewFileType), NULL, this);
    m_buttonDeleteFileType->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteFileType), NULL, this);
    m_button67->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnEditIncludePaths), NULL, this);
    m_button69->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnEditLibraryPaths), NULL, this);
    
}
コード例 #13
0
ファイル: SpyUserPanel.cpp プロジェクト: beyondlwm/Beats
CSpyUserPanel::CSpyUserPanel(const SBeatsSocket* pSockInfo,
                             HMODULE hSpyDLLHandle,
                             wxWindow *parent, 
                             wxWindowID winid /*= wxID_ANY*/, 
                             const wxPoint& pos /*= wxDefaultPosition*/, 
                             const wxSize& size /*= wxDefaultSize*/, 
                             long style /*= wxTAB_TRAVERSAL | wxNO_BORDER*/, 
                             const wxString& name /*= wxPanelNameStr*/ )
: super(parent, winid, pos, size, style, name)
, m_pSocketInfo(pSockInfo)
, m_pDiskInfoCache(NULL)
, m_pRootDirectoryCache(NULL)
, m_hSpyDllHandle(hSpyDLLHandle)
, m_uCurSelectHistoryIndex(0)
{
    BEATS_ASSERT(hSpyDLLHandle != NULL, _T("Invalid spy dll handle!"));
    wxBoxSizer* pUserPanelSizer = new wxBoxSizer(wxHORIZONTAL);

    wxBoxSizer* pLeftSizer = new wxBoxSizer(wxVERTICAL);
    wxStaticBoxSizer* pInfoSizer = new wxStaticBoxSizer(wxVERTICAL, this, _T("详细信息"));
    sockaddr_in sockaddrInfo;
    int nSize = sizeof(sockaddrInfo);
    bool bGetPeerSuccess = SOCKET_ERROR != ::getpeername(pSockInfo->m_socket, (sockaddr*)(&sockaddrInfo), &nSize); 
    m_pPeerAddrLabel = new wxStaticText(this, wxID_ANY, bGetPeerSuccess ? 
                                                        wxString::Format(_T("节点地址: %s:%d"), inet_ntoa(sockaddrInfo.sin_addr), sockaddrInfo.sin_port):
                                                        wxString(_T("节点地址:获取失败")));
    pInfoSizer->Add(m_pPeerAddrLabel, 0, wxEXPAND, 0);

    m_pPeerNameLabel = new wxStaticText(this, wxID_ANY, _T("节点名称: Unknown"));
    pInfoSizer->Add(m_pPeerNameLabel, 0, wxEXPAND, 0);

    FILETIME fileTime;
    SYSTEMTIME sysTime;
    GetLocalTime(&sysTime);
    SystemTimeToFileTime(&sysTime, &fileTime);
    
    ULARGE_INTEGER curTimeLarge;
    memcpy(&curTimeLarge, &fileTime, sizeof(curTimeLarge));
    curTimeLarge.QuadPart = curTimeLarge.QuadPart - GetTickCount() + m_pSocketInfo->m_uCreateTime;
    memcpy(&fileTime, &curTimeLarge, sizeof(fileTime));
    FileTimeToSystemTime(&fileTime, & sysTime);

    m_pConnectTimeInfoLabel = new wxStaticText(this, wxID_ANY, wxString::Format(_T("连接建立时间: %d:%d.%d.%d"), sysTime.wHour, sysTime.wMinute, sysTime.wSecond, sysTime.wMilliseconds));
    pInfoSizer->Add(m_pConnectTimeInfoLabel, 0, wxEXPAND, 0);

    m_pCurrentStateLabel = new wxStaticText(this, wxID_ANY, _T("当前状态: 空闲"));
    pInfoSizer->Add(m_pCurrentStateLabel, 0, wxEXPAND, 0);

    m_pUploadSpeedLabel = new wxStaticText(this, wxID_ANY, _T("上传速度: 0 kb/s"));
    pInfoSizer->Add(m_pUploadSpeedLabel, 0, wxEXPAND, 0);
    m_pUploadDataCountLabel = new wxStaticText(this, wxID_ANY, _T("上传数据量: 0 bytes"));
    pInfoSizer->Add(m_pUploadDataCountLabel, 0, wxEXPAND, 0);

    m_pDownloadSpeedLabel = new wxStaticText(this, wxID_ANY, _T("下载速度: 0 kb/s"));
    pInfoSizer->Add(m_pDownloadSpeedLabel, 0, wxEXPAND, 0);
    m_pDownloadDataCountLabel = new wxStaticText(this, wxID_ANY, _T("下载数据量: 0 bytes"));
    pInfoSizer->Add(m_pDownloadDataCountLabel, 0, wxEXPAND, 0);

    wxStaticBoxSizer* pSpyConsoleSizer = new wxStaticBoxSizer(wxVERTICAL, this, _T("命令控制台"));
    m_pConsoleTextCtrl = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_RICH | wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP);
    pSpyConsoleSizer->Add(m_pConsoleTextCtrl, 1, wxEXPAND, 0);
    
    m_pConsoleInputTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_NO_VSCROLL | wxTE_PROCESS_ENTER );
    m_pConsoleInputTextCtrl->SetMaxLength( 256 ); 
    pSpyConsoleSizer->Add( m_pConsoleInputTextCtrl, 0, wxEXPAND, 5 );

    pInfoSizer->Add(pSpyConsoleSizer, 1, wxEXPAND, 0);

    pLeftSizer->Add(pInfoSizer, 1, wxEXPAND, 0);
    pUserPanelSizer->Add(pLeftSizer, 1, wxEXPAND, 0);
    wxBoxSizer* pRightSizer = new wxBoxSizer(wxVERTICAL);
    pUserPanelSizer->Add(pRightSizer, 1, wxEXPAND, 0);

    wxStaticBoxSizer* pSpyFuncSizer = new wxStaticBoxSizer(wxVERTICAL, this, _T("功能区"));
    wxBoxSizer* pCommandExecutionSizer = new wxBoxSizer(wxHORIZONTAL);
    m_pExecuteCommandButton = new wxButton(this, wxID_ANY, _T("执行"));
    m_pCommandChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, eSCT_Count, Command_Type_String, 0 );
    m_pCommandChoice->SetSelection( 0 );
    pCommandExecutionSizer->Add(m_pCommandChoice, 1, wxEXPAND, 0);
    pCommandExecutionSizer->Add(m_pExecuteCommandButton, 0, wxEXPAND, 0);
    pSpyFuncSizer->Add(pCommandExecutionSizer, 0, wxEXPAND, 0);

    wxStaticBoxSizer* pFileExplorerSizer = new wxStaticBoxSizer(wxVERTICAL, this, _T("远程文件"));
    wxBoxSizer* pFileLocationSizer = new wxBoxSizer(wxHORIZONTAL);
    wxStaticText* pFileLocationLabel = new wxStaticText(this, wxID_ANY, _T("地址"));
    pFileLocationSizer->Add(pFileLocationLabel, 0, wxALIGN_CENTER | wxALL, 0);
    m_pFileLocationText = new wxTextCtrl(this, wxID_ANY);
    pFileLocationSizer->Add(m_pFileLocationText, 1, wxEXPAND | wxLEFT | wxRIGHT , 5);
    m_pRefreshFileInfoButton = new wxButton(this, wxID_ANY, _T("刷新"));
    pFileLocationSizer->Add(m_pRefreshFileInfoButton, 0, wxALIGN_CENTER | wxALL, 0);
    pFileExplorerSizer->Add(pFileLocationSizer, 0, wxEXPAND, 0);

    m_pRemoteFileCtrl = new CVirtualFileCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT);
    pFileExplorerSizer->Add(m_pRemoteFileCtrl, 1, wxEXPAND, 5);

    pRightSizer->Add(pSpyFuncSizer, 0, wxEXPAND, 0);
    pRightSizer->Add(pFileExplorerSizer, 1, wxEXPAND, 0);
    
    this->SetSizer(pUserPanelSizer);

    m_pConsoleInputTextCtrl->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( CSpyUserPanel::OnSpyConsoleCommandEnter ), NULL, this );
    m_pConsoleInputTextCtrl->Connect( wxEVT_KEY_UP, wxKeyEventHandler( CSpyUserPanel::OnSpyConsoleCommandKeypress), NULL, this );
    m_pExecuteCommandButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CSpyUserPanel::OnSpyCommandExecuteBtnClick ), NULL, this );
    m_pRemoteFileCtrl->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CSpyUserPanel::OnSpyFileItemActivated), NULL, this);
    m_pRemoteFileCtrl->Connect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(CSpyUserPanel::OnSpyRightClickFileCtrl), NULL, this);
    this->Connect(wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler(CSpyUserPanel::OnSpySelectFileCtrlMenu), NULL, this);
    m_pRefreshFileInfoButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CSpyUserPanel::OnSpyRefreshFileBtnClick ), NULL, this );
    
    // Do some initialize action.
    SendCommand("cd");
    GetFileInfo(_T(""), true);
}
コード例 #14
0
clTreeCtrlPanelDefaultPageBase::~clTreeCtrlPanelDefaultPageBase()
{
    m_panel169->Disconnect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(clTreeCtrlPanelDefaultPageBase::OnDefaultPageContextMenu), NULL, this);
    
}
コード例 #15
0
ファイル: new_build_tab.cpp プロジェクト: Hmaal/codelite
NewBuildTab::NewBuildTab(wxWindow* parent)
    : wxPanel(parent)
    , m_warnCount(0)
    , m_errorCount(0)
    , m_buildInterrupted(false)
    , m_autoHide (false)
    , m_showMe(BuildTabSettingsData::ShowOnStart)
    , m_skipWarnings(false)
    , m_buildpaneScrollTo(ScrollToFirstError)
    , m_buildInProgress(false)
{
    m_curError = m_errorsAndWarningsList.end();
    wxBoxSizer* bs = new wxBoxSizer(wxHORIZONTAL);
    SetSizer(bs);

    // Determine the row height
    wxBitmap tmpBmp(1, 1);
    wxMemoryDC memDc;
    memDc.SelectObject(tmpBmp);
    wxFont fnt = DoGetFont();
    int xx, yy;
    memDc.GetTextExtent(wxT("Tp"), &xx, &yy, NULL, NULL, &fnt);
    int style = wxDV_NO_HEADER|wxDV_MULTIPLE;
    //style |= wxDV_ROW_LINES;

    m_listctrl = new wxDataViewListCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style);
    m_listctrl->Connect(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxContextMenuEventHandler(NewBuildTab::OnMenu), NULL, this);
    
    m_listctrl->Connect(XRCID("copy_all"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(NewBuildTab::OnCopy), NULL, this);
    m_listctrl->Connect(wxID_COPY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(NewBuildTab::OnCopySelection), NULL, this);
    m_listctrl->Connect(wxID_PASTE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(NewBuildTab::OnOpenInEditor), NULL, this);
    m_listctrl->Connect(wxID_CLEAR, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(NewBuildTab::OnClear), NULL, this);
    
    m_listctrl->Connect(XRCID("copy_all"), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(NewBuildTab::OnCopyUI), NULL, this);
    m_listctrl->Connect(wxID_COPY, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(NewBuildTab::OnCopySelectionUI), NULL, this);
    m_listctrl->Connect(wxID_PASTE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(NewBuildTab::OnOpenInEditorUI), NULL, this);
    m_listctrl->Connect(wxID_CLEAR, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(NewBuildTab::OnClearUI), NULL, this);

    // Make sure we have enought height for the icon
    yy < 12 ? yy = 12 : yy = yy;
    m_listctrl->SetRowHeight(yy);

    bs->Add(m_listctrl, 1, wxEXPAND|wxALL);

    BuildTabTopPanel* toolbox = new BuildTabTopPanel(this);

#ifdef __WXMAC__
    bs->Add(toolbox, 0, wxEXPAND);
#else
    bs->Insert(0, toolbox, 0, wxEXPAND);
#endif

    int screenWidth = BUILD_PANE_WIDTH;// use a long screen width to allow long lines
    m_textRenderer = new MyTextRenderer(m_listctrl);
    
    m_listctrl->AppendColumn(new wxDataViewColumn(_("Message"), m_textRenderer, 0, screenWidth, wxALIGN_LEFT));

    EventNotifier::Get()->Connect ( wxEVT_SHELL_COMMAND_STARTED,         clCommandEventHandler ( NewBuildTab::OnBuildStarted ),    NULL, this );
    EventNotifier::Get()->Connect ( wxEVT_SHELL_COMMAND_STARTED_NOCLEAN, clCommandEventHandler ( NewBuildTab::OnBuildStarted ),    NULL, this );
    EventNotifier::Get()->Connect ( wxEVT_SHELL_COMMAND_ADDLINE,         clCommandEventHandler ( NewBuildTab::OnBuildAddLine ),    NULL, this );
    EventNotifier::Get()->Connect ( wxEVT_SHELL_COMMAND_PROCESS_ENDED,   clCommandEventHandler ( NewBuildTab::OnBuildEnded ),      NULL, this );
    
    EventNotifier::Get()->Connect(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(NewBuildTab::OnWorkspaceLoaded), NULL, this);
    EventNotifier::Get()->Connect(wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(NewBuildTab::OnWorkspaceClosed), NULL, this);

    wxTheApp->Connect(XRCID("next_build_error"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler ( NewBuildTab::OnNextBuildError ),   NULL, this );
    wxTheApp->Connect(XRCID("next_build_error"), wxEVT_UPDATE_UI,             wxUpdateUIEventHandler ( NewBuildTab::OnNextBuildErrorUI ), NULL, this );

    m_listctrl->Connect(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEventHandler(NewBuildTab::OnLineSelected), NULL, this);
}
コード例 #16
0
CompilerMainPageBase::CompilerMainPageBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCAD0CInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    boxSizer114 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer114);
    
    m_button222 = new wxButton(this, wxID_ANY, _("Add Compilers"), wxDefaultPosition, wxSize(-1,-1), 0);
    #if wxVERSION_NUMBER >= 2904
    m_button222->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("arrow-down-16")), wxRIGHT);
    m_button222->SetBitmapMargins(1,1);
    #endif
    
    boxSizer114->Add(m_button222, 0, wxALL|wxALIGN_RIGHT, 5);
    
    boxSizer220 = new wxBoxSizer(wxHORIZONTAL);
    
    boxSizer114->Add(boxSizer220, 1, wxEXPAND, 5);
    
    wxArrayString m_listBoxCompilersArr;
    m_listBoxCompilers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), m_listBoxCompilersArr, wxLB_SORT|wxLB_SINGLE);
    
    boxSizer220->Add(m_listBoxCompilers, 0, wxALL|wxEXPAND, 5);
    
    m_auiBook = new Notebook(this, wxID_ANY, wxDefaultPosition, wxSize(450,300), wxAUI_NB_DEFAULT_STYLE|wxBK_DEFAULT);
    m_auiBook->SetName(wxT("m_auiBook"));
    
    boxSizer220->Add(m_auiBook, 1, wxALL|wxEXPAND, 5);
    
    m_panelTools = new wxPanel(m_auiBook, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    m_auiBook->AddPage(m_panelTools, _("Tools"), true);
    
    boxSizer2 = new wxBoxSizer(wxVERTICAL);
    m_panelTools->SetSizer(boxSizer2);
    
    wxArrayString m_pgMgrToolsArr;
    wxUnusedVar(m_pgMgrToolsArr);
    wxArrayInt m_pgMgrToolsIntArr;
    wxUnusedVar(m_pgMgrToolsIntArr);
    m_pgMgrTools = new wxPropertyGridManager(m_panelTools, wxID_ANY, wxDefaultPosition, wxSize(300,300), wxPG_DESCRIPTION|wxPG_HIDE_MARGIN|wxPG_BOLD_MODIFIED);
    
    boxSizer2->Add(m_pgMgrTools, 1, wxALL|wxEXPAND, 5);
    
    m_pgProp94 = m_pgMgrTools->Append(  new wxPropertyCategory( _("Tools") ) );
    m_pgProp94->SetHelpString(wxT(""));
    
    m_pgPropCXX = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("C++ Compiler"), wxPG_LABEL, wxT("")) );
    m_pgPropCXX->SetHelpString(_("The C++ compiler path (plus optional flags). This tool is represented in the Makefile as $(CXX)"));
    m_pgPropCXX->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropCC = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("C Compiler"), wxPG_LABEL, wxT("")) );
    m_pgPropCC->SetHelpString(_("The C++ compiler path (plus optional flags). This tool is represented in the Makefile as $(CC)"));
    m_pgPropCC->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropAS = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("Assembler Name"), wxPG_LABEL, wxT("")) );
    m_pgPropAS->SetHelpString(_("The assembler tool path. This tool is referred in the Makefile as $(AS)"));
    m_pgPropAS->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropLD = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("Linker"), wxPG_LABEL, wxT("")) );
    m_pgPropLD->SetHelpString(_("The linker tool. Usually similar to the 'C++ Compiler' tool path"));
    m_pgPropLD->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropSharedObjectLD = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("Shared Object Linker"), wxPG_LABEL, wxT("")) );
    m_pgPropSharedObjectLD->SetHelpString(_("The tool to create shared objects"));
    m_pgPropSharedObjectLD->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropAR = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("Archive"), wxPG_LABEL, wxT("")) );
    m_pgPropAR->SetHelpString(_("The static archive tool \"ar\". This tool is referred in the Makefile as $(AR)"));
    m_pgPropAR->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropResourceCompiler = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("Resource Compiler"), wxPG_LABEL, wxT("")) );
    m_pgPropResourceCompiler->SetHelpString(_("The resource compiler. (Windows only)"));
    m_pgPropResourceCompiler->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropMAKE = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("Make"), wxPG_LABEL, wxT("")) );
    m_pgPropMAKE->SetHelpString(_("The Make tool. on Windows / MinGW this is usually mingw32-make.exe while on other OSs its simply 'make'"));
    m_pgPropMAKE->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropMkdir = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("mkdir"), wxPG_LABEL, wxT("")) );
    m_pgPropMkdir->SetHelpString(_("Set the 'mkdir' for your OS.\nLeave it empty to use the defualt for your OS"));
    m_pgPropMkdir->SetEditor( wxT("TextCtrlAndButton") );
    
    m_pgPropDebugger = m_pgMgrTools->AppendIn( m_pgProp94,  new wxStringProperty( _("Gdb"), wxPG_LABEL, wxT("")) );
    m_pgPropDebugger->SetHelpString(_("On various platform (e.g. Cygwin) it is recommended to use their own sepcial gdb executable rather than the global one\nYou can specify one here, or leave this empty to use the default"));
    m_pgPropDebugger->SetEditor( wxT("TextCtrlAndButton") );
    m_pgMgrTools->GetGrid()->SetSplitterPosition(150, 0);
    m_panelPatterns = new wxPanel(m_auiBook, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    m_auiBook->AddPage(m_panelPatterns, _("Patterns"), false);
    
    bSizer14 = new wxBoxSizer(wxVERTICAL);
    m_panelPatterns->SetSizer(bSizer14);
    
    bSizerError = new wxBoxSizer(wxVERTICAL);
    
    bSizer14->Add(bSizerError, 1, wxEXPAND, 5);
    
    m_staticText161 = new wxStaticText(m_panelPatterns, wxID_ANY, _("Compiler Errors Patterns:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizerError->Add(m_staticText161, 0, wxALL, 5);
    
    bSizer25 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizerError->Add(bSizer25, 1, wxEXPAND, 5);
    
    m_listErrPatterns = new wxListCtrl(m_panelPatterns, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxLC_VRULES|wxLC_HRULES|wxLC_SINGLE_SEL|wxLC_REPORT);
    
    bSizer25->Add(m_listErrPatterns, 1, wxALL|wxEXPAND, 5);
    
    bSizer26 = new wxBoxSizer(wxVERTICAL);
    
    bSizer25->Add(bSizer26, 0, 0, 5);
    
    m_btnAddErrPattern = new wxButton(m_panelPatterns, wxID_ANY, _("Add"), wxDefaultPosition, wxSize(-1,-1), 0);
    m_btnAddErrPattern->SetToolTip(_("Add new error pattern"));
    
    bSizer26->Add(m_btnAddErrPattern, 0, wxALL|wxEXPAND, 5);
    
    m_btnDelErrPattern = new wxButton(m_panelPatterns, wxID_ANY, _("Delete"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_btnDelErrPattern->SetToolTip(_("Delete the selected error pattern"));
    
    bSizer26->Add(m_btnDelErrPattern, 0, wxALL|wxEXPAND, 5);
    
    m_btnUpdateErrPattern = new wxButton(m_panelPatterns, wxID_ANY, _("Edit..."), wxDefaultPosition, wxSize(-1, -1), 0);
    m_btnUpdateErrPattern->SetToolTip(_("Edit the selected error pattern"));
    
    bSizer26->Add(m_btnUpdateErrPattern, 0, wxALL|wxEXPAND, 5);
    
    bSizerWarnings = new wxBoxSizer(wxVERTICAL);
    
    bSizer14->Add(bSizerWarnings, 1, wxEXPAND, 5);
    
    m_staticText17 = new wxStaticText(m_panelPatterns, wxID_ANY, _("Compiler Warnings Patterns:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizerWarnings->Add(m_staticText17, 0, wxALL, 5);
    
    bSizer251 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizerWarnings->Add(bSizer251, 1, wxEXPAND, 5);
    
    m_listWarnPatterns = new wxListCtrl(m_panelPatterns, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxLC_VRULES|wxLC_HRULES|wxLC_SINGLE_SEL|wxLC_REPORT);
    
    bSizer251->Add(m_listWarnPatterns, 1, wxALL|wxEXPAND, 5);
    
    bSizer261 = new wxBoxSizer(wxVERTICAL);
    
    bSizer251->Add(bSizer261, 0, 0, 5);
    
    m_btnAddWarnPattern = new wxButton(m_panelPatterns, wxID_ANY, _("Add"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_btnAddWarnPattern->SetToolTip(_("Add new warning pattern"));
    
    bSizer261->Add(m_btnAddWarnPattern, 0, wxALL|wxEXPAND, 5);
    
    m_btnDelWarnPattern = new wxButton(m_panelPatterns, wxID_ANY, _("Delete"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_btnDelWarnPattern->SetToolTip(_("Delete the selected warning pattern"));
    
    bSizer261->Add(m_btnDelWarnPattern, 0, wxALL|wxEXPAND, 5);
    
    m_btnUpdateWarnPattern = new wxButton(m_panelPatterns, wxID_ANY, _("Edit..."), wxDefaultPosition, wxSize(-1, -1), 0);
    m_btnUpdateWarnPattern->SetToolTip(_("Edit the selected warning pattern"));
    
    bSizer261->Add(m_btnUpdateWarnPattern, 0, wxALL|wxEXPAND, 5);
    
    m_panelComilerOptions = new wxPanel(m_auiBook, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    m_auiBook->AddPage(m_panelComilerOptions, _("Compiler Options"), false);
    
    bSizer101 = new wxBoxSizer(wxVERTICAL);
    m_panelComilerOptions->SetSizer(bSizer101);
    
    m_staticText23_O = new wxStaticText(m_panelComilerOptions, wxID_ANY, _("Double click on an entry to modify it:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer101->Add(m_staticText23_O, 0, wxALL|wxEXPAND, 5);
    
    bSizer12_CmpOptions = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer101->Add(bSizer12_CmpOptions, 1, wxEXPAND, 5);
    
    m_listCompilerOptions = new wxListCtrl(m_panelComilerOptions, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxLC_VRULES|wxLC_HRULES|wxLC_SINGLE_SEL|wxLC_REPORT);
    
    bSizer12_CmpOptions->Add(m_listCompilerOptions, 1, wxALL|wxEXPAND, 5);
    
    bSizer_1 = new wxBoxSizer(wxVERTICAL);
    
    bSizer12_CmpOptions->Add(bSizer_1, 0, wxEXPAND, 5);
    
    m_buttonCompilerOption = new wxButton(m_panelComilerOptions, wxID_ANY, _("New..."), wxDefaultPosition, wxSize(-1, -1), 0);
    m_buttonCompilerOption->SetDefault();
    
    bSizer_1->Add(m_buttonCompilerOption, 0, wxALL, 5);
    
    m_buttonDeleteCompilerOption = new wxButton(m_panelComilerOptions, wxID_ANY, _("Delete"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer_1->Add(m_buttonDeleteCompilerOption, 0, wxALL, 5);
    
    m_panelLinkerOptions = new wxPanel(m_auiBook, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    m_auiBook->AddPage(m_panelLinkerOptions, _("Linker Options"), false);
    
    bSizer105 = new wxBoxSizer(wxVERTICAL);
    m_panelLinkerOptions->SetSizer(bSizer105);
    
    m_staticText23_L = new wxStaticText(m_panelLinkerOptions, wxID_ANY, _("Double click on an entry to modify it:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer105->Add(m_staticText23_L, 0, wxALL|wxEXPAND, 5);
    
    bSizer123 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer105->Add(bSizer123, 1, wxEXPAND, 5);
    
    m_listLinkerOptions = new wxListCtrl(m_panelLinkerOptions, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxLC_VRULES|wxLC_HRULES|wxLC_SINGLE_SEL|wxLC_REPORT);
    
    bSizer123->Add(m_listLinkerOptions, 1, wxALL|wxEXPAND, 5);
    
    bSizer_2 = new wxBoxSizer(wxVERTICAL);
    
    bSizer123->Add(bSizer_2, 0, wxEXPAND, 5);
    
    m_buttonLinkerOption = new wxButton(m_panelLinkerOptions, wxID_ANY, _("New..."), wxDefaultPosition, wxSize(-1, -1), 0);
    m_buttonLinkerOption->SetDefault();
    
    bSizer_2->Add(m_buttonLinkerOption, 0, wxALL, 5);
    
    m_buttonDeleteLinkerOption = new wxButton(m_panelLinkerOptions, wxID_ANY, _("Delete"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer_2->Add(m_buttonDeleteLinkerOption, 0, wxALL, 5);
    
    m_panelCompilerSwitches = new wxPanel(m_auiBook, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    m_auiBook->AddPage(m_panelCompilerSwitches, _("Switches"), false);
    
    mainSizer = new wxBoxSizer(wxVERTICAL);
    m_panelCompilerSwitches->SetSizer(mainSizer);
    
    m_staticText8 = new wxStaticText(m_panelCompilerSwitches, wxID_ANY, _("Double click on an entry to modify it:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    mainSizer->Add(m_staticText8, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
    
    m_listSwitches = new wxListCtrl(m_panelCompilerSwitches, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxLC_VRULES|wxLC_HRULES|wxLC_SINGLE_SEL|wxLC_REPORT);
    
    mainSizer->Add(m_listSwitches, 1, wxALL|wxEXPAND, 5);
    
    m_panelFileTypes = new wxPanel(m_auiBook, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    m_auiBook->AddPage(m_panelFileTypes, _("File Types"), false);
    
    bSizer10 = new wxBoxSizer(wxVERTICAL);
    m_panelFileTypes->SetSizer(bSizer10);
    
    m_staticText23 = new wxStaticText(m_panelFileTypes, wxID_ANY, _("Double click on an entry to modify it:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer10->Add(m_staticText23, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
    
    bSizer12 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer10->Add(bSizer12, 1, wxALL|wxEXPAND, 5);
    
    m_listCtrlFileTypes = new wxListCtrl(m_panelFileTypes, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxLC_VRULES|wxLC_HRULES|wxLC_SINGLE_SEL|wxLC_REPORT);
    
    bSizer12->Add(m_listCtrlFileTypes, 1, wxALL|wxEXPAND, 5);
    
    bSizer111 = new wxBoxSizer(wxVERTICAL);
    
    bSizer12->Add(bSizer111, 0, wxEXPAND, 5);
    
    m_buttonNewFileType = new wxButton(m_panelFileTypes, wxID_ANY, _("New..."), wxDefaultPosition, wxSize(-1, -1), 0);
    m_buttonNewFileType->SetDefault();
    
    bSizer111->Add(m_buttonNewFileType, 0, wxALL, 5);
    
    m_buttonDeleteFileType = new wxButton(m_panelFileTypes, wxID_ANY, _("Delete"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer111->Add(m_buttonDeleteFileType, 0, wxALL, 5);
    
    m_panelAdvanced = new wxPanel(m_auiBook, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    m_auiBook->AddPage(m_panelAdvanced, _("Advanced"), false);
    
    bSizer11 = new wxBoxSizer(wxVERTICAL);
    m_panelAdvanced->SetSizer(bSizer11);
    
    bSizer7 = new wxBoxSizer(wxVERTICAL);
    
    bSizer11->Add(bSizer7, 0, wxALL|wxEXPAND, 5);
    
    fgSizer3 = new wxFlexGridSizer(0, 3, 0, 0);
    fgSizer3->SetFlexibleDirection( wxBOTH );
    fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    fgSizer3->AddGrowableCol(1);
    
    bSizer7->Add(fgSizer3, 0, wxEXPAND, 5);
    
    m_staticText18 = new wxStaticText(m_panelAdvanced, wxID_ANY, _("Global Paths"), wxDefaultPosition, wxSize(-1, -1), 0);
    wxFont m_staticText18Font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    m_staticText18Font.SetWeight(wxFONTWEIGHT_BOLD);
    m_staticText18->SetFont(m_staticText18Font);
    
    fgSizer3->Add(m_staticText18, 0, wxALL|wxALIGN_RIGHT, 5);
    
    fgSizer3->Add(0, 0, 0, wxALL, 5);
    
    fgSizer3->Add(0, 0, 1, wxALL, 5);
    
    m_staticText141 = new wxStaticText(m_panelAdvanced, wxID_ANY, _("Include Path:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer3->Add(m_staticText141, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textCtrlGlobalIncludePath = new wxTextCtrl(m_panelAdvanced, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    m_textCtrlGlobalIncludePath->SetToolTip(_("Set here an additional include paths. Each path should be separated with a semi-colon\nNote that usually you don't need to modify this field and it should be left empty"));
    #if wxVERSION_NUMBER >= 3000
    m_textCtrlGlobalIncludePath->SetHint(wxT(""));
    #endif
    
    fgSizer3->Add(m_textCtrlGlobalIncludePath, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    m_button67 = new wxButton(m_panelAdvanced, wxID_ANY, _("Edit..."), wxDefaultPosition, wxSize(-1,-1), 0);
    
    fgSizer3->Add(m_button67, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    m_staticText16 = new wxStaticText(m_panelAdvanced, wxID_ANY, _("Libraries Path:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer3->Add(m_staticText16, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textCtrlGlobalLibPath = new wxTextCtrl(m_panelAdvanced, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    m_textCtrlGlobalLibPath->SetToolTip(_("Set here an additional library search paths. Each path should be separated with a semi-colon\nNote that usually you don't need to modify this field and it should be left empty"));
    #if wxVERSION_NUMBER >= 3000
    m_textCtrlGlobalLibPath->SetHint(wxT(""));
    #endif
    
    fgSizer3->Add(m_textCtrlGlobalLibPath, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    m_button69 = new wxButton(m_panelAdvanced, wxID_ANY, _("Edit..."), wxDefaultPosition, wxSize(-1,-1), 0);
    
    fgSizer3->Add(m_button69, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    m_staticText19 = new wxStaticText(m_panelAdvanced, wxID_ANY, _("Misc"), wxDefaultPosition, wxSize(-1, -1), 0);
    wxFont m_staticText19Font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    m_staticText19Font.SetWeight(wxFONTWEIGHT_BOLD);
    m_staticText19->SetFont(m_staticText19Font);
    
    fgSizer3->Add(m_staticText19, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    fgSizer3->Add(0, 0, 0, wxALL, 5);
    
    fgSizer3->Add(0, 0, 1, wxALL, 5);
    
    m_staticText3 = new wxStaticText(m_panelAdvanced, wxID_ANY, _("Objects extension:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer3->Add(m_staticText3, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textObjectExtension = new wxTextCtrl(m_panelAdvanced, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    #if wxVERSION_NUMBER >= 3000
    m_textObjectExtension->SetHint(wxT(""));
    #endif
    
    fgSizer3->Add(m_textObjectExtension, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    fgSizer3->Add(0, 0, 1, wxALL, 5);
    
    m_staticText24 = new wxStaticText(m_panelAdvanced, wxID_ANY, _("Depends extension:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer3->Add(m_staticText24, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textDependExtension = new wxTextCtrl(m_panelAdvanced, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    #if wxVERSION_NUMBER >= 3000
    m_textDependExtension->SetHint(wxT(""));
    #endif
    
    fgSizer3->Add(m_textDependExtension, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    fgSizer3->Add(0, 0, 1, wxALL, 5);
    
    m_staticText25 = new wxStaticText(m_panelAdvanced, wxID_ANY, _("Preprocessed extension:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer3->Add(m_staticText25, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textPreprocessExtension = new wxTextCtrl(m_panelAdvanced, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    #if wxVERSION_NUMBER >= 3000
    m_textPreprocessExtension->SetHint(wxT(""));
    #endif
    
    fgSizer3->Add(m_textPreprocessExtension, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    fgSizer3->Add(0, 0, 0, wxALL, 5);
    
    fgSizer3->Add(0, 0, 1, wxALL, 5);
    
    m_checkBoxGenerateDependenciesFiles = new wxCheckBox(m_panelAdvanced, wxID_ANY, _("Generate dependencies files (*.o.d)"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxGenerateDependenciesFiles->SetValue(false);
    
    fgSizer3->Add(m_checkBoxGenerateDependenciesFiles, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
    
    fgSizer3->Add(0, 0, 1, wxALL, 5);
    
    fgSizer3->Add(0, 0, 0, wxALL, 5);
    
    m_checkBoxObjectNameSameAsFileName = new wxCheckBox(m_panelAdvanced, wxID_ANY, _("Object name is same as the file name"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxObjectNameSameAsFileName->SetValue(false);
    m_checkBoxObjectNameSameAsFileName->SetToolTip(_("By default, codelite will prepend the relative directory to the file name to compose an object name (e.g. src/a.cpp will generate object: src_a.o).\nUncheck this option to make the object name exactly as the file name without any prefixes"));
    
    fgSizer3->Add(m_checkBoxObjectNameSameAsFileName, 0, wxALL, 5);
    
    fgSizer3->Add(0, 0, 1, wxALL, 5);
    
    fgSizer3->Add(0, 0, 0, wxALL, 5);
    
    m_checkBoxReadObjectsFromFile = new wxCheckBox(m_panelAdvanced, wxID_ANY, _("Pass object list to the linker via file"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxReadObjectsFromFile->SetValue(false);
    
    fgSizer3->Add(m_checkBoxReadObjectsFromFile, 0, wxALL, 5);
    
    SetName(wxT("CompilerMainPageBase"));
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    CentreOnParent(wxBOTH);
    // Connect events
    m_button222->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnAddCompilers), NULL, this);
    m_listBoxCompilers->Connect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(CompilerMainPageBase::OnCompilerSelected), NULL, this);
    m_listBoxCompilers->Connect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(CompilerMainPageBase::OnContextMenu), NULL, this);
    m_pgMgrTools->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCustomEditorButtonClicked), NULL, this);
    m_pgMgrTools->Connect(wxEVT_PG_CHANGED, wxPropertyGridEventHandler(CompilerMainPageBase::OnValueChanged), NULL, this);
    m_listErrPatterns->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnErrItemActivated), NULL, this);
    m_btnAddErrPattern->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnAddErrPattern), NULL, this);
    m_btnDelErrPattern->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnDelErrPattern), NULL, this);
    m_btnDelErrPattern->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnErrorPatternSelectedUI), NULL, this);
    m_btnUpdateErrPattern->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnUpdateErrPattern), NULL, this);
    m_btnUpdateErrPattern->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnErrorPatternSelectedUI), NULL, this);
    m_listWarnPatterns->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnWarnItemActivated), NULL, this);
    m_btnAddWarnPattern->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnAddWarnPattern), NULL, this);
    m_btnDelWarnPattern->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnDelWarnPattern), NULL, this);
    m_btnDelWarnPattern->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnWarningPatternSelectedUI), NULL, this);
    m_btnUpdateWarnPattern->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnBtnUpdateWarnPattern), NULL, this);
    m_btnUpdateWarnPattern->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CompilerMainPageBase::OnWarningPatternSelectedUI), NULL, this);
    m_listCompilerOptions->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionActivated), NULL, this);
    m_listCompilerOptions->Connect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionDeSelected), NULL, this);
    m_listCompilerOptions->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnCompilerOptionSelected), NULL, this);
    m_buttonCompilerOption->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewCompilerOption), NULL, this);
    m_buttonDeleteCompilerOption->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteCompilerOption), NULL, this);
    m_listLinkerOptions->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionActivated), NULL, this);
    m_listLinkerOptions->Connect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionDeSelected), NULL, this);
    m_listLinkerOptions->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnLinkerOptionSelected), NULL, this);
    m_buttonLinkerOption->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewLinkerOption), NULL, this);
    m_buttonDeleteLinkerOption->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteLinkerOption), NULL, this);
    m_listSwitches->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnItemActivated), NULL, this);
    m_listSwitches->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnItemSelected), NULL, this);
    m_listCtrlFileTypes->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(CompilerMainPageBase::OnFileTypeActivated), NULL, this);
    m_listCtrlFileTypes->Connect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(CompilerMainPageBase::OnFileTypeDeSelected), NULL, this);
    m_listCtrlFileTypes->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(CompilerMainPageBase::OnFileTypeSelected), NULL, this);
    m_buttonNewFileType->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnNewFileType), NULL, this);
    m_buttonDeleteFileType->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnDeleteFileType), NULL, this);
    m_textCtrlGlobalIncludePath->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_button67->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnEditIncludePaths), NULL, this);
    m_textCtrlGlobalLibPath->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_button69->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnEditLibraryPaths), NULL, this);
    m_textObjectExtension->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_textDependExtension->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_textPreprocessExtension->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_checkBoxGenerateDependenciesFiles->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_checkBoxObjectNameSameAsFileName->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    m_checkBoxReadObjectsFromFile->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(CompilerMainPageBase::OnCmdModify), NULL, this);
    
}
コード例 #17
0
ファイル: Frame.cpp プロジェクト: jkuziel/SmokeSignal
Frame::Frame(const wxString& title):
	wxFrame(0, -1, title, wxDefaultPosition, wxSize(400, 300))
{
	me = this;

	SetMinSize(wxSize(400, 300));

	// menu bar
	wxMenuBar* menuBar = new wxMenuBar;
	
	// Actions menu
	wxMenu* mnuActions = new wxMenu;
	mnuActions->Append(ID_BCAST, wxT("Say &Hello"), 
		wxT("Broadcast to all clients on the subnet"));
	mnuActions->Append(ID_DROP_USER, wxT("&Drop User"), 
		wxT("Remove user from the user list"));
	mnuActions->AppendSeparator();
	mnuActions->Append(wxID_EXIT, wxT("E&xit"));

	// Options menu
	wxMenu* mnuOptions = new wxMenu;
	mnuOptions->AppendCheckItem(ID_INC_SEQ_NUM, 
		wxT("Increment &Sequence Number"));
	mnuOptions->Check(ID_INC_SEQ_NUM, true);
	mnuOptions->Append(ID_SET_TO_VAL, wxT("Set Message ACK &Timeout..."));

	// Help menu
	wxMenu* mnuHelp = new wxMenu;
	mnuHelp->Append(ID_ABOUT, wxT("&About..."),
		wxT("Display copyright information"));

	// menu bar
	menuBar->Append(mnuActions, wxT("&Actions"));
	menuBar->Append(mnuOptions, wxT("&Options"));
	menuBar->Append(mnuHelp, wxT("&Help"));	

	SetMenuBar(menuBar);
	
	wxPanel* panel = new wxPanel(this, wxID_ANY);

	// controls
	msgCtrl = new StreamTextCtrl(panel, ID_MSG_TB, wxT(""), 
      wxPoint(-1, -1), wxSize(-1, -1), wxTE_MULTILINE | wxTE_READONLY);

	msgCtrl->aquireStream();

	cmdCtrl = new wxTextCtrl(panel, ID_CMD_TB, wxT(""), wxPoint(-1, -1), 
		wxSize(-1, -1), wxTE_PROCESS_ENTER);
	cmdCtrl->SetMaxLength(MSG_STRLEN);
	cmdCtrl->SetFocus();

	sendBtn = new wxButton(panel, ID_SEND_BTN, wxT("Send"));
	sendBtn->Enable(false);

	userListCtrl = new wxListBox(panel, ID_USER_LB);

	useKeyCtrl = new wxCheckBox(panel, ID_USEKEY_CB, 
		wxT("Use Encryption Key"));
	useKeyCtrl->SetValue(false);

	keyCtrl = new wxTextCtrl(panel, ID_KEY_TB, wxT(""), wxPoint(-1, -1), 
		wxSize(-1, -1), wxTE_PROCESS_ENTER);
	keyCtrl->SetMaxLength(MSG_STRLEN);

	// sizers
	wxBoxSizer* hMainSizer = new wxBoxSizer(wxHORIZONTAL); // left/right sizer
	wxBoxSizer* lVSizer = new wxBoxSizer(wxVERTICAL); // left side
	wxBoxSizer* rVSizer = new wxBoxSizer(wxVERTICAL); // right side

	// msg window
	lVSizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Chat Box")), 0, wxLEFT);
	lVSizer->Add(msgCtrl, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP | wxBOTTOM);

	// command bar
	wxBoxSizer* hSizer = new wxBoxSizer(wxHORIZONTAL);
	hSizer->Add(cmdCtrl, 1, wxEXPAND | wxLEFT | wxRIGHT);
	hSizer->Add(10, -1); // margin
	hSizer->Add(sendBtn, 0, wxRIGHT);

	lVSizer->Add(-1, 10); // margin
	lVSizer->Add(hSizer, 0, wxEXPAND | wxLEFT | wxRIGHT);

	// user controls
	rVSizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Users Online")), 0, 
		wxLEFT);
	rVSizer->Add(userListCtrl, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP | wxBOTTOM);
	rVSizer->Add(-1, 10); // margin
	rVSizer->Add(useKeyCtrl);
	rVSizer->Add(-1, 5);
	rVSizer->Add(keyCtrl, 0, wxEXPAND | wxLEFT | wxRIGHT);

	// left side
	hMainSizer->Add(lVSizer, 1,
		wxEXPAND | wxLEFT | wxRIGHT | wxTOP | wxBOTTOM, 10);

	// right side
	hMainSizer->Add(rVSizer, 0,
		wxEXPAND | wxLEFT | wxRIGHT | wxTOP | wxBOTTOM, 10);

	panel->SetSizer(hMainSizer);

	Center();

	// events
	Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED,
		wxCommandEventHandler(Frame::OnExit));

	Connect(ID_SEND_BTN, wxEVT_COMMAND_BUTTON_CLICKED, 
		wxCommandEventHandler(Frame::OnSend));

	Connect(ID_CMD_TB, wxEVT_COMMAND_TEXT_ENTER, 
		wxCommandEventHandler(Frame::OnSend));

	Connect(ID_USER_LB, wxEVT_COMMAND_LISTBOX_SELECTED, 
		wxCommandEventHandler(Frame::OnUserSelect));

	Connect(ID_KEY_TB, wxEVT_COMMAND_TEXT_ENTER, 
		wxCommandEventHandler(Frame::OnKeyEnter));

	Connect(ID_USEKEY_CB, wxEVT_COMMAND_CHECKBOX_CLICKED, 
		wxCommandEventHandler(Frame::OnToggleKey));

	Connect(ID_CMD_TB, wxEVT_COMMAND_TEXT_UPDATED, 
		wxCommandEventHandler(Frame::OnCmdUpdate));

	Connect(ID_BCAST, wxEVT_COMMAND_MENU_SELECTED, 
		wxCommandEventHandler(Frame::OnBcast));

	Connect(ID_DROP_USER, wxEVT_COMMAND_MENU_SELECTED, 
		wxCommandEventHandler(Frame::OnDropUser));

	Connect(ID_INC_SEQ_NUM, wxEVT_COMMAND_MENU_SELECTED, 
		wxCommandEventHandler(Frame::OnIncSeqNum));

	Connect(ID_SET_TO_VAL, wxEVT_COMMAND_MENU_SELECTED, 
		wxCommandEventHandler(Frame::OnSetTOVal));

	Connect(ID_ABOUT, wxEVT_COMMAND_MENU_SELECTED,
		wxCommandEventHandler(Frame::OnAbout));

	Connect(ID_USER_LB, wxEVT_CONTEXT_MENU, 
		wxContextMenuEventHandler(Frame::OnUserContext));
		

	setNewUserCallback(OnNewUser);
	setRemoveUserCallback(OnRemoveUser);
}