/** * Set style */ void FbEditor::setStyle(TokenStyle style, std::string color, bool bold, bool italic, std::string bgcolor) { StyleSetForeground((int)style, wxColour(color)); StyleSetFontAttr((int)style, 16, "Consolas", bold, italic, false); if (bgcolor != "") { StyleSetBackground((int)style, wxColour(bgcolor)); StyleSetEOLFilled((int)style, true); } }
void Doc_Stc::SetStyle (int style, const StyleInfo & data) { StyleSetForeground (style, data.GetFG()); StyleSetBackground (style, data.GetBG()); StyleSetFontAttr ( style, data.GetSize(), data.GetFont(), data.IsBold(), data.IsItalic(), data.IsUnderlined() ); }
void MaterialScriptEditor::initialize() { //StyleClearAll(); SetLexer(wxSCI_LEX_OMS); // Load keywords wxString path = wxT("../lexers/oms/keywords"); loadKeywords(path); // Load call tips path = wxT("../lexers/oms/calltips"); getCallTipManager().load(path); wxChar trigger(' '); getCallTipManager().addTrigger(trigger); // Load docs path = wxT("../lexers/oms/docs"); getDocManager().load(path); // Set styles StyleSetForeground(wxSCI_OMS_DEFAULT, wxColour(0, 0, 0)); StyleSetFontAttr(wxSCI_OMS_DEFAULT, 10, "Courier New", false, false, false); StyleSetForeground(wxSCI_OMS_COMMENT, wxColour(0, 128, 0)); StyleSetFontAttr(wxSCI_OMS_COMMENT, 10, "Courier New", false, false, false); StyleSetForeground(wxSCI_OMS_PRIMARY, wxColour(0, 0, 255)); StyleSetFontAttr(wxSCI_OMS_PRIMARY, 10, "Courier New", true, false, false); StyleSetForeground(wxSCI_OMS_ATTRIBUTE, wxColour(136, 0, 0)); StyleSetFontAttr(wxSCI_OMS_ATTRIBUTE, 10, "Courier New", true, false, false); StyleSetForeground(wxSCI_OMS_VALUE, wxColour(160, 0, 160)); StyleSetFontAttr(wxSCI_OMS_VALUE, 10, "Courier New", false, false, false); StyleSetForeground(wxSCI_OMS_NUMBER, wxColour(0, 0, 128)); StyleSetFontAttr(wxSCI_OMS_NUMBER, 10, "Courier New", false, false, false); }
void GLSLEditor::initialize() { StyleClearAll(); SetLexer(wxSCI_LEX_CPP); // Load keywords wxString path = wxT("../lexers/glsl/keywords"); loadKeywords(path); // Load call tips path = wxT("../lexers/glsl/calltips"); getCallTipManager().load(path); wxChar trigger('('); getCallTipManager().addTrigger(trigger); // Set styles StyleSetForeground(wxSCI_C_COMMENT, wxColour(0, 128, 0)); StyleSetFontAttr(wxSCI_C_COMMENT, 10, "Courier New", false, false, false); StyleSetForeground(wxSCI_C_COMMENTLINE, wxColour(0, 128, 0)); StyleSetFontAttr(wxSCI_C_COMMENTLINE, 10, "Courier New", false, false, false); StyleSetForeground(wxSCI_C_NUMBER, wxColour(0, 0, 128)); StyleSetFontAttr(wxSCI_C_NUMBER, 10, "Courier New", false, false, false); StyleSetForeground(wxSCI_C_STRING, wxColour(200, 200, 200)); StyleSetFontAttr(wxSCI_C_STRING, 10, "Courier New", false, false, false); StyleSetForeground(wxSCI_C_WORD, wxColour(0, 0, 255)); StyleSetFontAttr(wxSCI_C_WORD, 10, "Courier New", false, false, false); StyleSetForeground(wxSCI_C_WORD2, wxColour(136, 0, 0)); StyleSetFontAttr(wxSCI_C_WORD2, 10, "Courier New", false, false, false); }
/*---------------------------------------------------------------------------*/ void wxSQLEditorBase::SetTypeStyle(int type, bool bold, bool italic, bool underline, int lettercase, wxColour fore, wxColour back) { if (type < wxSTC_SQL_DEFAULT || type > wxSTC_SQL_QUOTEDIDENTIFIER) return; StyleSetFontAttr(type, m_FontSize, m_FontName, bold, italic, underline); if (fore != wxNullColour) StyleSetForeground(type, fore); if (back != wxNullColour) StyleSetBackground(type, back); StyleSetBold(type, bold); // true / false StyleSetItalic(type, italic); StyleSetUnderline(type, underline); // wxSTC_CASE_MIXED wxSTC_CASE_UPPER wxSTC_CASE_LOWER (0 1 2) if (lettercase < 0 || lettercase > 2) lettercase = 0; StyleSetCase(type, lettercase); }
void HLSLEditor::initialize() { StyleClearAll(); SetLexer(wxSCI_LEX_OMS); // Load keywords std::string path = "res/lexers/hlsl/keywords"; loadKeywords(path); // Set styles StyleSetForeground(wxSCI_OMS_DEFAULT, wxColour(0, 0, 0)); StyleSetFontAttr(wxSCI_OMS_DEFAULT, 10, wxT("Courier New"), false, false, false); StyleSetForeground(wxSCI_OMS_COMMENT, wxColour(0, 128, 0)); StyleSetFontAttr(wxSCI_OMS_COMMENT, 10, wxT("Courier New"), false, false, false); StyleSetForeground(wxSCI_OMS_PRIMARY, wxColour(0, 0, 255)); StyleSetFontAttr(wxSCI_OMS_PRIMARY, 10, wxT("Courier New"), true, false, false); StyleSetForeground(wxSCI_OMS_ATTRIBUTE, wxColour(136, 0, 0)); StyleSetFontAttr(wxSCI_OMS_ATTRIBUTE, 10, wxT("Courier New"), true, false, false); StyleSetForeground(wxSCI_OMS_VALUE, wxColour(160, 0, 160)); StyleSetFontAttr(wxSCI_OMS_VALUE, 10, wxT("Courier New"), false, false, false); StyleSetForeground(wxSCI_OMS_NUMBER, wxColour(0, 0, 128)); StyleSetFontAttr(wxSCI_OMS_NUMBER, 10, wxT("Courier New"), false, false, false); }