Page 1 of 1

wxStyledTextCtrl syntax highlighting IDs

Posted: Thu Feb 27, 2014 11:20 am
by daninz
When you want to set the foreground colour for some language element you call

Code: Select all

void wxStyledTextCtrl::StyleSetForeground(int style, const wxColour);
setting style = 13 if you are targetting strings, 17 if targetting operators, etc, in case of the cpp lexer.

Where are the ids for those styles defined for each lexer?

Also, I have found by trial end error that if you want to style inactive CPP code (because disabled within a preprocessing block) you use the same style id as for active code, or-ed with 64. Where is that documented?

Re: wxStyledTextCtrl syntax highlighting IDs

Posted: Thu Feb 27, 2014 1:59 pm
by doublemax
Probably somewhere in the Scintilla documentation:
http://www.scintilla.org/ScintillaDoc.html

FWIW: I've never used this control myself because of its horrible documentation.

Re: wxStyledTextCtrl syntax highlighting IDs

Posted: Thu Feb 27, 2014 2:16 pm
by daninz
This is the kind of stupid answer I was dreading to get. So, you’ve never used this control
because of its horrible documentation
and yet you send me, who evidently use it, to the documentation. No wonder you have > 6000 posts. You make a lot of noise about subjects you know nothing about and help no one.

For all the others: I am talking about the IDs assigned to these styles by the wxWidgets code, which are totally independent of scintilla.

Re: wxStyledTextCtrl syntax highlighting IDs

Posted: Fri Feb 28, 2014 3:57 am
by sirjuddington
http://docs.wxwidgets.org/3.0.0/stc_8h.html

Look for wxSTC_C_*, if you're using the CPP lexer.