Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I'm working on MFC based code editor. The part on which I'm stuck is when i need to add color to keywords, bassicaly nothing happens. SCE_C_WORD should be setting it up (I also found SCE_C_WORD2, but also nothing happens).
void ScintillaCtrl::SetUpEditor()
SendEditor(SCI_SETKEYWORDS, NULL, reinterpret_cast<LPARAM>(ini.GetKeywords()));
SetAStyle(SCE_C_COMMENT, ini.GetColor(_T("comment")));
SetAStyle(SCE_C_COMMENTLINE, ini.GetColor(_T("comment")));
SetAStyle(SCE_C_COMMENTDOC, ini.GetColor(_T("comment")));
SetAStyle(SCE_C_NUMBER, ini.GetColor(_T("number")));
SetAStyle(SCE_C_STRING, ini.GetColor(_T("string")));
SetAStyle(SCE_C_CHARACTER, ini.GetColor(_T("string")));
SetAStyle(SCE_C_UUID, ini.GetColor(_T("uuid")));
SetAStyle(SCE_C_OPERATOR, ini.GetColor(_T("operators")));
SetAStyle(SCE_C_PREPROCESSOR, ini.GetColor(_T("preprocessor")));
SetAStyle(SCE_C_WORD, ini.GetColor(_T("keywords")));
//SetAStyle(SCE_C_WORD2, ini.GetColor(_T("keywords")));
This is method where I'm setting up editor for language (reading colors from ini files). I already checked and color is written in ini file and all other colors work (comments, operators, etc).
Edit: Code for tab width, lexer, etc...
void ScintillaCtrl::LoadDefaultState()
SendEditor(SCI_SETLEXER, SCLEX_NULL);
SendEditor(SCI_SETTABWIDTH,4);
SetAStyle(STYLE_DEFAULT, RGB(0, 0, 0), RGB(255, 255, 255), 10, "Arial");
SendEditor(SCI_SETCARETFORE, RGB(0, 0, 0));
SendEditor(SCI_STYLECLEARALL, NULL);
SendEditor(SCI_SETSELBACK, TRUE, ini.GetColor(_T("selection")));
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.