/* TextEditor::setup * Sets up text editor properties depending on cvars and the current * text styleset/style *******************************************************************/ void TextEditor::setup() { // General settings SetBufferedDraw(true); SetUseAntiAliasing(true); SetMouseDwellTime(500); AutoCompSetIgnoreCase(true); SetIndentationGuides(txed_indent_guides); StyleSetBackground(wxSTC_STYLE_INDENTGUIDE, WXCOL(col_edge_line)); // Right margin line SetEdgeColour(WXCOL(col_edge_line)); SetEdgeColumn(txed_edge_column); if (txed_edge_column == 0) SetEdgeMode(wxSTC_EDGE_NONE); else SetEdgeMode(wxSTC_EDGE_LINE); // Apply default style StyleSet::applyCurrent(this); CallTipUseStyle(10); StyleSetChangeable(wxSTC_STYLE_CALLTIP, true); wxFont font_ct(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); StyleSetFont(wxSTC_STYLE_CALLTIP, font_ct); CallTipSetForegroundHighlight(WXCOL(StyleSet::currentSet()->getStyle("calltip_hl")->getForeground())); // Set lexer if (txed_syntax_hilight) SetLexer(wxSTC_LEX_CPPNOCASE); else SetLexer(wxSTC_LEX_NULL); // Re-colour text Colourise(0, GetTextLength()); }
/* TextEditor::setup * Sets up text editor properties depending on cvars and the current * text styleset/style *******************************************************************/ void TextEditor::setup() { // General settings SetBufferedDraw(true); SetUseAntiAliasing(true); SetMouseDwellTime(500); AutoCompSetIgnoreCase(true); SetIndentationGuides(txed_indent_guides); // Right margin line SetEdgeColumn(txed_edge_column); if (txed_edge_column == 0) SetEdgeMode(wxSTC_EDGE_NONE); else SetEdgeMode(wxSTC_EDGE_LINE); // Apply default style StyleSet::applyCurrent(this); CallTipUseStyle(10); StyleSetChangeable(wxSTC_STYLE_CALLTIP, true); wxFont font_ct(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); StyleSetFont(wxSTC_STYLE_CALLTIP, font_ct); CallTipSetForegroundHighlight(WXCOL(StyleSet::currentSet()->getStyle("calltip_hl")->getForeground())); // Set folding options setupFolding(); // Re-colour text Colourise(0, GetTextLength()); // Set word wrapping if (txed_word_wrap) SetWrapMode(wxSTC_WRAP_WORD); else SetWrapMode(wxSTC_WRAP_NONE); // Set word match indicator style SetIndicatorCurrent(8); IndicatorSetStyle(8, wxSTC_INDIC_ROUNDBOX); IndicatorSetUnder(8, true); IndicatorSetOutlineAlpha(8, 60); IndicatorSetAlpha(8, 40); }