开发者

Custom Lexer in wxscintilla

Hello guys can some body tell me how to implement a simple lexer in wxscintilla so that i can h开发者_C百科ighlight a simple word like "sbit" or any other specified word. Using the inbuilt highlight identifier would high light even non keyword words. I am using c++ wxWidgets. My code is like this

m_scintilla1->SetLexer(wxSCI_LEX_CPP);

m_scintilla1->StyleSetForeground (20, wxColour (_T("BLUE")));

m_scintilla1->SetKeyWords(20,_("sbit"));

the above code wont work. Any help.


m_scintilla1->SetKeyWords(20,_("sbit"));

The ID here must be 0 or 1. You have 2 Keyword-sets for every lexer, 0 and 1.

See a sample here, from my ShaderDesigner. I have setup a coloration for glsl (mis)using the cpp-lexer: http://code.google.com/p/nightlight2d/source/browse/trunk/NightShade/SourceEdit.cpp#30 HTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜