You can only use keywords lists that the lexer will actually assign. For the c++ lexer this is currently
Code: Select all
keyword list number corresponding style
------------- --- ---------------
Primary keywords and identifiers 0 wxSTC_C_WORD
Secondary keywords and identifiers 1 wxSTC_C_WORD2
Documentation comment keywords 2 wxSTC_C_COMMENTDOCKEYWORD
Global classes and typedefs 3 wxSTC_C_GLOBALCLASS
Preprocessor definitions 4 wxSTC_C_IDENTIFIER
So to use the "Secondary keywords and identifiers", you could do something like
Code: Select all
m_stc->SetKeyWords(1,"with yield");
m_stc->StyleSetForeground(wxSTC_C_WORD2,wxColour(255,0,128) );
m_stc->StyleSetWeight(wxSTC_C_WORD2,wxSTC_WEIGHT_BOLD);
This will give the keywords "with" and "yield" a reddish color and set them bold.
The wxSTC_C_COMMENTDOCKEYWORD is a special case. It will only apply in doxygen blocks (blocks enclosed in /** */ or single lines starting with ///) and only apply to keywords starting with @ or /. You can use the other 4 lists as you see fit.
If you try to assign keyword lists 5,6, or 7, nothing will happen because the lexer will not use those lists.