FindResultsTab::FindResultsTab(wxWindow* parent, wxWindowID id, const wxString& name) : OutputTabWindow(parent, id, name) , m_searchInProgress(false) { m_sci->Connect(wxEVT_STC_STYLENEEDED, wxStyledTextEventHandler(FindResultsTab::OnStyleNeeded), NULL, this); BitmapLoader& loader = *(PluginManager::Get()->GetStdIcons()); wxTheApp->Connect(XRCID("find_in_files"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FindResultsTab::OnFindInFiles), NULL, this); m_tb->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &FindResultsTab::OnRecentSearches, this, XRCID("recent_searches")); m_tb->Bind(wxEVT_UPDATE_UI, &FindResultsTab::OnRecentSearchesUI, this, XRCID("recent_searches")); m_tb->AddTool(XRCID("stop_search"), _("Stop current search"), loader.LoadBitmap("stop"), _("Stop current search")); m_tb->AddTool(XRCID("recent_searches"), _("Show Recent Searches"), loader.LoadBitmap("history"), _("Show Recent Searches")) ->SetHasDropDown(true); Connect(XRCID("stop_search"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FindResultsTab::OnStopSearch), NULL, this); Connect(XRCID("stop_search"), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(FindResultsTab::OnStopSearchUI), NULL, this); m_tb->Realize(); EventNotifier::Get()->Connect( wxEVT_CL_THEME_CHANGED, wxCommandEventHandler(FindResultsTab::OnThemeChanged), NULL, this); // Use the same eventhandler for editor config changes too e.g. show/hide whitespace EventNotifier::Get()->Bind(wxEVT_EDITOR_CONFIG_CHANGED, &FindResultsTab::OnThemeChanged, this); }
void SavvyEditor::AppFrame::SetupSyntaxRules(wxStyledTextCtrl* a_Ctrl) { // Set up the margins for the line numbers a_Ctrl->StyleClearAll(); a_Ctrl->SetLexer(wxSTC_LEX_CPP); a_Ctrl->SetMarginWidth(MARGIN_LINE_NUMBERS, MARGIN_LINE_NUMBERS_WIDTH); a_Ctrl->StyleSetForeground(wxSTC_STYLE_LINENUMBER, wxColour(75, 75, 75)); a_Ctrl->StyleSetBackground(wxSTC_STYLE_LINENUMBER, wxColour(220, 220, 220)); a_Ctrl->SetMarginType(MARGIN_LINE_NUMBERS, wxSTC_MARGIN_NUMBER); // ---- Enable code folding a_Ctrl->SetMarginType(MARGIN_FOLD, wxSTC_MARGIN_SYMBOL); a_Ctrl->SetMarginWidth(MARGIN_FOLD, MARGIN_FOLD_WIDTH); a_Ctrl->SetMarginMask(MARGIN_FOLD, wxSTC_MASK_FOLDERS); a_Ctrl->StyleSetBackground(MARGIN_FOLD, C_BLOCK_BACKGROUND_COLOR); a_Ctrl->SetMarginSensitive(MARGIN_FOLD, true); // Properties found from http://www.scintilla.org/SciTEDoc.html a_Ctrl->SetProperty(wxT("fold"), wxT("1")); a_Ctrl->SetProperty(wxT("fold.comment"), wxT("1")); a_Ctrl->SetProperty(wxT("fold.compact"), wxT("1")); a_Ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_ARROW); a_Ctrl->MarkerSetForeground(wxSTC_MARKNUM_FOLDER, FOLDING_COLOR); a_Ctrl->MarkerSetBackground(wxSTC_MARKNUM_FOLDER, FOLDING_COLOR); a_Ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN); a_Ctrl->MarkerSetForeground(wxSTC_MARKNUM_FOLDEROPEN, FOLDING_COLOR); a_Ctrl->MarkerSetBackground(wxSTC_MARKNUM_FOLDEROPEN, FOLDING_COLOR); a_Ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY); a_Ctrl->MarkerSetForeground(wxSTC_MARKNUM_FOLDERSUB, FOLDING_COLOR); a_Ctrl->MarkerSetBackground(wxSTC_MARKNUM_FOLDERSUB, FOLDING_COLOR); a_Ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_ARROW); a_Ctrl->MarkerSetForeground(wxSTC_MARKNUM_FOLDEREND, FOLDING_COLOR); a_Ctrl->MarkerSetBackground(wxSTC_MARKNUM_FOLDEREND, _T("WHITE")); a_Ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN); a_Ctrl->MarkerSetForeground(wxSTC_MARKNUM_FOLDEROPENMID, FOLDING_COLOR); a_Ctrl->MarkerSetBackground(wxSTC_MARKNUM_FOLDEROPENMID, _T("WHITE")); a_Ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY); a_Ctrl->MarkerSetForeground(wxSTC_MARKNUM_FOLDERMIDTAIL, FOLDING_COLOR); a_Ctrl->MarkerSetBackground(wxSTC_MARKNUM_FOLDERMIDTAIL, FOLDING_COLOR); a_Ctrl->MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY); a_Ctrl->MarkerSetForeground(wxSTC_MARKNUM_FOLDERTAIL, FOLDING_COLOR); a_Ctrl->MarkerSetBackground(wxSTC_MARKNUM_FOLDERTAIL, FOLDING_COLOR); // ---- End of code folding part a_Ctrl->SetWrapMode(wxSTC_WRAP_NONE); a_Ctrl->Connect(wxEVT_STC_MARGINCLICK, wxStyledTextEventHandler(SavvyEditor::AppFrame::OnMarginClick), NULL, this); }
DiffSideBySidePanelBase::~DiffSideBySidePanelBase() { this->Disconnect(ID_DIFF_TOOL_REFRESH, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnRefreshDiff), NULL, this); this->Disconnect(ID_DIFF_TOOL_REFRESH, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnRefreshDiffUI), NULL, this); this->Disconnect(ID_DIFF_TOOL_SAVE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnSaveChanges), NULL, this); this->Disconnect(ID_DIFF_TOOL_SAVE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnSaveChangesUI), NULL, this); this->Disconnect(ID_DIFF_TOOL_NEXT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnNextDiffSequence), NULL, this); this->Disconnect(ID_DIFF_TOOL_NEXT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnNextDiffUI), NULL, this); this->Disconnect(ID_DIFF_TOOL_PREV, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnPrevDiffSequence), NULL, this); this->Disconnect(ID_DIFF_TOOL_PREV, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnPrevDiffUI), NULL, this); this->Disconnect(ID_DIFF_TOOL_COPY_RIGHT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRightUI), NULL, this); this->Disconnect(ID_DIFF_TOOL_COPY_RIGHT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRight), NULL, this); this->Disconnect(ID_DIFF_TOOL_COPY_LEFT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeftUI), NULL, this); this->Disconnect(ID_DIFF_TOOL_COPY_LEFT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeft), NULL, this); this->Disconnect(m_menuItem271->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnCopyFileLeftToRight), NULL, this); this->Disconnect(m_menuItem271->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRightUI), NULL, this); this->Disconnect(m_menuItem273->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeftUI), NULL, this); this->Disconnect(m_menuItem273->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnCopyFileFromRight), NULL, this); this->Disconnect(m_singleView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnSingleView), NULL, this); this->Disconnect(m_singleView->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnSingleUI), NULL, this); this->Disconnect(m_vView->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnVerticalUI), NULL, this); this->Disconnect(m_vView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnVertical), NULL, this); this->Disconnect(m_hView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnHorizontal), NULL, this); this->Disconnect(m_hView->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnHorizontalUI), NULL, this); m_textCtrlLeftFile->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnLeftPickerUI), NULL, this); m_button290->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnLeftPickerUI), NULL, this); m_button290->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnBrowseLeftFile), NULL, this); m_stcLeft->Disconnect(wxEVT_STC_PAINTED, wxStyledTextEventHandler(DiffSideBySidePanelBase::OnLeftStcPainted), NULL, this); m_stcLeft->Disconnect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(DiffSideBySidePanelBase::OnMouseWheel), NULL, this); m_textCtrlRightFile->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnRightPickerUI), NULL, this); m_button294->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnRightPickerUI), NULL, this); m_button294->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnBrowseRightFile), NULL, this); m_stcRight->Disconnect(wxEVT_STC_PAINTED, wxStyledTextEventHandler(DiffSideBySidePanelBase::OnRightStcPainted), NULL, this); m_stcRight->Disconnect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(DiffSideBySidePanelBase::OnMouseWheel), NULL, this); std::map<int, wxMenu*>::iterator menuIter = m_dropdownMenus.begin(); for( ; menuIter != m_dropdownMenus.end(); ++menuIter ) { wxDELETE( menuIter->second ); } m_dropdownMenus.clear(); this->Disconnect(wxID_ANY, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(DiffSideBySidePanelBase::ShowAuiToolMenu), NULL, this); }
FindUsageTab::FindUsageTab(wxWindow* parent, const wxString& name) : OutputTabWindow(parent, wxID_ANY, name) { FindResultsTab::SetStyles(m_sci); m_sci->HideSelection(true); m_sci->Connect(wxEVT_STC_STYLENEEDED, wxStyledTextEventHandler(FindUsageTab::OnStyleNeeded), NULL, this); m_tb->DeleteTool(XRCID("repeat_output")); m_tb->Realize(); EventNotifier::Get()->Connect( wxEVT_CL_THEME_CHANGED, wxCommandEventHandler(FindUsageTab::OnThemeChanged), NULL, this); }
StyledTextCtrl::StyledTextCtrl(ENIGMA_IDEFrame* frame, const long id) : wxStyledTextCtrl(frame, id) { mainFrame = frame; functionWords = &(frame->fncWords); variableWords = &(frame->varWords); autoCompWords = &(frame->acpWords); SetKeyWords(0, *functionWords); SetKeyWords(1, *variableWords); ClearRegisteredImages(); RegisterImage(0, frame->ControlImages->GetBitmap(4)); RegisterImage(1, frame->ControlImages->GetBitmap(5)); SetFoldFlags(wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED); Connect(wxEVT_STC_MARGINCLICK, wxStyledTextEventHandler(StyledTextCtrl::OnMarginClick), NULL, this); Connect(wxEVT_STC_CHARADDED, wxStyledTextEventHandler(StyledTextCtrl::OnAutoComplete), NULL, this); Connect(wxEVT_STC_CHANGE, wxStyledTextEventHandler(StyledTextCtrl::OnChange), NULL, this); }
TemplateClassBaseDlg::~TemplateClassBaseDlg() { m_textCtrlClassName->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(TemplateClassBaseDlg::OnClassNameEntered), NULL, this); m_buttonBrowseVD->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnBrowseVD), NULL, this); m_buttonBrowsePath->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnBrowseFilePath), NULL, this); m_buttonGenerate->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnGenerate), NULL, this); m_buttonGenerate->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnGenerateUI), NULL, this); m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnQuit), NULL, this); m_comboxTemplates->Disconnect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(TemplateClassBaseDlg::OnTemplateClassSelected), NULL, this); m_buttonAddTemplate->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnButtonAdd), NULL, this); m_buttonAddTemplate->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnButtonAddUI), NULL, this); m_buttonChangeTemplate->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnButtonChange), NULL, this); m_buttonChangeTemplate->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnButtonChangeUI), NULL, this); m_buttonRemoveTemplate->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnButtonRemove), NULL, this); m_buttonRemoveTemplate->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnButtonRemoveUI), NULL, this); m_buttonClear->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnButtonClear), NULL, this); m_buttonClear->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnButtonClearUI), NULL, this); m_buttonInsertClassMacro->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnInsertClassKeyword), NULL, this); m_buttonInsertClassMacro->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnInsertClassKeywordUI), NULL, this); m_textCtrlHeader->Disconnect(wxEVT_STC_CHANGE, wxStyledTextEventHandler(TemplateClassBaseDlg::OnStcHeaderFileContentChnaged), NULL, this); m_textCtrlImpl->Disconnect(wxEVT_STC_CHANGE, wxStyledTextEventHandler(TemplateClassBaseDlg::OnStcImplFileContentChnaged), NULL, this); }
AbbreviationsSettingsBase::~AbbreviationsSettingsBase() { this->Disconnect(ID_TOOL_NEW, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnNew), NULL, this); this->Disconnect(ID_TOOL_DELETE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(AbbreviationsSettingsBase::OnDeleteUI), NULL, this); this->Disconnect(ID_TOOL_DELETE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnDelete), NULL, this); this->Disconnect(ID_TOOL_IMPORT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnImport), NULL, this); this->Disconnect(ID_TOOL_EXPORT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnExport), NULL, this); m_listBoxAbbreviations->Disconnect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(AbbreviationsSettingsBase::OnItemSelected), NULL, this); m_stc->Disconnect(wxEVT_STC_CHANGE, wxStyledTextEventHandler(AbbreviationsSettingsBase::OnMarkDirty), NULL, this); m_checkBoxImmediateInsert->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnImmediateInsert), NULL, this); m_buttonSave->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnSave), NULL, this); m_buttonSave->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(AbbreviationsSettingsBase::OnSaveUI), NULL, this); m_buttonHelp->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnHelp), NULL, this); }
AsmEditor::AsmEditor( wxWindow *parent, wxWindowID id/*=wxID_ANY*/, const wxPoint &pos/*=wxDefaultPosition*/, const wxSize &size/*=wxDefaultSize*/, long style/*=0*/, const wxString &name/*=wxSTCNameStr*/ ) : wxStyledTextCtrl(parent, id, pos, size, style, name) { InitializePrefs(); SetKeyWords( 0, wordList1 ); SetKeyWords( 1, wordList2 ); SetTabWidth(4); SetUseTabs(false); Connect(wxEVT_STC_MARGINCLICK, wxStyledTextEventHandler(AsmEditor::OnMarginClick), NULL, this); Connect(wxEVT_MOUSEWHEEL,(wxObjectEventFunction)&AsmEditor::OnMouseWheel,NULL,this); }
MainFrameBaseClass::~MainFrameBaseClass() { this->Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainFrameBaseClass::OnIdle), NULL, this); m_stc->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainFrameBaseClass::OnKeyDown), NULL, this); m_stc->Disconnect(wxEVT_STC_UPDATEUI, wxStyledTextEventHandler(MainFrameBaseClass::OnStcUpdateUI), NULL, this); this->Disconnect(m_menuItemClear->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnClearView), NULL, this); this->Disconnect(m_menuItemPreferences->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSettings), NULL, this); this->Disconnect(m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this); this->Disconnect(m_menuItemINT->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this); this->Disconnect(m_menuItemTERM->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this); this->Disconnect(m_menuItemKILL->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this); this->Disconnect(m_menuItemHUP->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this); this->Disconnect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this); m_timerMarker->Disconnect(wxEVT_TIMER, wxTimerEventHandler(MainFrameBaseClass::OnAddMarker), NULL, this); m_timerMarker->Stop(); wxDELETE( m_timerMarker ); }
AbbreviationsSettingsBase::AbbreviationsSettingsBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC94E5InitBitmapResources(); bBitmapLoaded = true; } wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); this->SetSizer(mainSizer); m_banner4 = new wxBannerWindow(this, wxID_ANY, wxTOP, wxDefaultPosition, wxSize(-1,-1), wxBORDER_THEME); m_banner4->SetBitmap(wxNullBitmap); m_banner4->SetText(wxT(""), _("You can use the '|' (pipe) character to set the caret position\nYou may also use any of the known macros to CodeLite (click the 'Help' button)")); m_banner4->SetGradient(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK), wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK)); m_banner4->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT)); mainSizer->Add(m_banner4, 0, wxALL|wxEXPAND, 5); m_auibar9 = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxAUI_TB_PLAIN_BACKGROUND|wxAUI_TB_DEFAULT_STYLE); m_auibar9->SetToolBitmapSize(wxSize(16,16)); mainSizer->Add(m_auibar9, 0, wxEXPAND, 5); m_auibar9->AddTool(ID_TOOL_NEW, _("New..."), wxXmlResource::Get()->LoadBitmap(wxT("abb-add")), wxNullBitmap, wxITEM_NORMAL, _("Create a new abbreviation"), _("Create a new abbreviation"), NULL); m_auibar9->AddTool(ID_TOOL_DELETE, _("Delete"), wxXmlResource::Get()->LoadBitmap(wxT("abb-delete")), wxNullBitmap, wxITEM_NORMAL, _("Delete the currently selected abbreviation"), _("Delete the currently selected abbreviation"), NULL); m_auibar9->AddSeparator(); m_auibar9->AddTool(ID_TOOL_IMPORT, _("Import"), wxXmlResource::Get()->LoadBitmap(wxT("abb-import")), wxNullBitmap, wxITEM_NORMAL, _("Import abbreviations from the file system..."), _("Import abbreviations from the file system..."), NULL); m_auibar9->AddTool(ID_TOOL_EXPORT, _("Export"), wxXmlResource::Get()->LoadBitmap(wxT("abb-export")), wxNullBitmap, wxITEM_NORMAL, _("Export abbreviations to the file system..."), _("Export abbreviations to the file system..."), NULL); m_auibar9->Realize(); wxBoxSizer* mainSizer_Inner = new wxBoxSizer(wxHORIZONTAL); mainSizer->Add(mainSizer_Inner, 1, wxEXPAND, 0); wxBoxSizer* bSizer3 = new wxBoxSizer(wxHORIZONTAL); mainSizer_Inner->Add(bSizer3, 1, wxEXPAND, 5); wxArrayString m_listBoxAbbreviationsArr; m_listBoxAbbreviations = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), m_listBoxAbbreviationsArr, 0); m_listBoxAbbreviations->SetFocus(); bSizer3->Add(m_listBoxAbbreviations, 0, wxALL|wxEXPAND, 5); m_listBoxAbbreviations->SetMinSize(wxSize(150,-1)); wxBoxSizer* bSizer4 = new wxBoxSizer(wxVERTICAL); bSizer3->Add(bSizer4, 1, wxEXPAND, 5); wxBoxSizer* bSizer5 = new wxBoxSizer(wxHORIZONTAL); bSizer4->Add(bSizer5, 0, wxEXPAND, 5); m_staticText1 = new wxStaticText(this, wxID_ANY, _("Name:"), wxDefaultPosition, wxSize(-1, -1), 0); bSizer5->Add(m_staticText1, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_textCtrlName = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0); bSizer5->Add(m_textCtrlName, 1, wxALL|wxEXPAND, 5); m_stc = new wxStyledTextCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); #ifdef __WXMSW__ // To get the newer version of the font on MSW, we use font wxSYS_DEFAULT_GUI_FONT with family set to wxFONTFAMILY_TELETYPE wxFont m_stcFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); m_stcFont.SetFamily(wxFONTFAMILY_TELETYPE); #else wxFont m_stcFont = wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT); m_stcFont.SetFamily(wxFONTFAMILY_TELETYPE); #endif m_stc->SetFont(m_stcFont); // Configure the fold margin m_stc->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_stc->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stc->SetMarginSensitive(4, true); m_stc->SetMarginWidth (4, 0); // Configure the tracker margin m_stc->SetMarginWidth(1, 0); // Configure the symbol margin m_stc->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_stc->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stc->SetMarginWidth(2, 16); m_stc->SetMarginSensitive(2, true); // Configure the line numbers margin m_stc->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_stc->SetMarginWidth(0,0); // Configure the line symbol margin m_stc->SetMarginType(3, wxSTC_MARGIN_FORE); m_stc->SetMarginMask(3, 0); m_stc->SetMarginWidth(3,0); // Select the lexer m_stc->SetLexer(wxSTC_LEX_CPP); // Set default font / styles m_stc->StyleClearAll(); for(int i=0; i<wxSTC_STYLE_MAX; ++i) { m_stc->StyleSetFont(i, m_stcFont); } m_stc->SetWrapMode(0); m_stc->SetIndentationGuides(0); m_stc->SetKeyWords(0, wxT("")); m_stc->SetKeyWords(1, wxT("")); m_stc->SetKeyWords(2, wxT("")); m_stc->SetKeyWords(3, wxT("")); m_stc->SetKeyWords(4, wxT("")); bSizer4->Add(m_stc, 1, wxALL|wxEXPAND, 5); m_checkBoxImmediateInsert = new wxCheckBox(this, wxID_ANY, _("Immediate Insert"), wxDefaultPosition, wxSize(-1, -1), 0); m_checkBoxImmediateInsert->SetValue(false); bSizer4->Add(m_checkBoxImmediateInsert, 0, wxLEFT|wxRIGHT|wxBOTTOM, 5); m_staticline1 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxLI_HORIZONTAL); mainSizer_Inner->Add(m_staticline1, 0, wxALL|wxEXPAND, 5); m_stdBtnSizer24 = new wxStdDialogButtonSizer(); mainSizer->Add(m_stdBtnSizer24, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); m_buttonSave = new wxButton(this, wxID_SAVE, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0); m_buttonSave->SetToolTip(_("Save changes")); m_buttonSave->SetDefault(); m_buttonSave->SetToolTip(_("Save changes")); m_stdBtnSizer24->AddButton(m_buttonSave); m_buttonCancel = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0); m_stdBtnSizer24->AddButton(m_buttonCancel); m_buttonHelp = new wxButton(this, wxID_HELP, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0); m_buttonHelp->SetToolTip(_("Show available macros")); m_buttonHelp->SetToolTip(_("Show available macros")); m_stdBtnSizer24->AddButton(m_buttonHelp); m_stdBtnSizer24->Realize(); SetSizeHints(-1,-1); if ( GetSizer() ) { GetSizer()->Fit(this); } Centre(wxBOTH); // Connect events this->Connect(ID_TOOL_NEW, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnNew), NULL, this); this->Connect(ID_TOOL_DELETE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(AbbreviationsSettingsBase::OnDeleteUI), NULL, this); this->Connect(ID_TOOL_DELETE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnDelete), NULL, this); this->Connect(ID_TOOL_IMPORT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnImport), NULL, this); this->Connect(ID_TOOL_EXPORT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnExport), NULL, this); m_listBoxAbbreviations->Connect(wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler(AbbreviationsSettingsBase::OnItemSelected), NULL, this); m_stc->Connect(wxEVT_STC_CHANGE, wxStyledTextEventHandler(AbbreviationsSettingsBase::OnMarkDirty), NULL, this); m_checkBoxImmediateInsert->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnImmediateInsert), NULL, this); m_buttonSave->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnSave), NULL, this); m_buttonSave->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(AbbreviationsSettingsBase::OnSaveUI), NULL, this); m_buttonHelp->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AbbreviationsSettingsBase::OnHelp), NULL, this); }
MainFrameBaseClass::MainFrameBaseClass(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style) { if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9ED9InitBitmapResources(); bBitmapLoaded = true; } // Set icon(s) to the application/dialog wxIconBundle app_icons; { wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("terminal-16")); wxIcon icn; icn.CopyFromBitmap(iconBmp); app_icons.AddIcon( icn ); } { wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("terminal-32")); wxIcon icn; icn.CopyFromBitmap(iconBmp); app_icons.AddIcon( icn ); } SetIcons( app_icons ); wxBoxSizer* boxSizer1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizer1); m_mainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(800,600), wxTAB_TRAVERSAL); boxSizer1->Add(m_mainPanel, 1, wxEXPAND, 5); wxBoxSizer* boxSizer11 = new wxBoxSizer(wxVERTICAL); m_mainPanel->SetSizer(boxSizer11); m_auibar17 = new wxAuiToolBar(m_mainPanel, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxAUI_TB_PLAIN_BACKGROUND|wxAUI_TB_DEFAULT_STYLE); m_auibar17->SetToolBitmapSize(wxSize(16,16)); boxSizer11->Add(m_auibar17, 0, wxEXPAND, 5); m_auibar17->AddTool(wxID_CLEAR, _("Clear"), wxXmlResource::Get()->LoadBitmap(wxT("stop")), wxNullBitmap, wxITEM_NORMAL, _("Clear view"), _("Clear view"), NULL); m_auibar17->AddTool(ID_KILL_INFIRIOR, _("Send inferior process signal"), wxXmlResource::Get()->LoadBitmap(wxT("signal")), wxNullBitmap, wxITEM_NORMAL, wxT(""), _("Send inferior process signal"), NULL); wxAuiToolBarItem* m_toolbarItemKillInfiriorProcess = m_auibar17->FindToolByIndex(m_auibar17->GetToolCount()-1); if (m_toolbarItemKillInfiriorProcess) { m_toolbarItemKillInfiriorProcess->SetHasDropDown(true); } m_auibar17->AddTool(ID_SETTINGS, _("Settings..."), wxXmlResource::Get()->LoadBitmap(wxT("settings")), wxNullBitmap, wxITEM_NORMAL, _("Settings..."), _("Settings..."), NULL); m_auibar17->AddTool(wxID_SAVE, _("Save"), wxXmlResource::Get()->LoadBitmap(wxT("save")), wxNullBitmap, wxITEM_NORMAL, _("Save"), _("Save"), NULL); m_auibar17->Realize(); m_stc = new wxStyledTextCtrl(m_mainPanel, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); #ifdef __WXMSW__ // To get the newer version of the font on MSW, we use font wxSYS_DEFAULT_GUI_FONT with family set to wxFONTFAMILY_TELETYPE wxFont m_stcFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); m_stcFont.SetFamily(wxFONTFAMILY_TELETYPE); #else wxFont m_stcFont = wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT); m_stcFont.SetFamily(wxFONTFAMILY_TELETYPE); #endif m_stc->SetFont(m_stcFont); m_stc->SetFocus(); // Configure the fold margin m_stc->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_stc->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stc->SetMarginSensitive(4, true); m_stc->SetMarginWidth (4, 0); // Configure the tracker margin m_stc->SetMarginWidth(1, 0); // Configure the symbol margin m_stc->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_stc->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stc->SetMarginWidth(2, 16); m_stc->SetMarginSensitive(2, true); // Configure the line numbers margin m_stc->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_stc->SetMarginWidth(0,0); // Configure the line symbol margin m_stc->SetMarginType(3, wxSTC_MARGIN_FORE); m_stc->SetMarginMask(3, 0); m_stc->SetMarginWidth(3,0); // Select the lexer m_stc->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_stc->StyleClearAll(); for(int i=0; i<wxSTC_STYLE_MAX; ++i) { m_stc->StyleSetFont(i, m_stcFont); } m_stc->SetWrapMode(0); m_stc->SetIndentationGuides(0); m_stc->SetKeyWords(0, wxT("")); m_stc->SetKeyWords(1, wxT("")); m_stc->SetKeyWords(2, wxT("")); m_stc->SetKeyWords(3, wxT("")); m_stc->SetKeyWords(4, wxT("")); boxSizer11->Add(m_stc, 1, wxALL|wxEXPAND, 2); m_menuBar = new wxMenuBar(0); this->SetMenuBar(m_menuBar); m_name6 = new wxMenu(); m_menuBar->Append(m_name6, _("File")); m_menuItem7 = new wxMenuItem(m_name6, wxID_EXIT, _("Exit\tAlt-X"), _("Quit"), wxITEM_NORMAL); m_name6->Append(m_menuItem7); m_name8 = new wxMenu(); m_menuBar->Append(m_name8, _("Help")); m_menuItem9 = new wxMenuItem(m_name8, wxID_ABOUT, _("About..."), wxT(""), wxITEM_NORMAL); m_name8->Append(m_menuItem9); m_timerMarker = new wxTimer; m_timerMarker->Start(50, false); SetSizeHints(-1,-1); if ( GetSizer() ) { GetSizer()->Fit(this); } Centre(wxBOTH); // Connect events this->Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrameBaseClass::OnIdle), NULL, this); this->Connect(wxID_CLEAR, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnClearView), NULL, this); this->Connect(wxID_CLEAR, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnClearViewUI), NULL, this); this->Connect(ID_KILL_INFIRIOR, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnTerminateInfirior), NULL, this); this->Connect(ID_KILL_INFIRIOR, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnSignalInferiorUI), NULL, this); this->Connect(ID_KILL_INFIRIOR, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(MainFrameBaseClass::OnSignalinferior), NULL, this); this->Connect(ID_SETTINGS, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnSettings), NULL, this); this->Connect(wxID_SAVE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnSaveContent), NULL, this); this->Connect(wxID_SAVE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnSaveContentUI), NULL, this); m_stc->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainFrameBaseClass::OnKeyDown), NULL, this); m_stc->Connect(wxEVT_STC_UPDATEUI, wxStyledTextEventHandler(MainFrameBaseClass::OnStcUpdateUI), NULL, this); this->Connect(m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this); this->Connect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this); m_timerMarker->Connect(wxEVT_TIMER, wxTimerEventHandler(MainFrameBaseClass::OnAddMarker), NULL, this); this->Connect(wxID_ANY, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(MainFrameBaseClass::ShowAuiToolMenu), NULL, this); }
MainFrameBaseClass::MainFrameBaseClass(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style) { if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9ED9InitBitmapResources(); bBitmapLoaded = true; } // Set icon(s) to the application/dialog wxIconBundle app_icons; { wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("terminal-16")); wxIcon icn; icn.CopyFromBitmap(iconBmp); app_icons.AddIcon( icn ); } { wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("terminal-32")); wxIcon icn; icn.CopyFromBitmap(iconBmp); app_icons.AddIcon( icn ); } SetIcons( app_icons ); wxBoxSizer* boxSizer1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizer1); m_mainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(800,600), wxTAB_TRAVERSAL); boxSizer1->Add(m_mainPanel, 1, wxEXPAND, 5); wxBoxSizer* boxSizer11 = new wxBoxSizer(wxVERTICAL); m_mainPanel->SetSizer(boxSizer11); m_stc = new wxStyledTextCtrl(m_mainPanel, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); #ifdef __WXMSW__ // To get the newer version of the font on MSW, we use font wxSYS_DEFAULT_GUI_FONT with family set to wxFONTFAMILY_TELETYPE wxFont m_stcFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); m_stcFont.SetFamily(wxFONTFAMILY_TELETYPE); #else wxFont m_stcFont = wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT); m_stcFont.SetFamily(wxFONTFAMILY_TELETYPE); #endif m_stc->SetFont(m_stcFont); m_stc->SetFocus(); // Configure the fold margin m_stc->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_stc->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stc->SetMarginSensitive(4, true); m_stc->SetMarginWidth (4, 0); // Configure the tracker margin m_stc->SetMarginWidth(1, 0); // Configure the symbol margin m_stc->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_stc->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stc->SetMarginWidth(2, 16); m_stc->SetMarginSensitive(2, true); // Configure the line numbers margin m_stc->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_stc->SetMarginWidth(0,0); // Configure the line symbol margin m_stc->SetMarginType(3, wxSTC_MARGIN_FORE); m_stc->SetMarginMask(3, 0); m_stc->SetMarginWidth(3,0); // Select the lexer m_stc->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_stc->StyleClearAll(); for(int i=0; i<wxSTC_STYLE_MAX; ++i) { m_stc->StyleSetFont(i, m_stcFont); } m_stc->SetWrapMode(0); m_stc->SetIndentationGuides(0); m_stc->SetKeyWords(0, wxT("")); m_stc->SetKeyWords(1, wxT("")); m_stc->SetKeyWords(2, wxT("")); m_stc->SetKeyWords(3, wxT("")); m_stc->SetKeyWords(4, wxT("")); boxSizer11->Add(m_stc, 1, wxALL|wxEXPAND, 0); m_menuBar = new wxMenuBar(0); this->SetMenuBar(m_menuBar); m_File = new wxMenu(); m_menuBar->Append(m_File, _("File")); m_menuItemSave = new wxMenuItem(m_File, wxID_SAVE, _("Save...\tCtrl-S"), wxT(""), wxITEM_NORMAL); m_File->Append(m_menuItemSave); m_menuItemClear = new wxMenuItem(m_File, wxID_CLEAR, _("Clear View\tCtrl-L"), wxT(""), wxITEM_NORMAL); m_File->Append(m_menuItemClear); m_File->AppendSeparator(); m_menuItemPreferences = new wxMenuItem(m_File, wxID_PREFERENCES, _("Preferences..."), wxT(""), wxITEM_NORMAL); m_File->Append(m_menuItemPreferences); m_File->AppendSeparator(); m_menuItem7 = new wxMenuItem(m_File, wxID_EXIT, _("Exit\tAlt-X"), _("Quit"), wxITEM_NORMAL); m_File->Append(m_menuItem7); m_Signals = new wxMenu(); m_menuBar->Append(m_Signals, _("Signals")); m_menuItemINT = new wxMenuItem(m_Signals, ID_SIGINT, _("SIGINT"), wxT(""), wxITEM_NORMAL); m_Signals->Append(m_menuItemINT); m_menuItemTERM = new wxMenuItem(m_Signals, ID_SIGTERM, _("SIGTERM"), wxT(""), wxITEM_NORMAL); m_Signals->Append(m_menuItemTERM); m_menuItemKILL = new wxMenuItem(m_Signals, ID_SIGKILL, _("SIGKILL"), wxT(""), wxITEM_NORMAL); m_Signals->Append(m_menuItemKILL); m_menuItemHUP = new wxMenuItem(m_Signals, ID_SIGHUP, _("SIGHUP"), wxT(""), wxITEM_NORMAL); m_Signals->Append(m_menuItemHUP); m_Help = new wxMenu(); m_menuBar->Append(m_Help, _("Help")); m_menuItem9 = new wxMenuItem(m_Help, wxID_ABOUT, _("About..."), wxT(""), wxITEM_NORMAL); m_Help->Append(m_menuItem9); m_timerMarker = new wxTimer; m_timerMarker->Start(50, false); SetName(wxT("MainFrameBaseClass")); SetSizeHints(-1,-1); if ( GetSizer() ) { GetSizer()->Fit(this); } CentreOnParent(wxBOTH); #if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } #endif // Connect events this->Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrameBaseClass::OnIdle), NULL, this); m_stc->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainFrameBaseClass::OnKeyDown), NULL, this); m_stc->Connect(wxEVT_STC_UPDATEUI, wxStyledTextEventHandler(MainFrameBaseClass::OnStcUpdateUI), NULL, this); this->Connect(m_menuItemClear->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnClearView), NULL, this); this->Connect(m_menuItemPreferences->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSettings), NULL, this); this->Connect(m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this); this->Connect(m_menuItemINT->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this); this->Connect(m_menuItemTERM->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this); this->Connect(m_menuItemKILL->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this); this->Connect(m_menuItemHUP->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this); this->Connect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this); m_timerMarker->Connect(wxEVT_TIMER, wxTimerEventHandler(MainFrameBaseClass::OnAddMarker), NULL, this); }
void FileEditorWnd::setFile(const std::shared_ptr<const File>& file, int line, int col, bool columnIsOffset) { if (m_file != file) { if (m_file) gWorkspace->removeFileSaveFunc(m_file->id); m_file = file; gWorkspace->setFileDirty(m_file->id, false); gWorkspace->setFileSaveFunc(m_file->id, [this](const std::shared_ptr<const File>& file) { return m_textCtrl->SaveFile(file->fullpath.widen()); }); // Find the language we want UTF8String ext = file->extension; LanguageInfo* lang = nullptr; for (auto& l : gLanguages) { if (cz::find(l.fileextensions, ext) != l.fileextensions.end()) { lang = &l; break; } } m_textCtrl->Freeze(); // Set the default shared style before StyleClearAll, because as specified in scintilla documentation, // StyleClearAll will reset all other styles to wxSTC_STYLE_DEFAULT setStyle(m_textCtrl, gSharedStyles[0]); m_textCtrl->StyleClearAll(); if (lang) m_textCtrl->SetLexer(lang->lexer); setCommonStyle(); setStyles(m_textCtrl, gSharedStyles); // Set styles specific to the language if (lang) setStyles(m_textCtrl, lang->styles); updateViewOptions(); m_textCtrl->SetReadOnly(false); m_isLoading = true; m_textCtrl->LoadFile(file->fullpath.c_str(), wxTEXT_TYPE_ANY); m_isLoading = false; m_textCtrl->Connect(wxEVT_STC_MARGINCLICK, wxStyledTextEventHandler(FileEditorWnd::OnMarginClick), NULL, this); m_textCtrl->Thaw(); m_textCtrl->SetSavePoint(); m_textCtrl->EmptyUndoBuffer(); gWorkspace->iterateBreakpoints(m_file->id, [&](const Breakpoint* brk) { syncBreakpoint(brk); }); updateErrorMarkers(); updateMarkers(); m_textCtrl->Fit(); this->Layout(); } if (line >= 1 && col >= 0) { if (columnIsOffset) { // Column is a real offset into the text (doesn't take into account tab width) int pos = m_textCtrl->PositionFromLine(TO_TXTLINE(line)); m_textCtrl->GotoPos(pos + col); } else{ // Column is a visual offset into the text (takes into account tab width) int pos = m_textCtrl->FindColumn(TO_TXTLINE(line), col); m_textCtrl->GotoPos(pos); // There seems to be a bug with GotoPos, where the Horizontal scrolling gets out of sync, so I'm // just resetting it. // Maybe this bug: http://sourceforge.net/p/scintilla/bugs/1467/ //This will of course mean that it will not scroll at all to show the desired column, // but (although the caret will still be at the desired column) m_textCtrl->SetXOffset(0); } } //m_textCtrl->VerticalCentreCaret(); }
DiffSideBySidePanelBase::DiffSideBySidePanelBase(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* boxSizer13 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizer13); m_auibar242 = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxAUI_TB_PLAIN_BACKGROUND|wxAUI_TB_DEFAULT_STYLE); m_auibar242->SetToolBitmapSize(wxSize(16,16)); boxSizer13->Add(m_auibar242, 0, wxEXPAND, 5); m_auibar242->AddTool(ID_DIFF_TOOL_REFRESH, _("Refresh"), wxXmlResource::Get()->LoadBitmap(wxT("16-debugger_restart")), wxNullBitmap, wxITEM_NORMAL, _("Refresh"), _("Refresh"), NULL); m_auibar242->AddTool(ID_DIFF_TOOL_SAVE, _("Save"), wxXmlResource::Get()->LoadBitmap(wxT("16-file_save")), wxNullBitmap, wxITEM_NORMAL, _("Save"), _("Save"), NULL); m_auibar242->AddSeparator(); m_auibar242->AddTool(ID_DIFF_TOOL_NEXT, _("Next Diff"), wxXmlResource::Get()->LoadBitmap(wxT("16-next")), wxNullBitmap, wxITEM_NORMAL, _("Next Diff"), _("Next Diff"), NULL); m_auibar242->AddTool(ID_DIFF_TOOL_PREV, _("Previous"), wxXmlResource::Get()->LoadBitmap(wxT("16-up")), wxNullBitmap, wxITEM_NORMAL, _("Previous Diff"), _("Previous Diff"), NULL); m_auibar242->AddSeparator(); m_auibar242->AddTool(ID_DIFF_TOOL_COPY_RIGHT, _("Copy Right"), wxXmlResource::Get()->LoadBitmap(wxT("16-forward")), wxNullBitmap, wxITEM_NORMAL, _("Copy Right"), _("Copy Right"), NULL); m_auibar242->AddTool(ID_DIFF_TOOL_COPY_LEFT, _("Copy Left"), wxXmlResource::Get()->LoadBitmap(wxT("16-back")), wxNullBitmap, wxITEM_NORMAL, _("Copy Left"), _("Copy Left"), NULL); m_auibar242->AddTool(ID_DIFF_TOOL_COPY_ALL, _("CopyAll"), wxXmlResource::Get()->LoadBitmap(wxT("16-copy")), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT(""), NULL); wxAuiToolBarItem* m_toolCopy = m_auibar242->FindToolByIndex(m_auibar242->GetToolCount()-1); if (m_toolCopy) { m_toolCopy->SetHasDropDown(true); m_menu257 = new wxMenu; m_menuItem271 = new wxMenuItem(m_menu257, ID_DIFF_TOOL_USE_LEFT, _("Copy All Content from Left to Right"), _("Copy All Content from Left to Right"), wxITEM_NORMAL); m_menuItem271->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("16-forward"))); m_menu257->Append(m_menuItem271); m_menuItem273 = new wxMenuItem(m_menu257, ID_DIFF_TOOL_USE_RIGHT, _("Copy All Content from Right to Left"), _("Copy All Content from Right to Left"), wxITEM_NORMAL); m_menuItem273->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("16-back"))); m_menu257->Append(m_menuItem273); m_dropdownMenus.insert(std::make_pair( m_toolCopy->GetId(), m_menu257) ); } m_auibar242->AddSeparator(); m_auibar242->AddTool(ID_DIFF_TOOL_VIEW, _("View Type"), wxXmlResource::Get()->LoadBitmap(wxT("16-find")), wxNullBitmap, wxITEM_NORMAL, _("View Type"), _("View Type"), NULL); wxAuiToolBarItem* m_toolbarItem277 = m_auibar242->FindToolByIndex(m_auibar242->GetToolCount()-1); if (m_toolbarItem277) { m_toolbarItem277->SetHasDropDown(true); m_menu278 = new wxMenu; m_singleView = new wxMenuItem(m_menu278, ID_DIFF_TOOL_VIEW_SINGLE, _("Single View"), _("Single View"), wxITEM_RADIO); m_menu278->Append(m_singleView); m_vView = new wxMenuItem(m_menu278, ID_DIFF_VERTICAL_VIEW, _("Vertical View"), _("Vertical View"), wxITEM_RADIO); m_menu278->Append(m_vView); m_hView = new wxMenuItem(m_menu278, ID_DIFF_TOOL_VIEW_HORIZONTAL, _("Horizontal View"), _("Horizontal View"), wxITEM_RADIO); m_menu278->Append(m_hView); m_dropdownMenus.insert(std::make_pair( m_toolbarItem277->GetId(), m_menu278) ); } m_auibar242->Realize(); m_splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxSP_LIVE_UPDATE|wxSP_PERMIT_UNSPLIT|wxSP_3DSASH); m_splitter->SetSashGravity(0.5); m_splitter->SetMinimumPaneSize(10); boxSizer13->Add(m_splitter, 1, wxALL|wxEXPAND, 2); m_splitterPageLeft = new wxPanel(m_splitter, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL); wxBoxSizer* boxSizer111 = new wxBoxSizer(wxVERTICAL); m_splitterPageLeft->SetSizer(boxSizer111); wxBoxSizer* boxSizer285 = new wxBoxSizer(wxHORIZONTAL); boxSizer111->Add(boxSizer285, 0, wxEXPAND, 2); m_textCtrlLeftFile = new wxTextCtrl(m_splitterPageLeft, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); m_textCtrlLeftFile->SetFocus(); #if wxVERSION_NUMBER >= 3000 m_textCtrlLeftFile->SetHint(wxT("")); #endif m_textCtrlLeftFile->AutoCompleteFileNames(); boxSizer285->Add(m_textCtrlLeftFile, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5); m_button290 = new wxButton(m_splitterPageLeft, wxID_ANY, _("..."), wxDefaultPosition, wxSize(-1,-1), wxBU_EXACTFIT); m_button290->SetToolTip(_("Choose a file")); boxSizer285->Add(m_button290, 0, wxALIGN_CENTER_VERTICAL, 5); m_staticTextLeft = new wxStaticText(m_splitterPageLeft, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(100,-1), wxALIGN_CENTRE|wxBORDER_THEME); boxSizer285->Add(m_staticTextLeft, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2); m_stcLeft = new wxStyledTextCtrl(m_splitterPageLeft, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); // Configure the fold margin m_stcLeft->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_stcLeft->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stcLeft->SetMarginSensitive(4, true); m_stcLeft->SetMarginWidth (4, 0); // Configure the tracker margin m_stcLeft->SetMarginWidth(1, 0); // Configure the symbol margin m_stcLeft->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_stcLeft->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stcLeft->SetMarginWidth(2, 16); m_stcLeft->SetMarginSensitive(2, true); // Configure the line numbers margin m_stcLeft->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_stcLeft->SetMarginWidth(0,0); // Configure the line symbol margin m_stcLeft->SetMarginType(3, wxSTC_MARGIN_FORE); m_stcLeft->SetMarginMask(3, 0); m_stcLeft->SetMarginWidth(3,0); // Select the lexer m_stcLeft->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_stcLeft->StyleClearAll(); m_stcLeft->SetWrapMode(0); m_stcLeft->SetIndentationGuides(0); m_stcLeft->SetKeyWords(0, wxT("")); m_stcLeft->SetKeyWords(1, wxT("")); m_stcLeft->SetKeyWords(2, wxT("")); m_stcLeft->SetKeyWords(3, wxT("")); m_stcLeft->SetKeyWords(4, wxT("")); boxSizer111->Add(m_stcLeft, 1, wxALL|wxEXPAND, 2); m_splitterPageRight = new wxPanel(m_splitter, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL); m_splitter->SplitVertically(m_splitterPageLeft, m_splitterPageRight, 0); wxBoxSizer* boxSizer113 = new wxBoxSizer(wxVERTICAL); m_splitterPageRight->SetSizer(boxSizer113); wxBoxSizer* boxSizer286 = new wxBoxSizer(wxHORIZONTAL); boxSizer113->Add(boxSizer286, 0, wxEXPAND, 2); m_textCtrlRightFile = new wxTextCtrl(m_splitterPageRight, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); #if wxVERSION_NUMBER >= 3000 m_textCtrlRightFile->SetHint(wxT("")); #endif m_textCtrlRightFile->AutoCompleteFileNames(); boxSizer286->Add(m_textCtrlRightFile, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5); m_button294 = new wxButton(m_splitterPageRight, wxID_ANY, _("..."), wxDefaultPosition, wxSize(-1,-1), wxBU_EXACTFIT); boxSizer286->Add(m_button294, 0, wxALIGN_CENTER_VERTICAL, 5); m_staticTextRight = new wxStaticText(m_splitterPageRight, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(100,-1), wxALIGN_CENTRE|wxBORDER_THEME); boxSizer286->Add(m_staticTextRight, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2); m_stcRight = new wxStyledTextCtrl(m_splitterPageRight, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); // Configure the fold margin m_stcRight->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_stcRight->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stcRight->SetMarginSensitive(4, true); m_stcRight->SetMarginWidth (4, 0); // Configure the tracker margin m_stcRight->SetMarginWidth(1, 0); // Configure the symbol margin m_stcRight->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_stcRight->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stcRight->SetMarginWidth(2, 16); m_stcRight->SetMarginSensitive(2, true); // Configure the line numbers margin m_stcRight->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_stcRight->SetMarginWidth(0,0); // Configure the line symbol margin m_stcRight->SetMarginType(3, wxSTC_MARGIN_FORE); m_stcRight->SetMarginMask(3, 0); m_stcRight->SetMarginWidth(3,0); // Select the lexer m_stcRight->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_stcRight->StyleClearAll(); m_stcRight->SetWrapMode(0); m_stcRight->SetIndentationGuides(0); m_stcRight->SetKeyWords(0, wxT("")); m_stcRight->SetKeyWords(1, wxT("")); m_stcRight->SetKeyWords(2, wxT("")); m_stcRight->SetKeyWords(3, wxT("")); m_stcRight->SetKeyWords(4, wxT("")); boxSizer113->Add(m_stcRight, 1, wxALL|wxEXPAND, 2); SetName(wxT("DiffSideBySidePanelBase")); SetSize(-1,-1); if (GetSizer()) { GetSizer()->Fit(this); } // Connect events this->Connect(ID_DIFF_TOOL_REFRESH, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnRefreshDiff), NULL, this); this->Connect(ID_DIFF_TOOL_REFRESH, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnRefreshDiffUI), NULL, this); this->Connect(ID_DIFF_TOOL_SAVE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnSaveChanges), NULL, this); this->Connect(ID_DIFF_TOOL_SAVE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnSaveChangesUI), NULL, this); this->Connect(ID_DIFF_TOOL_NEXT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnNextDiffSequence), NULL, this); this->Connect(ID_DIFF_TOOL_NEXT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnNextDiffUI), NULL, this); this->Connect(ID_DIFF_TOOL_PREV, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnPrevDiffSequence), NULL, this); this->Connect(ID_DIFF_TOOL_PREV, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnPrevDiffUI), NULL, this); this->Connect(ID_DIFF_TOOL_COPY_RIGHT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRightUI), NULL, this); this->Connect(ID_DIFF_TOOL_COPY_RIGHT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRight), NULL, this); this->Connect(ID_DIFF_TOOL_COPY_LEFT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeftUI), NULL, this); this->Connect(ID_DIFF_TOOL_COPY_LEFT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeft), NULL, this); this->Connect(m_menuItem271->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnCopyFileLeftToRight), NULL, this); this->Connect(m_menuItem271->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRightUI), NULL, this); this->Connect(m_menuItem273->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeftUI), NULL, this); this->Connect(m_menuItem273->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnCopyFileFromRight), NULL, this); this->Connect(m_singleView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnSingleView), NULL, this); this->Connect(m_singleView->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnSingleUI), NULL, this); this->Connect(m_vView->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnVerticalUI), NULL, this); this->Connect(m_vView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnVertical), NULL, this); this->Connect(m_hView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(DiffSideBySidePanelBase::OnHorizontal), NULL, this); this->Connect(m_hView->GetId(), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnHorizontalUI), NULL, this); m_textCtrlLeftFile->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnLeftPickerUI), NULL, this); m_button290->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnLeftPickerUI), NULL, this); m_button290->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnBrowseLeftFile), NULL, this); m_stcLeft->Connect(wxEVT_STC_PAINTED, wxStyledTextEventHandler(DiffSideBySidePanelBase::OnLeftStcPainted), NULL, this); m_stcLeft->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(DiffSideBySidePanelBase::OnMouseWheel), NULL, this); m_textCtrlRightFile->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnRightPickerUI), NULL, this); m_button294->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnRightPickerUI), NULL, this); m_button294->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DiffSideBySidePanelBase::OnBrowseRightFile), NULL, this); m_stcRight->Connect(wxEVT_STC_PAINTED, wxStyledTextEventHandler(DiffSideBySidePanelBase::OnRightStcPainted), NULL, this); m_stcRight->Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(DiffSideBySidePanelBase::OnMouseWheel), NULL, this); this->Connect(wxID_ANY, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEventHandler(DiffSideBySidePanelBase::ShowAuiToolMenu), NULL, this); }
DiffSideBySidePanelBase::DiffSideBySidePanelBase(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; } boxSizer13 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizer13); m_ribbonBar = new wxRibbonBar(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxRIBBON_BAR_DEFAULT_STYLE); m_ribbonBar->SetArtProvider(new wxRibbonDefaultArtProvider); boxSizer13->Add(m_ribbonBar, 0, wxALL|wxEXPAND, 2); m_ribbonPage43 = new wxRibbonPage(m_ribbonBar, wxID_ANY, _("Text Files Comparison"), wxNullBitmap, 0); m_ribbonBar->SetActivePage( m_ribbonPage43 ); m_ribbonPanel47 = new wxRibbonPanel(m_ribbonPage43, wxID_ANY, _("Comparison"), wxNullBitmap, wxDefaultPosition, wxSize(-1,-1), wxRIBBON_PANEL_DEFAULT_STYLE); m_ribbonButtonBar49 = new wxRibbonButtonBar(m_ribbonPanel47, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); m_ribbonButtonBar49->AddButton(wxID_REFRESH, _("Refresh"), wxXmlResource::Get()->LoadBitmap(wxT("diff-refresh")), _("Refresh View"), wxRIBBON_BUTTON_NORMAL); m_ribbonButtonBar49->AddButton(wxID_DOWN, _("Next"), wxXmlResource::Get()->LoadBitmap(wxT("diff-next")), _("Next Diff"), wxRIBBON_BUTTON_NORMAL); m_ribbonButtonBar49->AddButton(wxID_UP, _("Previous"), wxXmlResource::Get()->LoadBitmap(wxT("diff-prev")), _("Previous Diff"), wxRIBBON_BUTTON_NORMAL); m_ribbonButtonBar49->Realize(); m_ribbonPanel83 = new wxRibbonPanel(m_ribbonPage43, wxID_ANY, _("Edit"), wxNullBitmap, wxDefaultPosition, wxSize(-1,-1), wxRIBBON_PANEL_DEFAULT_STYLE); m_ribbonButtonBar85 = new wxRibbonButtonBar(m_ribbonPanel83, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); m_ribbonButtonBar85->AddButton(ID_TOOL_COPY_DIFF_LEFT_TO_RIGHT, _(" Copy"), wxXmlResource::Get()->LoadBitmap(wxT("diff-copy-left-to-right")), _("Copy current diff sequence from the left side to the right side"), wxRIBBON_BUTTON_HYBRID); m_ribbonButtonBar85->AddButton(ID_TOOL_COPY_DIFF_RIGHT_TO_LEFT, _(" Copy"), wxXmlResource::Get()->LoadBitmap(wxT("diff-copy-right-to-left")), _("Copy current diff sequence from the right side to the left side"), wxRIBBON_BUTTON_HYBRID); m_ribbonButtonBar85->AddButton(ID_TOOL_COPY_FILE_LEFT_TO_RIGHT, _("All Left"), wxXmlResource::Get()->LoadBitmap(wxT("diff-copy-file-left-to-right")), _("Copy the content of the left file to the right file"), wxRIBBON_BUTTON_NORMAL); m_ribbonButtonBar85->AddButton(ID_TOOL_COPY_FILE_RIGHT_TO_LEFT, _("All Right"), wxXmlResource::Get()->LoadBitmap(wxT("diff-copy-file-right-to-left")), _("Copy file from right to left"), wxRIBBON_BUTTON_NORMAL); m_ribbonButtonBar85->AddButton(ID_TOOL_SAVE, _("Save"), wxXmlResource::Get()->LoadBitmap(wxT("diff-save")), _("Save changes and refresh the diff view"), wxRIBBON_BUTTON_NORMAL); m_ribbonButtonBar85->Realize(); m_ribbonPanel121 = new wxRibbonPanel(m_ribbonPage43, wxID_ANY, _("View"), wxNullBitmap, wxDefaultPosition, wxSize(-1,-1), wxRIBBON_PANEL_DEFAULT_STYLE); m_ribbonButtonBar123 = new wxRibbonButtonBar(m_ribbonPanel121, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); m_ribbonButtonBar123->AddButton(ID_VIEW_VRTICAL, _("Vertical"), wxXmlResource::Get()->LoadBitmap(wxT("tile_horizontal")), _("Vertical panes"), wxRIBBON_BUTTON_TOGGLE); m_ribbonButtonBar123->AddButton(ID_VIEW_HORIZONTAL, _("Horizontal"), wxXmlResource::Get()->LoadBitmap(wxT("tile_vertical")), _("Horizontal panes"), wxRIBBON_BUTTON_TOGGLE); m_ribbonButtonBar123->AddButton(ID_VIEW_SINGLE, _("Single"), wxXmlResource::Get()->LoadBitmap(wxT("tile_single")), _("Single view"), wxRIBBON_BUTTON_TOGGLE); m_ribbonButtonBar123->Realize(); m_ribbonBar->Realize(); m_splitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxSP_LIVE_UPDATE|wxSP_PERMIT_UNSPLIT|wxSP_NO_XP_THEME|wxSP_3DSASH); m_splitter->SetSashGravity(0.5); m_splitter->SetMinimumPaneSize(10); boxSizer13->Add(m_splitter, 1, wxALL|wxEXPAND, 2); m_splitterPageLeft = new wxPanel(m_splitter, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL); boxSizer111 = new wxBoxSizer(wxVERTICAL); m_splitterPageLeft->SetSizer(boxSizer111); m_filePickerLeft = new wxFilePickerCtrl(m_splitterPageLeft, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*"), wxDefaultPosition, wxSize(-1,-1), wxFLP_DEFAULT_STYLE|wxFLP_USE_TEXTCTRL|wxFLP_SMALL); boxSizer111->Add(m_filePickerLeft, 0, wxALL|wxEXPAND, 2); m_stcLeft = new wxStyledTextCtrl(m_splitterPageLeft, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); m_stcLeft->SetFocus(); // Configure the fold margin m_stcLeft->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_stcLeft->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stcLeft->SetMarginSensitive(4, true); m_stcLeft->SetMarginWidth (4, 0); // Configure the tracker margin m_stcLeft->SetMarginWidth(1, 0); // Configure the symbol margin m_stcLeft->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_stcLeft->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stcLeft->SetMarginWidth(2, 16); m_stcLeft->SetMarginSensitive(2, true); // Configure the line numbers margin m_stcLeft->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_stcLeft->SetMarginWidth(0,0); // Configure the line symbol margin m_stcLeft->SetMarginType(3, wxSTC_MARGIN_FORE); m_stcLeft->SetMarginMask(3, 0); m_stcLeft->SetMarginWidth(3,0); // Select the lexer m_stcLeft->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_stcLeft->StyleClearAll(); m_stcLeft->SetWrapMode(0); m_stcLeft->SetIndentationGuides(0); m_stcLeft->SetKeyWords(0, wxT("")); m_stcLeft->SetKeyWords(1, wxT("")); m_stcLeft->SetKeyWords(2, wxT("")); m_stcLeft->SetKeyWords(3, wxT("")); m_stcLeft->SetKeyWords(4, wxT("")); boxSizer111->Add(m_stcLeft, 1, wxALL|wxEXPAND, 2); m_staticTextLeft = new wxStaticText(m_splitterPageLeft, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); wxFont m_staticTextLeftFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); m_staticTextLeftFont.SetWeight(wxFONTWEIGHT_BOLD); m_staticTextLeft->SetFont(m_staticTextLeftFont); boxSizer111->Add(m_staticTextLeft, 0, wxALL|wxALIGN_LEFT, 2); m_splitterPageRight = new wxPanel(m_splitter, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL); m_splitter->SplitVertically(m_splitterPageLeft, m_splitterPageRight, 0); boxSizer113 = new wxBoxSizer(wxVERTICAL); m_splitterPageRight->SetSizer(boxSizer113); m_filePickerRight = new wxFilePickerCtrl(m_splitterPageRight, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*"), wxDefaultPosition, wxSize(-1,-1), wxFLP_DEFAULT_STYLE|wxFLP_USE_TEXTCTRL|wxFLP_SMALL); boxSizer113->Add(m_filePickerRight, 0, wxALL|wxEXPAND, 2); m_stcRight = new wxStyledTextCtrl(m_splitterPageRight, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); // Configure the fold margin m_stcRight->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_stcRight->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stcRight->SetMarginSensitive(4, true); m_stcRight->SetMarginWidth (4, 0); // Configure the tracker margin m_stcRight->SetMarginWidth(1, 0); // Configure the symbol margin m_stcRight->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_stcRight->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stcRight->SetMarginWidth(2, 16); m_stcRight->SetMarginSensitive(2, true); // Configure the line numbers margin m_stcRight->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_stcRight->SetMarginWidth(0,0); // Configure the line symbol margin m_stcRight->SetMarginType(3, wxSTC_MARGIN_FORE); m_stcRight->SetMarginMask(3, 0); m_stcRight->SetMarginWidth(3,0); // Select the lexer m_stcRight->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_stcRight->StyleClearAll(); m_stcRight->SetWrapMode(0); m_stcRight->SetIndentationGuides(0); m_stcRight->SetKeyWords(0, wxT("")); m_stcRight->SetKeyWords(1, wxT("")); m_stcRight->SetKeyWords(2, wxT("")); m_stcRight->SetKeyWords(3, wxT("")); m_stcRight->SetKeyWords(4, wxT("")); boxSizer113->Add(m_stcRight, 1, wxALL|wxEXPAND, 2); m_staticTextRight = new wxStaticText(m_splitterPageRight, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0); wxFont m_staticTextRightFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); m_staticTextRightFont.SetWeight(wxFONTWEIGHT_BOLD); m_staticTextRight->SetFont(m_staticTextRightFont); boxSizer113->Add(m_staticTextRight, 0, wxALL|wxALIGN_LEFT, 2); SetName(wxT("DiffSideBySidePanelBase")); SetSizeHints(-1,-1); if ( GetSizer() ) { GetSizer()->Fit(this); } CentreOnParent(wxBOTH); // Connect events m_ribbonButtonBar49->Connect(wxID_REFRESH, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnRefreshDiff), NULL, this); m_ribbonButtonBar49->Connect(wxID_REFRESH, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnRefreshDiffUI), NULL, this); m_ribbonButtonBar49->Connect(wxID_DOWN, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnNextDiffSequence), NULL, this); m_ribbonButtonBar49->Connect(wxID_DOWN, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnNextDiffUI), NULL, this); m_ribbonButtonBar49->Connect(wxID_UP, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnPrevDiffSequence), NULL, this); m_ribbonButtonBar49->Connect(wxID_UP, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnPrevDiffUI), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_DIFF_LEFT_TO_RIGHT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRightUI), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_DIFF_LEFT_TO_RIGHT, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRight), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_DIFF_LEFT_TO_RIGHT, wxEVT_COMMAND_RIBBONBUTTON_DROPDOWN_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRightMenu), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_DIFF_RIGHT_TO_LEFT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeftUI), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_DIFF_RIGHT_TO_LEFT, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeft), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_DIFF_RIGHT_TO_LEFT, wxEVT_COMMAND_RIBBONBUTTON_DROPDOWN_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeftMenu), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_FILE_LEFT_TO_RIGHT, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnCopyFileLeftToRight), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_FILE_LEFT_TO_RIGHT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyLeftToRightUI), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_FILE_RIGHT_TO_LEFT, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnCopyFileFromRight), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_COPY_FILE_RIGHT_TO_LEFT, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnCopyRightToLeftUI), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_SAVE, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnSaveChanges), NULL, this); m_ribbonButtonBar85->Connect(ID_TOOL_SAVE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnSaveChangesUI), NULL, this); m_ribbonButtonBar123->Connect(ID_VIEW_VRTICAL, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnVertical), NULL, this); m_ribbonButtonBar123->Connect(ID_VIEW_VRTICAL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnVerticalUI), NULL, this); m_ribbonButtonBar123->Connect(ID_VIEW_HORIZONTAL, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnHorizontal), NULL, this); m_ribbonButtonBar123->Connect(ID_VIEW_HORIZONTAL, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnHorizontalUI), NULL, this); m_ribbonButtonBar123->Connect(ID_VIEW_SINGLE, wxEVT_COMMAND_RIBBONBUTTON_CLICKED, wxRibbonButtonBarEventHandler(DiffSideBySidePanelBase::OnSingleView), NULL, this); m_ribbonButtonBar123->Connect(ID_VIEW_SINGLE, wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnSingleUI), NULL, this); m_filePickerLeft->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnLeftPickerUI), NULL, this); m_stcLeft->Connect(wxEVT_STC_PAINTED, wxStyledTextEventHandler(DiffSideBySidePanelBase::OnLeftStcPainted), NULL, this); m_filePickerRight->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(DiffSideBySidePanelBase::OnRightPickerUI), NULL, this); m_stcRight->Connect(wxEVT_STC_PAINTED, wxStyledTextEventHandler(DiffSideBySidePanelBase::OnRightStcPainted), NULL, this); }
void rc_ide2Frame::OnPageOpen(wxCommandEvent& event) { wxFileDialog * FileDialog1 = new wxFileDialog(this, _("Select file"), wxEmptyString, wxEmptyString, wxFileSelectorDefaultWildcardStr, wxFD_OPEN, wxDefaultPosition, wxDefaultSize, _T("wxFileDialog")); FileDialog1->ShowModal(); wxString rc_filename = FileDialog1->GetDirectory() + _("\\") + FileDialog1->GetFilename(); //wxMessageBox(rc_filename); if(FileDialog1->GetReturnCode() == wxID_CANCEL) { FileDialog1->Destroy(); return; } FileDialog1->Destroy(); if(rc_filename.compare(_("\\"))!=0) { wxFileInputStream input(rc_filename); if(input.IsOk()) { wxString txtID_str = _("ID_RC_TXT") + wxString::Format(wxT("%i"),rc_current_page); rc_current_page++; wxStyledTextCtrl * rc_txtCtrl = new wxStyledTextCtrl(AuiNotebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, txtID_str); wxTextInputStream text(input); long i = 0; rc_txtCtrl->GotoPos(0); rc_txtCtrl->GotoLine(i); //wxString line=text.ReadLine(); while(input.IsOk() && !input.Eof() ) { //rc_txtCtrl->GotoPos(0); //rc_txtCtrl->GotoLine(i); wxString line=text.ReadLine(); if(input.Eof()) break; if(i > 0) rc_txtCtrl->AddText( _("\r\n")); rc_txtCtrl->GotoPos(0); rc_txtCtrl->GotoLine(i); int spos = line.find_last_not_of("\r")+1; line = line.substr(0, line.find_last_not_of("\r")+1); rc_txtCtrl->AddText(line); i++; } rc_txtCtrl->SetMarginType(0, wxSTC_MARGIN_NUMBER); rc_txtCtrl->SetMarginWidth(0, 40); rc_txtCtrl->SetUndoCollection(true); rc_txtCtrl->EmptyUndoBuffer(); rc_txtCtrl->SetLexer(wxSTC_LEX_FREEBASIC); rc_txtCtrl->StyleSetForeground(wxSTC_B_KEYWORD, wxColour(0, 0, 210)); rc_txtCtrl->StyleSetForeground(wxSTC_B_KEYWORD2, wxColour(0, 180, 0)); rc_txtCtrl->StyleSetForeground(wxSTC_B_NUMBER, wxColour(200, 40, 40)); rc_txtCtrl->StyleSetForeground(wxSTC_B_STRING, wxColour(230, 10, 230)); rc_txtCtrl->StyleSetForeground(wxSTC_B_COMMENT, wxColour(128,128,128)); rc_txtCtrl->SetKeyWords(0, rc_keywords); rc_txtCtrl->SetKeyWords(1, rc_keywords2); wxFont rc_font(12,wxFONTFAMILY_TELETYPE,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL); rc_txtCtrl->StyleSetFont(wxSTC_STYLE_DEFAULT, rc_font); rc_txtCtrl->SetTabWidth(4); rc_txtCtrl->Connect(wxEVT_STC_CHARADDED, wxStyledTextEventHandler(rc_ide2Frame::OnDocumentKey), NULL, this); AuiNotebook1->AddPage(rc_txtCtrl, FileDialog1->GetFilename()); rc_fnames[AuiNotebook1->GetPageIndex(rc_txtCtrl)] = rc_filename; } } }
FindResultsTab::FindResultsTab(wxWindow* parent, wxWindowID id, const wxString& name, bool useBook) : OutputTabWindow(parent, id, name) , m_searchInProgress(false) , m_book(NULL) , m_recv(NULL) , m_matchInfo(1) { if(useBook) { // load the book style from the settings file long style = kNotebook_MouseMiddleClickClosesTab | // Handle mouse middle button when clicked on a tab kNotebook_MouseMiddleClickFireEvent | // instead of closing the tab, fire an event kNotebook_CloseButtonOnActiveTab | // Show close button on the active tab kNotebook_ShowFileListButton | // show drop down list of all open tabs kNotebook_CloseButtonOnActiveTabFireEvent; // When closing the 'x' button, fire an event m_book = new Notebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style); m_book->SetMenu(wxXmlResource::Get()->LoadMenu(wxT("find_in_files_right_click_menu"))); m_book->Bind(wxEVT_BOOK_PAGE_CHANGED, &FindResultsTab::OnPageChanged, this); m_book->Bind(wxEVT_BOOK_PAGE_CLOSED, &FindResultsTab::OnPageClosed, this); m_book->Bind(wxEVT_BOOK_PAGE_CLOSING, &FindResultsTab::OnPageClosing, this); m_book->Bind(wxEVT_BOOK_PAGE_CLOSE_BUTTON, &FindResultsTab::OnClosePage, this); // get rid of base class scintilla component wxSizer* sz = m_hSizer; sz->Detach(m_sci); m_sci->Destroy(); m_sci = NULL; #ifdef __WXMAC__ sz->Insert(0, m_book, 1, wxALL | wxEXPAND); #else sz->Add(m_book, 1, wxALL | wxEXPAND); #endif sz->Layout(); } else { // keep existing scintilla SetStyles(m_sci); m_sci->Connect(wxEVT_STC_STYLENEEDED, wxStyledTextEventHandler(FindResultsTab::OnStyleNeeded), NULL, this); } BitmapLoader& loader = *(PluginManager::Get()->GetStdIcons()); wxTheApp->Connect(XRCID("find_in_files"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FindResultsTab::OnFindInFiles), NULL, this); m_tb->AddTool(XRCID("stop_search"), _("Stop current search"), loader.LoadBitmap(wxT("toolbars/16/build/stop")), _("Stop current search")); Connect(XRCID("stop_search"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FindResultsTab::OnStopSearch), NULL, this); Connect(XRCID("stop_search"), wxEVT_UPDATE_UI, wxUpdateUIEventHandler(FindResultsTab::OnStopSearchUI), NULL, this); m_tb->Realize(); EventNotifier::Get()->Connect( wxEVT_CL_THEME_CHANGED, wxCommandEventHandler(FindResultsTab::OnThemeChanged), NULL, this); }
CscopeTabBase::CscopeTabBase(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); wxC59CAInitBitmapResources(); bBitmapLoaded = true; } wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); this->SetSizer(mainSizer); wxBoxSizer* bSizer3 = new wxBoxSizer(wxHORIZONTAL); mainSizer->Add(bSizer3, 1, wxALL|wxEXPAND, WXC_FROM_DIP(2)); wxBoxSizer* boxSizer4 = new wxBoxSizer(wxVERTICAL); bSizer3->Add(boxSizer4, 1, wxEXPAND, WXC_FROM_DIP(2)); m_stc = new wxStyledTextCtrl(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); // Configure the fold margin m_stc->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_stc->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stc->SetMarginSensitive(4, true); m_stc->SetMarginWidth (4, 0); // Configure the tracker margin m_stc->SetMarginWidth(1, 0); // Configure the symbol margin m_stc->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_stc->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stc->SetMarginWidth(2, 16); m_stc->SetMarginSensitive(2, true); // Configure the line numbers margin m_stc->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_stc->SetMarginWidth(0,0); // Configure the line symbol margin m_stc->SetMarginType(3, wxSTC_MARGIN_FORE); m_stc->SetMarginMask(3, 0); m_stc->SetMarginWidth(3,0); // Select the lexer m_stc->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_stc->StyleClearAll(); m_stc->SetWrapMode(0); m_stc->SetIndentationGuides(0); m_stc->SetKeyWords(0, wxT("")); m_stc->SetKeyWords(1, wxT("")); m_stc->SetKeyWords(2, wxT("")); m_stc->SetKeyWords(3, wxT("")); m_stc->SetKeyWords(4, wxT("")); boxSizer4->Add(m_stc, 1, wxALL|wxEXPAND, WXC_FROM_DIP(2)); wxBoxSizer* bSizer31 = new wxBoxSizer(wxVERTICAL); bSizer3->Add(bSizer31, 0, wxEXPAND, WXC_FROM_DIP(2)); m_staticText2 = new wxStaticText(this, wxID_ANY, _("Search scope:"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); bSizer31->Add(m_staticText2, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_LEFT, WXC_FROM_DIP(5)); wxArrayString m_choiceSearchScopeArr; m_choiceSearchScope = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), m_choiceSearchScopeArr, 0); bSizer31->Add(m_choiceSearchScope, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); m_checkBoxUpdateDb = new wxCheckBox(this, wxID_ANY, _("Update Db if stale"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); m_checkBoxUpdateDb->SetValue(false); m_checkBoxUpdateDb->SetToolTip(_("If checked, before executing a command CScope will look for any changed files and, if found, try to update the database. In practice this seems unreliable.")); bSizer31->Add(m_checkBoxUpdateDb, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); m_checkBoxRevertedIndex = new wxCheckBox(this, wxID_ANY, _("Create reverted Index"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); m_checkBoxRevertedIndex->SetValue(false); m_checkBoxRevertedIndex->SetToolTip(_("Create reverted Index database")); bSizer31->Add(m_checkBoxRevertedIndex, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); bSizer31->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); m_buttonUpdateDbNow = new wxButton(this, wxID_ANY, _("&Update"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); m_buttonUpdateDbNow->SetToolTip(_("Perform an immediate database update")); bSizer31->Add(m_buttonUpdateDbNow, 0, wxLEFT|wxRIGHT|wxEXPAND, WXC_FROM_DIP(5)); m_buttonClear = new wxButton(this, wxID_ANY, _("&Clear"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); bSizer31->Add(m_buttonClear, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); m_gauge = new wxGauge(this, wxID_ANY, 100, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxGA_SMOOTH|wxGA_HORIZONTAL); m_gauge->SetValue(0); bSizer31->Add(m_gauge, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); SetName(wxT("CscopeTabBase")); SetSize(-1,-1); if (GetSizer()) { GetSizer()->Fit(this); } // Connect events m_stc->Connect(wxEVT_STC_HOTSPOT_CLICK, wxStyledTextEventHandler(CscopeTabBase::OnHotspotClicked), NULL, this); m_stc->Connect(wxEVT_STC_HOTSPOT_DCLICK, wxStyledTextEventHandler(CscopeTabBase::OnHotspotClicked), NULL, this); m_choiceSearchScope->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(CscopeTabBase::OnChangeSearchScope), NULL, this); m_checkBoxUpdateDb->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(CscopeTabBase::OnChangeSearchScope), NULL, this); m_checkBoxUpdateDb->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CscopeTabBase::OnWorkspaceOpenUI), NULL, this); m_checkBoxRevertedIndex->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(CscopeTabBase::OnChangeSearchScope), NULL, this); m_checkBoxRevertedIndex->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CscopeTabBase::OnWorkspaceOpenUI), NULL, this); m_buttonUpdateDbNow->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CscopeTabBase::OnCreateDB), NULL, this); m_buttonUpdateDbNow->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CscopeTabBase::OnWorkspaceOpenUI), NULL, this); m_buttonClear->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CscopeTabBase::OnClearResults), NULL, this); m_buttonClear->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(CscopeTabBase::OnClearResultsUI), NULL, this); }
TemplateClassBaseDlg::TemplateClassBaseDlg(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC61A6InitBitmapResources(); bBitmapLoaded = true; } wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(bSizer1); ID_NOTEBOOK1 = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxBK_DEFAULT); ID_NOTEBOOK1->SetName(wxT("ID_NOTEBOOK1")); bSizer1->Add(ID_NOTEBOOK1, 1, wxALL|wxEXPAND, 5); ID_PANEL = new wxPanel(ID_NOTEBOOK1, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL); ID_NOTEBOOK1->AddPage(ID_PANEL, _("Generate"), true); wxBoxSizer* bSizer2 = new wxBoxSizer(wxVERTICAL); ID_PANEL->SetSizer(bSizer2); wxStaticBoxSizer* sbSizer01 = new wxStaticBoxSizer( new wxStaticBox(ID_PANEL, wxID_ANY, _("Class")), wxVERTICAL); bSizer2->Add(sbSizer01, 0, wxALL|wxEXPAND, 5); wxFlexGridSizer* fgSizer1 = new wxFlexGridSizer(0, 2, 0, 0); fgSizer1->SetFlexibleDirection( wxBOTH ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizer1->AddGrowableCol(1); sbSizer01->Add(fgSizer1, 0, wxALL|wxEXPAND, 5); m_static1 = new wxStaticText(ID_PANEL, wxID_ANY, _("Class name:"), wxDefaultPosition, wxSize(-1, -1), 0); fgSizer1->Add(m_static1, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_textCtrlClassName = new wxTextCtrl(ID_PANEL, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(200,-1), 0); m_textCtrlClassName->SetToolTip(_("Name of new class")); m_textCtrlClassName->SetFocus(); #if wxVERSION_NUMBER >= 3000 m_textCtrlClassName->SetHint(wxT("")); #endif fgSizer1->Add(m_textCtrlClassName, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); m_static2 = new wxStaticText(ID_PANEL, wxID_ANY, _("Template:"), wxDefaultPosition, wxSize(-1, -1), 0); fgSizer1->Add(m_static2, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); wxArrayString m_comboxCurrentTemplateArr; m_comboxCurrentTemplate = new wxComboBox(ID_PANEL, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(200,-1), m_comboxCurrentTemplateArr, wxCB_SORT|wxCB_READONLY); m_comboxCurrentTemplate->SetToolTip(_("Template for new class")); fgSizer1->Add(m_comboxCurrentTemplate, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); wxStaticBoxSizer* sbSizer02 = new wxStaticBoxSizer( new wxStaticBox(ID_PANEL, wxID_ANY, _("Files")), wxVERTICAL); bSizer2->Add(sbSizer02, 0, wxALL|wxEXPAND, 5); wxFlexGridSizer* fgSizer2 = new wxFlexGridSizer(0, 3, 0, 0); fgSizer2->SetFlexibleDirection( wxBOTH ); fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizer2->AddGrowableCol(1); sbSizer02->Add(fgSizer2, 0, wxALL|wxEXPAND, 5); m_static3 = new wxStaticText(ID_PANEL, wxID_ANY, _(".h filename:"), wxDefaultPosition, wxSize(-1, -1), 0); fgSizer2->Add(m_static3, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_textCtrlHeaderFile = new wxTextCtrl(ID_PANEL, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(200,-1), 0); m_textCtrlHeaderFile->SetToolTip(_("Name of header file")); #if wxVERSION_NUMBER >= 3000 m_textCtrlHeaderFile->SetHint(wxT("")); #endif fgSizer2->Add(m_textCtrlHeaderFile, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgSizer2->Add(5, 5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); m_static4 = new wxStaticText(ID_PANEL, wxID_ANY, _(".cpp filename:"), wxDefaultPosition, wxSize(-1, -1), 0); fgSizer2->Add(m_static4, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_textCtrlCppFile = new wxTextCtrl(ID_PANEL, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(200,-1), 0); m_textCtrlCppFile->SetToolTip(_("Name of source file")); #if wxVERSION_NUMBER >= 3000 m_textCtrlCppFile->SetHint(wxT("")); #endif fgSizer2->Add(m_textCtrlCppFile, 0, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); fgSizer2->Add(5, 5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); m_staticProjectTreeFolder = new wxStaticText(ID_PANEL, wxID_ANY, _("Project tree folder:"), wxDefaultPosition, wxSize(-1, -1), 0); m_staticProjectTreeFolder->SetForegroundColour(wxColour(wxT("rgb(255,0,0)"))); fgSizer2->Add(m_staticProjectTreeFolder, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_textCtrlVD = new wxTextCtrl(ID_PANEL, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(230,-1), wxTE_READONLY); m_textCtrlVD->SetToolTip(_("Virtual folder to add new files")); #if wxVERSION_NUMBER >= 3000 m_textCtrlVD->SetHint(wxT("")); #endif fgSizer2->Add(m_textCtrlVD, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5); m_buttonBrowseVD = new wxButton(ID_PANEL, wxID_ANY, _("..."), wxDefaultPosition, wxSize(-1, -1), 0); m_buttonBrowseVD->SetToolTip(_("Browse virtual folders")); fgSizer2->Add(m_buttonBrowseVD, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); m_static5 = new wxStaticText(ID_PANEL, wxID_ANY, _("Path:"), wxDefaultPosition, wxSize(-1, -1), 0); fgSizer2->Add(m_static5, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5); m_textCtrlFilePath = new wxTextCtrl(ID_PANEL, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(230,-1), wxTE_READONLY); m_textCtrlFilePath->SetToolTip(_("Hd folder to add new files")); #if wxVERSION_NUMBER >= 3000 m_textCtrlFilePath->SetHint(wxT("")); #endif fgSizer2->Add(m_textCtrlFilePath, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5); m_buttonBrowsePath = new wxButton(ID_PANEL, wxID_ANY, _("..."), wxDefaultPosition, wxSize(-1, -1), 0); m_buttonBrowsePath->SetToolTip(_("Browse folders")); fgSizer2->Add(m_buttonBrowsePath, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); bSizer2->Add(0, 0, 1, wxALL, 5); wxBoxSizer* bSizer3 = new wxBoxSizer(wxHORIZONTAL); bSizer2->Add(bSizer3, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5); m_buttonGenerate = new wxButton(ID_PANEL, wxID_OK, _("&Generate"), wxDefaultPosition, wxSize(-1, -1), 0); m_buttonGenerate->SetDefault(); m_buttonGenerate->Enable(false); bSizer3->Add(m_buttonGenerate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); m_buttonCancel = new wxButton(ID_PANEL, wxID_CANCEL, _("&Quit"), wxDefaultPosition, wxSize(-1, -1), 0); bSizer3->Add(m_buttonCancel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); ID_PANEL1 = new wxPanel(ID_NOTEBOOK1, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL); ID_NOTEBOOK1->AddPage(ID_PANEL1, _("Templates"), false); wxBoxSizer* bSizer4 = new wxBoxSizer(wxVERTICAL); ID_PANEL1->SetSizer(bSizer4); wxBoxSizer* bSizer5 = new wxBoxSizer(wxHORIZONTAL); bSizer4->Add(bSizer5, 0, wxALL|wxEXPAND, 1); m_static6 = new wxStaticText(ID_PANEL1, wxID_ANY, _("Class:"), wxDefaultPosition, wxSize(-1, -1), 0); bSizer5->Add(m_static6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1); wxArrayString m_comboxTemplatesArr; m_comboxTemplates = new wxComboBox(ID_PANEL1, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), m_comboxTemplatesArr, wxCB_SORT); #if wxVERSION_NUMBER >= 3000 m_comboxTemplates->SetHint(wxT("")); #endif bSizer5->Add(m_comboxTemplates, 1, wxALL|wxALIGN_CENTER_VERTICAL, 1); m_buttonAddTemplate = new wxButton(ID_PANEL1, wxID_ANY, _("Add"), wxDefaultPosition, wxSize(-1, -1), 0); m_buttonAddTemplate->SetDefault(); bSizer5->Add(m_buttonAddTemplate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1); m_buttonChangeTemplate = new wxButton(ID_PANEL1, wxID_ANY, _("Change"), wxDefaultPosition, wxSize(-1, -1), 0); bSizer5->Add(m_buttonChangeTemplate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1); m_buttonRemoveTemplate = new wxButton(ID_PANEL1, wxID_ANY, _("Remove"), wxDefaultPosition, wxSize(-1, -1), 0); bSizer5->Add(m_buttonRemoveTemplate, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1); m_buttonClear = new wxButton(ID_PANEL1, wxID_ANY, _("Clear"), wxDefaultPosition, wxSize(-1, -1), 0); bSizer5->Add(m_buttonClear, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1); m_buttonInsertClassMacro = new wxButton(ID_PANEL1, wxID_ANY, _("%CLASS%"), wxDefaultPosition, wxSize(-1, -1), 0); bSizer5->Add(m_buttonInsertClassMacro, 0, wxALL|wxALIGN_CENTER_VERTICAL, 1); m_notebookFiles = new wxNotebook(ID_PANEL1, wxID_ANY, wxDefaultPosition, wxSize(500,-1), wxBK_TOP|wxBK_DEFAULT); m_notebookFiles->SetName(wxT("m_notebookFiles")); bSizer4->Add(m_notebookFiles, 1, wxALL|wxEXPAND, 1); m_panel3 = new wxPanel(m_notebookFiles, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL); m_notebookFiles->AddPage(m_panel3, _("Header File"), true); wxBoxSizer* bSizer6 = new wxBoxSizer(wxVERTICAL); m_panel3->SetSizer(bSizer6); m_textCtrlHeader = new wxStyledTextCtrl(m_panel3, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); // Configure the fold margin m_textCtrlHeader->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_textCtrlHeader->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_textCtrlHeader->SetMarginSensitive(4, true); m_textCtrlHeader->SetMarginWidth (4, 0); // Configure the tracker margin m_textCtrlHeader->SetMarginWidth(1, 0); // Configure the symbol margin m_textCtrlHeader->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_textCtrlHeader->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_textCtrlHeader->SetMarginWidth(2, 0); m_textCtrlHeader->SetMarginSensitive(2, true); // Configure the line numbers margin m_textCtrlHeader->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_textCtrlHeader->SetMarginWidth(0,0); // Configure the line symbol margin m_textCtrlHeader->SetMarginType(3, wxSTC_MARGIN_FORE); m_textCtrlHeader->SetMarginMask(3, 0); m_textCtrlHeader->SetMarginWidth(3,0); // Select the lexer m_textCtrlHeader->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_textCtrlHeader->StyleClearAll(); m_textCtrlHeader->SetWrapMode(0); m_textCtrlHeader->SetIndentationGuides(0); m_textCtrlHeader->SetKeyWords(0, wxT("")); m_textCtrlHeader->SetKeyWords(1, wxT("")); m_textCtrlHeader->SetKeyWords(2, wxT("")); m_textCtrlHeader->SetKeyWords(3, wxT("")); m_textCtrlHeader->SetKeyWords(4, wxT("")); bSizer6->Add(m_textCtrlHeader, 1, wxALL|wxEXPAND, 5); m_panel4 = new wxPanel(m_notebookFiles, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL); m_notebookFiles->AddPage(m_panel4, _("Implementation File"), false); wxBoxSizer* bSizer61 = new wxBoxSizer(wxVERTICAL); m_panel4->SetSizer(bSizer61); m_textCtrlImpl = new wxStyledTextCtrl(m_panel4, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0); // Configure the fold margin m_textCtrlImpl->SetMarginType (4, wxSTC_MARGIN_SYMBOL); m_textCtrlImpl->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_textCtrlImpl->SetMarginSensitive(4, true); m_textCtrlImpl->SetMarginWidth (4, 0); // Configure the tracker margin m_textCtrlImpl->SetMarginWidth(1, 0); // Configure the symbol margin m_textCtrlImpl->SetMarginType (2, wxSTC_MARGIN_SYMBOL); m_textCtrlImpl->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_textCtrlImpl->SetMarginWidth(2, 0); m_textCtrlImpl->SetMarginSensitive(2, true); // Configure the line numbers margin m_textCtrlImpl->SetMarginType(0, wxSTC_MARGIN_NUMBER); m_textCtrlImpl->SetMarginWidth(0,0); // Configure the line symbol margin m_textCtrlImpl->SetMarginType(3, wxSTC_MARGIN_FORE); m_textCtrlImpl->SetMarginMask(3, 0); m_textCtrlImpl->SetMarginWidth(3,0); // Select the lexer m_textCtrlImpl->SetLexer(wxSTC_LEX_NULL); // Set default font / styles m_textCtrlImpl->StyleClearAll(); m_textCtrlImpl->SetWrapMode(0); m_textCtrlImpl->SetIndentationGuides(0); m_textCtrlImpl->SetKeyWords(0, wxT("")); m_textCtrlImpl->SetKeyWords(1, wxT("")); m_textCtrlImpl->SetKeyWords(2, wxT("")); m_textCtrlImpl->SetKeyWords(3, wxT("")); m_textCtrlImpl->SetKeyWords(4, wxT("")); bSizer61->Add(m_textCtrlImpl, 1, wxALL|wxEXPAND, 5); #if wxVERSION_NUMBER >= 2900 wxPersistenceManager::Get().RegisterAndRestore(ID_NOTEBOOK1); #endif #if wxVERSION_NUMBER >= 2900 wxPersistenceManager::Get().RegisterAndRestore(m_notebookFiles); #endif SetName(wxT("TemplateClassBaseDlg")); SetSizeHints(-1,-1); if ( GetSizer() ) { GetSizer()->Fit(this); } CentreOnParent(wxBOTH); #if wxVERSION_NUMBER >= 2900 wxPersistenceManager::Get().RegisterAndRestore(this); #endif // Connect events m_textCtrlClassName->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(TemplateClassBaseDlg::OnClassNameEntered), NULL, this); m_buttonBrowseVD->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnBrowseVD), NULL, this); m_buttonBrowsePath->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnBrowseFilePath), NULL, this); m_buttonGenerate->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnGenerate), NULL, this); m_buttonGenerate->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnGenerateUI), NULL, this); m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnQuit), NULL, this); m_comboxTemplates->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(TemplateClassBaseDlg::OnTemplateClassSelected), NULL, this); m_buttonAddTemplate->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnButtonAdd), NULL, this); m_buttonAddTemplate->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnButtonAddUI), NULL, this); m_buttonChangeTemplate->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnButtonChange), NULL, this); m_buttonChangeTemplate->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnButtonChangeUI), NULL, this); m_buttonRemoveTemplate->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnButtonRemove), NULL, this); m_buttonRemoveTemplate->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnButtonRemoveUI), NULL, this); m_buttonClear->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnButtonClear), NULL, this); m_buttonClear->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnButtonClearUI), NULL, this); m_buttonInsertClassMacro->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TemplateClassBaseDlg::OnInsertClassKeyword), NULL, this); m_buttonInsertClassMacro->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(TemplateClassBaseDlg::OnInsertClassKeywordUI), NULL, this); m_textCtrlHeader->Connect(wxEVT_STC_CHANGE, wxStyledTextEventHandler(TemplateClassBaseDlg::OnStcHeaderFileContentChnaged), NULL, this); m_textCtrlImpl->Connect(wxEVT_STC_CHANGE, wxStyledTextEventHandler(TemplateClassBaseDlg::OnStcImplFileContentChnaged), NULL, this); }