wxStyledTextCtrl syntax highlighting IDs

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
daninz
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Feb 27, 2014 11:16 am

wxStyledTextCtrl syntax highlighting IDs

Post 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?
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxStyledTextCtrl syntax highlighting IDs

Post 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.
Use the source, Luke!
daninz
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Feb 27, 2014 11:16 am

Re: wxStyledTextCtrl syntax highlighting IDs

Post 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.
sirjuddington
In need of some credit
In need of some credit
Posts: 5
Joined: Fri May 29, 2009 7:38 am

Re: wxStyledTextCtrl syntax highlighting IDs

Post by sirjuddington »

http://docs.wxwidgets.org/3.0.0/stc_8h.html

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