GitCommitDlg::GitCommitDlg(wxWindow* parent) : GitCommitDlgBase(parent) , m_toggleChecks(false) { // read the configuration clConfig conf("git.conf"); GitEntry data; conf.ReadItem(&data); m_splitterInner->SetSashPosition(data.GetGitCommitDlgHSashPos()); m_splitterMain->SetSashPosition(data.GetGitCommitDlgVSashPos()); LexerConf::Ptr_t diffLexer = ColoursAndFontsManager::Get().GetLexer("diff"); if(diffLexer) { diffLexer->Apply(m_stcDiff); } m_choiceRecentCommits->Append(data.GetRecentCommit()); if(!data.GetRecentCommit().IsEmpty()) { m_choiceRecentCommits->SetSelection(0); } SetName("GitCommitDlg"); WindowAttrManager::Load(this); LexerConf::Ptr_t lex = ColoursAndFontsManager::Get().GetLexer("text"); lex->Apply(m_stcCommitMessage); }
void DiffSideBySidePanel::PrepareViews() { // Prepare the views by selecting the proper syntax highlight wxFileName fnLeft(m_filePickerLeft->GetPath()); wxFileName fnRight(m_filePickerRight->GetPath()); bool useRightSideLexer = false; if(fnLeft.GetExt() == "svn-base") { // doing svn diff, use the lexer for the right side file useRightSideLexer = true; } LexerConf::Ptr_t leftLexer = EditorConfigST::Get()->GetLexerForFile(useRightSideLexer ? fnRight.GetFullName() : fnLeft.GetFullName()); wxASSERT(leftLexer); LexerConf::Ptr_t rightLexer = EditorConfigST::Get()->GetLexerForFile(fnRight.GetFullName()); wxASSERT(rightLexer); leftLexer->Apply(m_stcLeft, true); rightLexer->Apply(m_stcRight, true); // Create the markers we need DefineMarkers(m_stcLeft); DefineMarkers(m_stcRight); // Turn off PP highlighting m_stcLeft->SetProperty("lexer.cpp.track.preprocessor", "0"); m_stcLeft->SetProperty("lexer.cpp.update.preprocessor", "0"); m_stcRight->SetProperty("lexer.cpp.track.preprocessor", "0"); m_stcRight->SetProperty("lexer.cpp.update.preprocessor", "0"); }
SvnCommitDialog::SvnCommitDialog( wxWindow* parent, const wxArrayString& paths, const wxString& url, Subversion2* plugin, const wxString& repoPath) : SvnCommitDialogBaseClass(parent) , m_plugin(plugin) , m_url(url) , m_repoPath(repoPath) , m_process(NULL) { Bind(wxEVT_ASYNC_PROCESS_OUTPUT, &SvnCommitDialog::OnProcessOutput, this); Bind(wxEVT_ASYNC_PROCESS_TERMINATED, &SvnCommitDialog::OnProcessTerminatd, this); m_stcDiff->SetReadOnly(true); wxString title = GetTitle(); title << wxT(" - ") << url; SetTitle(title); for(size_t i = 0; i < paths.GetCount(); i++) { int index = m_checkListFiles->Append(paths.Item(i)); m_checkListFiles->Check((unsigned int)index); } if(!paths.IsEmpty()) { m_checkListFiles->Select(0); DoShowDiff(0); } SetName("SvnCommitDialog"); WindowAttrManager::Load(this); int sashPos = m_plugin->GetSettings().GetCommitDlgSashPos(); if(sashPos != wxNOT_FOUND) { m_splitterH->SetSashPosition(sashPos); } int sashHPos = m_plugin->GetSettings().GetCommitDlgHSashPos(); if(sashHPos != wxNOT_FOUND) { m_splitterV->SetSashPosition(sashHPos); } LexerConf::Ptr_t diffLexer = EditorConfigST::Get()->GetLexer("Diff"); if(diffLexer) { m_stcDiff->SetLexer(wxSTC_LEX_DIFF); diffLexer->Apply(m_stcDiff); } LexerConf::Ptr_t textLexer = EditorConfigST::Get()->GetLexer("text"); if(textLexer) { textLexer->Apply(m_stcMessage); } }
SvnCommitDialog::SvnCommitDialog(wxWindow* parent, Subversion2* plugin) : SvnCommitDialogBaseClass(parent) , m_plugin(plugin) , m_process(NULL) { Bind(wxEVT_ASYNC_PROCESS_OUTPUT, &SvnCommitDialog::OnProcessOutput, this); Bind(wxEVT_ASYNC_PROCESS_TERMINATED, &SvnCommitDialog::OnProcessTerminatd, this); m_stcDiff->SetReadOnly(true); m_checkListFiles->Clear(); // Hide the bug tracker ID m_textCtrlBugID->Clear(); m_textCtrlBugID->Hide(); m_staticTextBugID->Hide(); m_textCtrlFrID->Clear(); m_staticText32->Hide(); m_textCtrlFrID->Hide(); m_checkListFiles->Disable(); m_panel1->Disable(); SetName("SvnCommitDialog"); WindowAttrManager::Load(this); int sashPos = m_plugin->GetSettings().GetCommitDlgSashPos(); if(sashPos != wxNOT_FOUND) { m_splitterH->SetSashPosition(sashPos); } LexerConf::Ptr_t textLexer = EditorConfigST::Get()->GetLexer("text"); if(textLexer) { textLexer->Apply(m_stcMessage); } }
void CppCheckReportPage::DoInitStyle() { m_stc->SetReadOnly(true); m_stc->MarkerDefine(CPPCHECK_ERROR_MARKER, wxSTC_MARK_ARROW, *wxRED, *wxRED); m_stc->MarkerDefine(CPPCHECK_ERROR_MARKER_CURRENT, wxSTC_MARK_BACKGROUND, "PINK", "PINK"); m_stc->MarkerSetAlpha(CPPCHECK_ERROR_MARKER_CURRENT, 70); LexerConf::Ptr_t config = EditorConfigST::Get()->GetLexer("text"); if(config) { config->Apply(m_stc, true); m_stc->HideSelection(true); } else { // Initialize the output text style m_stc->SetLexer(wxSTC_LEX_NULL); m_stc->StyleClearAll(); m_stc->HideSelection(true); // Use font for(int i = 0; i <= wxSTC_STYLE_DEFAULT; i++) { wxFont defFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); defFont.SetFamily(wxFONTFAMILY_TELETYPE); m_stc->StyleSetBackground(i, DrawingUtils::GetOutputPaneBgColour()); m_stc->StyleSetForeground(i, DrawingUtils::GetOutputPaneFgColour()); m_stc->StyleSetFont(i, defFont); } } }
clAboutDialog::clAboutDialog(wxWindow* parent, const wxString& version) : clAboutDialogBase(parent) { m_staticTextVersion->SetLabel(version); // Load the license file wxFileName license(clStandardPaths::Get().GetDataDir(), "LICENSE"); wxString fileContent; FileUtils::ReadFileContent(license, fileContent); LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text"); if(lexer) { lexer->Apply(m_stcLicense); lexer->Apply(m_stcCredits); } // Set the license file m_stcLicense->SetText(fileContent); m_stcLicense->SetReadOnly(true); // Set the credits wxString credits; credits << "\n==============================\n\n"; credits << _("Eran Ifrah (Project admin)") << "\n"; credits << _("David G. Hart") << "\n\n"; credits << "==============================\n\n"; credits << _("Frank Lichtner") << "\n"; credits << _("Jacek Kucharski") << "\n"; credits << _("Marrianne Gagnon") << "\n"; credits << _("Scott Dolim") << "\n"; m_stcCredits->SetText(credits); m_stcCredits->SetReadOnly(true); CentreOnParent(); GetSizer()->Fit(this); }
void DbViewerPanel::InitStyledTextCtrl(wxStyledTextCtrl* sci) { LexerConf::Ptr_t lexer = EditorConfigST::Get()->GetLexer("SQL"); if(lexer) { lexer->Apply(sci, true); } }
void PHPDebugPane::OnXDebugSessionStarting(XDebugEvent& event) { event.Skip(); m_console->SetTerminal(PHPWorkspace::Get()->GetTerminalEmulator()); LexerConf::Ptr_t phpLexer = ColoursAndFontsManager::Get().GetLexer("php"); if(phpLexer) { phpLexer->Apply(m_console->GetTerminalOutputWindow()); } }
AddIncludeFileDlg::AddIncludeFileDlg( wxWindow* parent, const wxString &fullpath, const wxString &text, int lineNo ) : AddIncludeFileDlgBase( parent ) , m_fullpath(fullpath) , m_text(text) , m_line(lineNo) { UpdateLineToAdd(); // Initialise the preview window LexerConf::Ptr_t cppLex = EditorConfigST::Get()->GetLexer("C++"); cppLex->Apply( m_textCtrlPreview, true ); //--------------------------------------------------------- m_textCtrlPreview->MarkerDefine(0x7, wxSTC_MARK_ARROW); m_textCtrlPreview->MarkerSetBackground(0x7, wxT("YELLOW GREEN")); // Set the initial text m_textCtrlPreview->SetReadOnly(false); m_textCtrlPreview->AddText(m_text); m_textCtrlPreview->EmptyUndoBuffer(); SetAndMarkLine(); m_textCtrlLineToAdd->SetFocus(); WindowAttrManager::Load(this, "AddIncludeFileDlg", NULL); Centre(); }
void ZoomText::UpdateLexer(IEditor* editor) { if(!editor) { editor = clGetManager()->GetActiveEditor(); } if(!editor) { DoClear(); return; } znConfigItem data; clConfig conf("zoom-navigator.conf"); conf.ReadItem(&data); m_filename = editor->GetFileName().GetFullPath(); LexerConf::Ptr_t lexer = EditorConfigST::Get()->GetLexerForFile(m_filename); if(!lexer) { lexer = EditorConfigST::Get()->GetLexer("Text"); } lexer->Apply(this, true); if(lexer->IsDark()) { MarkerSetAlpha(1, 10); } else { MarkerSetAlpha(1, 20); } SetZoom(m_zoomFactor); SetEditable(false); SetUseHorizontalScrollBar(false); SetUseVerticalScrollBar(data.IsUseScrollbar()); HideSelection(true); MarkerSetBackground(1, m_colour); }
NodeJSDebuggerPane::NodeJSDebuggerPane(wxWindow* parent) : NodeJSDebuggerPaneBase(parent) { EventNotifier::Get()->Bind( wxEVT_NODEJS_DEBUGGER_EXPRESSION_EVALUATED, &NodeJSDebuggerPane::OnExpressionEvaluated, this); EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_UPDATE_CALLSTACK, &NodeJSDebuggerPane::OnUpdateCallstack, this); EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_LOST_INTERACT, &NodeJSDebuggerPane::OnLostControl, this); EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_CONSOLE_LOG, &NodeJSDebuggerPane::OnConsoleLog, this); EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_STARTED, &NodeJSDebuggerPane::OnSessionStarted, this); EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_EXCEPTION_THROWN, &NodeJSDebuggerPane::OnExceptionThrown, this); EventNotifier::Get()->Bind(wxEVT_NODEJS_DEBUGGER_SELECT_FRAME, &NodeJSDebuggerPane::OnFrameSelected, this); EventNotifier::Get()->Bind( wxEVT_NODEJS_DEBUGGER_UPDATE_BREAKPOINTS_VIEW, &NodeJSDebuggerPane::OnUpdateDebuggerView, this); LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text"); if(lexer) { lexer->Apply(m_consoleLog); } m_dataviewLocals->SetIndent(16); m_dataviewLocals->GetColumn(0)->SetWidth(150); m_dataviewLocals->GetColumn(1)->SetWidth(100); m_dataviewLocals->GetColumn(2)->SetWidth(500); m_dvListCtrlCallstack->GetColumn(0)->SetWidth(30); m_dvListCtrlCallstack->GetColumn(1)->SetWidth(200); m_dvListCtrlCallstack->GetColumn(2)->SetWidth(300); m_dvListCtrlCallstack->GetColumn(3)->SetWidth(100); }
EditDlg::EditDlg(wxWindow* parent, const wxString &text) : EditDlgBase(parent) { LexerConf::Ptr_t lex = EditorConfigST::Get()->GetLexer("text"); lex->Apply( m_stc10 ); m_stc10->SetText( text ); WindowAttrManager::Load(this, "EditDlg"); }
void GitCommitEditor::InitStyles() { LexerConf::Ptr_t diffLexer = EditorConfigST::Get()->GetLexer("Diff"); if(diffLexer) { diffLexer->Apply(this); this->SetLexer(wxSTC_LEX_DIFF); } }
void NodeJSDebuggerPane::OnSessionStarted(clDebugEvent& event) { event.Skip(); m_consoleLog->ClearAll(); LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text"); if(lexer) { lexer->Apply(m_consoleLog); } }
EnterStringsDlg::EnterStringsDlg(wxWindow* parent, const wxString& value) : EnterStringsDlgBase(parent) { LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text", "Default"); if(lexer) { lexer->Apply(m_stc); } m_stc->SetText(value); SetName("EnterStringsDlg"); WindowAttrManager::Load(this); }
PHPTerminal::PHPTerminal(wxWindow* parent) : TerminalEmulatorFrame(parent) { LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("php"); if(lexer) { lexer->Apply(GetTerminalUI()->GetTerminalOutputWindow()); } SetSize(300, 300); WindowAttrManager::Load(this, "PHPTerminal"); }
SSHTerminal::SSHTerminal(wxWindow* parent, clSSH::Ptr_t ssh) : SSHTerminalBase(parent) , m_ssh(ssh) { // initialize text / font LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text"); if(lexer) { lexer->Apply(m_stcOutput); } m_stcOutput->SetEditable(false); }
GitCommitListDlg::GitCommitListDlg(wxWindow* parent, const wxString& workingDir, GitPlugin* git) : GitCommitListDlgBase(parent) , m_git(git) , m_workingDir(workingDir) { LexerConf::Ptr_t lex = EditorConfigST::Get()->GetLexer("diff"); if(lex) { lex->Apply(m_stcDiff, true); } LexerConf::Ptr_t textLex = EditorConfigST::Get()->GetLexer("text"); textLex->Apply(m_stcCommitMessage, true); clConfig conf("git.conf"); GitEntry data; conf.ReadItem(&data); m_gitPath = data.GetGITExecutablePath(); m_gitPath.Trim().Trim(false); if(m_gitPath.IsEmpty()) { m_gitPath = "git"; } SetName("GitCommitListDlg"); WindowAttrManager::Load(this); m_dvListCtrlCommitList->Connect(ID_COPY_COMMIT_HASH, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(GitCommitListDlg::OnCopyCommitHashToClipboard), NULL, this); m_dvListCtrlCommitList->Connect(ID_REVERT_COMMIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(GitCommitListDlg::OnRevertCommit), NULL, this); }
GitCommitDlg::GitCommitDlg(wxWindow* parent, const wxString& repoDir) : GitCommitDlgBase(parent) , m_workingDir(repoDir) { // read the configuration clConfig conf("git.conf"); GitEntry data; conf.ReadItem( &data ); m_splitterInner->SetSashPosition(data.GetGitCommitDlgHSashPos()); m_splitterMain->SetSashPosition(data.GetGitCommitDlgVSashPos()); WindowAttrManager::Load(this, wxT("GitCommitDlg"), NULL); LexerConf::Ptr_t lex = EditorConfigST::Get()->GetLexer("text"); lex->Apply(m_stcCommitMessage); }
void NewBuildTab::InitView(const wxString& theme) { LexerConf::Ptr_t lexText = ColoursAndFontsManager::Get().GetLexer("text", theme); lexText->Apply(m_view); m_view->SetUndoCollection(false); m_view->EmptyUndoBuffer(); m_view->HideSelection(true); m_view->SetEditable(false); StyleProperty::Map_t& props = lexText->GetLexerProperties(); const StyleProperty& defaultStyle = lexText->GetProperty(0); // reset the styles m_view->SetLexer(wxSTC_LEX_CONTAINER); wxFont defaultFont = lexText->GetFontForSyle(0); for(size_t i = 0; i < wxSTC_STYLE_MAX; ++i) { m_view->StyleSetForeground(i, defaultStyle.GetFgColour()); m_view->StyleSetBackground(i, defaultStyle.GetBgColour()); m_view->StyleSetFont(i, defaultFont); } m_view->StyleSetForeground(LEX_GCC_INFO, wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT)); m_view->StyleSetForeground(LEX_GCC_DEFAULT, props[0].GetFgColour()); m_view->StyleSetForeground(LEX_GCC_WARNING, this->m_buildTabSettings.GetWarnColour()); m_view->StyleSetForeground(LEX_GCC_ERROR, this->m_buildTabSettings.GetErrorColour()); m_view->StyleSetHotSpot(LEX_GCC_ERROR, true); m_view->StyleSetHotSpot(LEX_GCC_WARNING, true); m_view->SetHotspotActiveUnderline(false); // No underline m_view->MarkerDefine(LEX_GCC_MARKER, wxSTC_MARK_BACKGROUND); if(lexText->IsDark()) { m_view->MarkerSetBackground(LEX_GCC_MARKER, wxColour(defaultStyle.GetBgColour()).ChangeLightness(110)); } else { m_view->MarkerSetBackground(LEX_GCC_MARKER, wxColour(defaultStyle.GetBgColour()).ChangeLightness(90)); } // Hide all margins for(int i = 0; i <= wxSTC_MARGIN_RTEXT; ++i) { m_view->SetMarginWidth(i, 0); } // make the symbol margin 5 pixel width m_view->SetMarginType(0, wxSTC_MARGIN_SYMBOL); m_view->SetMarginWidth(0, 5); }
SvnBlameFrame::SvnBlameFrame(wxWindow* parent, const wxFileName& filename, const wxString& content) : SvnBlameFrameBase(parent) , m_filename(filename) { // Now that the base class is done with its initialization // do our custom initialization to the blame editor m_stc->SetText(content); m_stc->SetReadOnly(true); LexerConf::Ptr_t lexer = EditorConfigST::Get()->GetLexerForFile(filename.GetFullName()); if(lexer) { lexer->Apply(m_stc, true); } m_stc->Initialize(); SetName("SvnBlameFrame"); WindowAttrManager::Load(this); }
EvalPane::EvalPane(wxWindow* parent) : EvalPaneBase(parent) { EventNotifier::Get()->Bind(wxEVT_XDEBUG_EVAL_EXPRESSION, &EvalPane::OnExpressionEvaluate, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_UNKNOWN_RESPONSE, &EvalPane::OnDBGPCommandEvaluated, this); LexerConf::Ptr_t lex = EditorConfigST::Get()->GetLexer("text"); if ( lex ) { lex->Apply(m_stcOutput); } // Since XDebug replies with XML, use the XML lexer for the output LexerConf::Ptr_t xml_lex = EditorConfigST::Get()->GetLexer("xml"); if ( xml_lex ) { xml_lex->Apply(m_stcOutputXDebug, true); } m_stcOutput->SetEditable(false); }
PHPDebugPane::PHPDebugPane(wxWindow* parent) : PHPDebugPaneBase(parent) { EventNotifier::Get()->Bind(wxEVT_XDEBUG_STACK_TRACE, &PHPDebugPane::OnUpdateStackTrace, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_SESSION_STARTED, &PHPDebugPane::OnXDebugSessionStarted, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_SESSION_STARTING, &PHPDebugPane::OnXDebugSessionStarting, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_BREAKPOINTS_UPDATED, &PHPDebugPane::OnRefreshBreakpointsView, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_SESSION_ENDED, &PHPDebugPane::OnXDebugSessionEnded, this); m_console = new TerminalEmulatorUI(m_auiBook); m_auiBook->AddPage(m_console, _("Console"), true); #ifndef __WXGTK__ m_auiBook->SetArtProvider(new clAuiGlossyTabArt); #endif LexerConf::Ptr_t phpLexer = ColoursAndFontsManager::Get().GetLexer("php"); if(phpLexer) { phpLexer->Apply(m_console->GetTerminalOutputWindow()); } }
DebuggerDisassemblyTab::DebuggerDisassemblyTab(wxWindow* parent, const wxString& label) : DebuggerDisassemblyTabBase(parent) , m_title(label) { // associate our custom model m_model.reset(new RegistersViewModel(m_dvListCtrlRegisters)); m_dvListCtrlRegisters->AssociateModel(m_model.get()); m_stc->MarkerDefine(CURLINE_MARKER, wxSTC_MARK_BACKGROUND, wxNullColour, EditorConfigST::Get()->GetOptions()->GetDebuggerMarkerLine()); m_stc->MarkerSetAlpha(CURLINE_MARKER, 50); m_stc->SetReadOnly(true); m_stc->SetMarginSensitive(2, true); // 2 is the symbol margin m_stc->MarkerDefineBitmap(BREAKPOINT_MARKER, wxBitmap(wxImage(stop_xpm))); m_stc->SetYCaretPolicy(wxSTC_CARET_SLOP, 30); EventNotifier::Get()->Connect( wxEVT_DEBUGGER_DISASSEBLE_OUTPUT, clCommandEventHandler(DebuggerDisassemblyTab::OnOutput), NULL, this); EventNotifier::Get()->Connect( wxEVT_DEBUGGER_DISASSEBLE_CURLINE, clCommandEventHandler(DebuggerDisassemblyTab::OnCurLine), NULL, this); EventNotifier::Get()->Connect( wxEVT_DEBUGGER_QUERY_FILELINE, clCommandEventHandler(DebuggerDisassemblyTab::OnQueryFileLineDone), NULL, this); EventNotifier::Get()->Connect( wxEVT_DEBUGGER_LIST_REGISTERS, clCommandEventHandler(DebuggerDisassemblyTab::OnShowRegisters), NULL, this); EventNotifier::Get()->Bind(wxEVT_DEBUG_ENDED, &DebuggerDisassemblyTab::OnDebuggerStopped, this); EventNotifier::Get()->Connect(wxEVT_CODELITE_ALL_BREAKPOINTS_DELETED, wxCommandEventHandler(DebuggerDisassemblyTab::OnAllBreakpointsDeleted), NULL, this); EventNotifier::Get()->Connect( wxEVT_DEBUGGER_UPDATE_VIEWS, clCommandEventHandler(DebuggerDisassemblyTab::OnRefreshView), NULL, this); LexerConf::Ptr_t lex = EditorConfigST::Get()->GetLexer("Assembly"); if(lex) { lex->Apply(m_stc, true); } }
EnvVarsTableDlg::EnvVarsTableDlg(wxWindow* parent) : EnvVarsTableDlgBase(parent) { EvnVarList vars; EnvironmentConfig::Instance()->ReadObject(wxT("Variables"), &vars); std::map<wxString, wxString> envSets = vars.GetEnvVarSets(); wxString activePage = vars.GetActiveSet(); wxStyledTextCtrl* sci = m_textCtrlDefault; LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text"); if(lexer) { lexer->Apply(sci); } WindowAttrManager::Load(this, wxT("EnvVarsTableDlg"), NULL); std::map<wxString, wxString>::iterator iter = envSets.begin(); for(; iter != envSets.end(); iter++) { wxString name = iter->first; wxString content = iter->second; if(name == wxT("Default")) { m_textCtrlDefault->SetText(content); } else { DoAddPage(name, content, false); } } m_notebook1->SetSelection(0); for(size_t i = 0; i < m_notebook1->GetPageCount(); i++) { if(m_notebook1->GetPageText(i) == activePage) { m_notebook1->GetPage(i)->SetFocus(); m_notebook1->SetSelection(i); break; } } }
PHPDebugPane::PHPDebugPane(wxWindow* parent) : PHPDebugPaneBase(parent) { Hide(); EventNotifier::Get()->Bind(wxEVT_XDEBUG_STACK_TRACE, &PHPDebugPane::OnUpdateStackTrace, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_SESSION_STARTED, &PHPDebugPane::OnXDebugSessionStarted, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_SESSION_STARTING, &PHPDebugPane::OnXDebugSessionStarting, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_BREAKPOINTS_UPDATED, &PHPDebugPane::OnRefreshBreakpointsView, this); EventNotifier::Get()->Bind(wxEVT_XDEBUG_SESSION_ENDED, &PHPDebugPane::OnXDebugSessionEnded, this); EventNotifier::Get()->Bind(wxEVT_EDITOR_CONFIG_CHANGED, &PHPDebugPane::OnSettingsChanged, this); m_console = new TerminalEmulatorUI(m_auiBook); if(EditorConfigST::Get()->GetOptions()->IsTabColourDark()) { m_auiBook->SetStyle((kNotebook_Default & ~kNotebook_LightTabs) | kNotebook_DarkTabs); } else { m_auiBook->SetStyle(kNotebook_Default); } m_auiBook->AddPage(m_console, _("Console"), true); LexerConf::Ptr_t phpLexer = ColoursAndFontsManager::Get().GetLexer("php"); if(phpLexer) { phpLexer->Apply(m_console->GetTerminalOutputWindow()); } m_tbBreakpoints->AddTool(wxID_DELETE, _("Delete"), clGetManager()->GetStdIcons()->LoadBitmap("minus"), _("Delete the selected breakpoints")); m_tbBreakpoints->AddTool(wxID_CLEAR, _("Delete all breakpoints"), clGetManager()->GetStdIcons()->LoadBitmap("clean"), _("Delete all breakpoints")); m_tbBreakpoints->Bind(wxEVT_TOOL, &PHPDebugPane::OnDeleteBreakpoint, this, wxID_DELETE); m_tbBreakpoints->Bind(wxEVT_UPDATE_UI, &PHPDebugPane::OnDeleteBreakpointUI, this, wxID_DELETE); m_tbBreakpoints->Bind(wxEVT_TOOL, &PHPDebugPane::OnClearAll, this, wxID_CLEAR); m_tbBreakpoints->Bind(wxEVT_UPDATE_UI, &PHPDebugPane::OnClearAllUI, this, wxID_CLEAR); m_tbBreakpoints->Realize(); // Assign bitmaps to the view m_bitmaps.push_back(clGetManager()->GetStdIcons()->LoadBitmap("forward")); m_bitmaps.push_back(clGetManager()->GetStdIcons()->LoadBitmap("placeholder")); m_dvListCtrlStackTrace->SetBitmaps(&m_bitmaps); }
TagsOptionsDlg::TagsOptionsDlg(wxWindow* parent, const TagsOptionsData& data) : TagsOptionsBaseDlg(parent) , m_data(data) { DoSetEditEventsHandler(this); LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text"); if(lexer) { lexer->Apply(m_textCtrlClangSearchPaths); lexer->Apply(m_textCtrlCtagsExcludePaths); lexer->Apply(m_textCtrlCtagsSearchPaths); lexer->Apply(m_textPrep); lexer->Apply(m_textTypes); } ::wxPGPropertyBooleanUseCheckbox(m_pgMgrColouring->GetGrid()); Centre(); GetSizer()->Fit(this); SetName("TagsOptionsDlg"); WindowAttrManager::Load(this); // Set default values //------------------------------------------------------------------ // Display and behavior //------------------------------------------------------------------ m_checkDisplayFunctionTip->SetValue(m_data.GetFlags() & CC_DISP_FUNC_CALLTIP ? true : false); m_checkDisplayTypeInfo->SetValue(m_data.GetFlags() & CC_DISP_TYPE_INFO ? true : false); m_checkCppKeywordAssist->SetValue(m_data.GetFlags() & CC_CPP_KEYWORD_ASISST ? true : false); m_checkDisableParseOnSave->SetValue(m_data.GetFlags() & CC_DISABLE_AUTO_PARSING ? true : false); m_checkBoxretagWorkspaceOnStartup->SetValue(m_data.GetFlags() & CC_RETAG_WORKSPACE_ON_STARTUP ? true : false); m_checkBoxDeepUsingNamespaceResolving->SetValue(m_data.GetFlags() & CC_DEEP_SCAN_USING_NAMESPACE_RESOLVING ? true : false); m_checkBoxEnableCaseSensitiveCompletion->SetValue(m_data.GetFlags() & CC_IS_CASE_SENSITIVE ? true : false); m_checkBoxKeepFunctionSignature->SetValue(m_data.GetFlags() & CC_KEEP_FUNCTION_SIGNATURE_UNFORMATTED); m_spinCtrlNumberOfCCItems->ChangeValue(::wxIntToString(m_data.GetCcNumberOfDisplayItems())); m_textCtrlFileSpec->ChangeValue(m_data.GetFileSpec()); //------------------------------------------------------------------ // Colouring //------------------------------------------------------------------ m_pgPropColourLocalVariables->SetValue(m_data.GetFlags() & CC_COLOUR_VARS ? true : false); m_pgPropTrackPreProcessors->SetValue(m_data.GetCcColourFlags() & CC_COLOUR_MACRO_BLOCKS ? true : false); //---------------------------------------------------- // Triggering //---------------------------------------------------- m_checkWordAssist->SetValue(m_data.GetFlags() & CC_WORD_ASSIST ? true : false); m_checkAutoInsertSingleChoice->SetValue(m_data.GetFlags() & CC_AUTO_INSERT_SINGLE_CHOICE ? true : false); m_sliderMinWordLen->SetValue(m_data.GetMinWordLen()); //---------------------------------------------------- // CTags search paths //---------------------------------------------------- m_textCtrlCtagsSearchPaths->SetValue(wxImplode(m_data.GetParserSearchPaths(), wxT("\n"))); m_textCtrlCtagsExcludePaths->SetValue(wxImplode(m_data.GetParserExcludePaths(), wxT("\n"))); //---------------------------------------------------- // CTags advanced page //---------------------------------------------------- m_textPrep->SetValue(m_data.GetTokens()); m_textTypes->SetValue(m_data.GetTypes()); m_textCtrlFilesList->SetValue(m_data.GetMacrosFiles()); //---------------------------------------------------- // Clang page //---------------------------------------------------- #if HAS_LIBCLANG m_checkBoxEnableClangCC->SetValue(m_data.GetClangOptions() & CC_CLANG_ENABLED); #else m_checkBoxEnableClangCC->SetValue(false); m_checkBoxEnableClangCC->Enable(false); #endif m_checkBoxClangFirst->SetValue(m_data.GetClangOptions() & CC_CLANG_FIRST); m_textCtrlClangSearchPaths->SetValue(m_data.GetClangSearchPaths()); m_choiceCachePolicy->Clear(); // defaults m_choiceCachePolicy->Append(TagsOptionsData::CLANG_CACHE_LAZY); m_choiceCachePolicy->Append(TagsOptionsData::CLANG_CACHE_ON_FILE_LOAD); m_choiceCachePolicy->Select(1); int where = m_choiceCachePolicy->FindString(m_data.GetClangCachePolicy()); if(where != wxNOT_FOUND) { m_choiceCachePolicy->Select(where); } }
void ContextBase::DoApplySettings(LexerConf::Ptr_t lexPtr) { lexPtr->Apply(&GetCtrl()); }
void CodeFormatterDlg::InitDialog() { long formatOptions = m_options.GetOptions() & AS_ALL_FORMAT_OPTIONS; long indentOptions = m_options.GetOptions() & AS_ALL_INDENT_OPTIONS; m_pgPropIndentation->SetValue( indentOptions ); m_pgPropFormatting->SetValue( formatOptions ); // Bracket options if ( m_options.GetOptions() & AS_BRACKETS_BREAK_CLOSING ) m_pgPropBrackets->SetValue("Break closing"); else if ( m_options.GetOptions() & AS_BRACKETS_BREAK ) m_pgPropBrackets->SetValue("Break"); else if ( m_options.GetOptions() & AS_BRACKETS_ATTACH ) m_pgPropBrackets->SetValue("Attach"); else if ( m_options.GetOptions() & AS_BRACKETS_LINUX ) m_pgPropBrackets->SetValue("Linux"); // Styles if ( m_options.GetOptions() & AS_GNU ) m_pgPropPreDefinedStyles->SetValue("GNU"); else if ( m_options.GetOptions() & AS_JAVA ) m_pgPropPreDefinedStyles->SetValue("Java"); else if ( m_options.GetOptions() & AS_KR ) m_pgPropPreDefinedStyles->SetValue("K&R"); else if ( m_options.GetOptions() & AS_LINUX ) m_pgPropPreDefinedStyles->SetValue("Linux"); else if ( m_options.GetOptions() & AS_ANSI ) m_pgPropPreDefinedStyles->SetValue("ANSI"); m_textCtrlPreview->SetLexer(wxSTC_LEX_CPP); LexerConf::Ptr_t lexer = EditorConfigST::Get()->GetLexer("C++"); if ( lexer ) { lexer->Apply( m_textCtrlPreview, true ); } m_textCtrlPreview->SetViewWhiteSpace( wxSTC_WS_VISIBLEALWAYS ); // Select the proper engine m_pgPropEngine->SetValueFromInt( (int) m_options.GetEngine() ); //------------------------------------------------------------------ // Clang options //------------------------------------------------------------------ m_pgPropClangFormatExePath->SetValue( m_options.GetClangFormatExe() ); if ( m_options.GetClangFormatOptions() & kClangFormatChromium ) { m_pgPropClangFormatStyle->SetValueFromInt( kClangFormatChromium, wxPG_FULL_VALUE ); } else if ( m_options.GetClangFormatOptions() & kClangFormatMozilla ) { m_pgPropClangFormatStyle->SetValueFromInt( kClangFormatMozilla, wxPG_FULL_VALUE ); } else if ( m_options.GetClangFormatOptions() & kClangFormatWebKit ) { m_pgPropClangFormatStyle->SetValueFromInt( kClangFormatWebKit, wxPG_FULL_VALUE ); } else if ( m_options.GetClangFormatOptions() & kClangFormatGoogle ) { m_pgPropClangFormatStyle->SetValueFromInt( kClangFormatGoogle, wxPG_FULL_VALUE ); } else if ( m_options.GetClangFormatOptions() & kClangFormatLLVM ) { m_pgPropClangFormatStyle->SetValueFromInt( kClangFormatLLVM, wxPG_FULL_VALUE ); } m_pgPropClangFormattingOptions->SetValue( (int)m_options.GetClangFormatOptions() ); m_pgPropClangBraceBreakStyle->SetValue( (int) m_options.GetClangBreakBeforeBrace() ); m_pgPropColumnLimit->SetValue( (int)m_options.GetClangColumnLimit() ); }
DockerOutputPane::DockerOutputPane(wxWindow* parent, clDockerDriver::Ptr_t driver) : DockerOutputPaneBase(parent) , m_driver(driver) { m_stc->SetReadOnly(true); LexerConf::Ptr_t lexer = ColoursAndFontsManager::Get().GetLexer("text"); lexer->Apply(m_stc); EventNotifier::Get()->Bind(wxEVT_WORKSPACE_CLOSED, &DockerOutputPane::OnWorkspaceClosed, this); m_styler.reset(new clGenericSTCStyler(m_stc)); { wxArrayString words; words.Add("successfully"); m_styler->AddStyle(words, clGenericSTCStyler::kInfo); } { wxArrayString words; words.Add("abort "); words.Add("Error response from daemon"); m_styler->AddStyle(words, clGenericSTCStyler::kError); } { wxArrayString words; words.Add("SECURITY WARNING"); m_styler->AddStyle(words, clGenericSTCStyler::kWarning); } BitmapLoader* bmps = clGetManager()->GetStdIcons(); // ===------------------------- // Output tab // ===------------------------- m_toolbar->AddTool(wxID_CLEAR, _("Clear"), clGetManager()->GetStdIcons()->LoadBitmap("clear")); m_toolbar->Realize(); m_toolbar->Bind(wxEVT_TOOL, [&](wxCommandEvent& e) { wxUnusedVar(e); Clear(); }, wxID_CLEAR); m_toolbar->Bind(wxEVT_UPDATE_UI, [&](wxUpdateUIEvent& e) { e.Enable(!m_stc->IsEmpty()); }, wxID_CLEAR); // ===------------------------- // Containers toolbar // ===------------------------- m_toolbarContainers->AddTool(wxID_REFRESH, _("Refresh"), bmps->LoadBitmap("debugger_restart")); m_toolbarContainers->AddSeparator(); m_toolbarContainers->AddTool(wxID_CLOSE_ALL, _("Remove all containers"), bmps->LoadBitmap("clean")); m_toolbarContainers->Realize(); m_toolbarContainers->Bind(wxEVT_TOOL, &DockerOutputPane::OnKillAllContainers, this, wxID_CLOSE_ALL); m_toolbarContainers->Bind(wxEVT_UPDATE_UI, &DockerOutputPane::OnKillAllContainersUI, this, wxID_CLOSE_ALL); m_toolbarContainers->Bind(wxEVT_TOOL, &DockerOutputPane::OnRefreshContainersView, this, wxID_REFRESH); // ===------------------------- // Images toolbar // ===------------------------- m_toolbarImages->AddTool(XRCID("refresh_images"), _("Refresh"), bmps->LoadBitmap("debugger_restart")); m_toolbarImages->AddTool(XRCID("remove_unused_images"), _("Remove unused images"), bmps->LoadBitmap("clean"), "", wxITEM_DROPDOWN); m_toolbarImages->Realize(); m_toolbarImages->Bind(wxEVT_TOOL, &DockerOutputPane::OnRefreshImagesView, this, XRCID("refresh_images")); m_toolbarImages->Bind(wxEVT_TOOL, &DockerOutputPane::OnClearUnusedImages, this, XRCID("remove_unused_images")); m_toolbarImages->Bind(wxEVT_UPDATE_UI, &DockerOutputPane::OnClearUnusedImagesUI, this, XRCID("remove_unused_images")); m_toolbarImages->Bind(wxEVT_TOOL_DROPDOWN, &DockerOutputPane::OnClearUnusedImagesMenu, this, XRCID("remove_unused_images")); m_notebook->Bind(wxEVT_BOOK_PAGE_CHANGED, [&](wxBookCtrlEvent& event) { wxString selectedPage = m_notebook->GetPageText(m_notebook->GetSelection()); if(selectedPage == _("Containers")) { m_driver->ListContainers(); } else if(selectedPage == _("Images")) { m_driver->ListImages(); } }); }