wxScintilla

BlitzMax Forums/Brucey's Modules/wxScintilla

Jake L.(Posted 2008) [#1]
Hi,

could anyone provide a short sample of how to do syntax highlighting with wxScintilla? I started with the scintilla sample and did SetLexerLanguage("blitzmax") and GetLexer shows that it recognized this (switched lexer-id to 66). But nothing (visible?) happened, so I must have missed something.


Ole JR(Posted 2008) [#2]
Add these lines to the end of OnInit() of the wxscintilla.bmx example (In the sample folder)
at line 200'ish, after SetBufferedDraw(1).
Then you should get some colors when you build/run..

'Lexer set to BlitzMax
SetLexerLanguage("blitzmax")

'Tell the lexer what keywords we want to highlight, remember ALWAYS lowercase..
SetKeyWords(0, "function method type end endtype endmethod endfunction")

'LexerKeywords we want Blue
StyleSetForeGround(wxSCI_B_KEYWORD, New wxColour.CreateNamedColour("BLUE"))

'The lexer dont understand single line BMax comments :(
'Not Rem/EndRem either...
'StyleSetForeGround(wxSCI_B_COMMENT, New wxColour.CreateNamedColour("RED"))

'Strings we want to be Green
StyleSetForeGround(wxSCI_B_STRING, New wxColour.CreateNamedColour("GREEN"))



Oh. And if you want case correction you have to do it on your own. Scintilla doesn't do/handle that kind of things..


Jake L.(Posted 2008) [#3]
Thank you very much, that should help!