Page 1 of 1

GoScintilla bespoke colours for commands

Posted: Tue May 05, 2020 11:01 pm
by IdeasVacuum
So, playing with the example included in the GoScintilla Module -which is brilliant in that 90% of the work, and the confusion, is taken out straightaway.

I'm trying to apply default colours for commands. Currently I'm working on CNC G-Code which has two command sets. I'd like to give them seperate colours. So I tried this: different style index for each:

Code: Select all

GoScintilla::SetStyleFont(1, #STYLES_COMMANDS_G, "", -1, #PB_Font_HighQuality)
GoScintilla::SetStyleFont(1, #STYLES_COMMANDS_M, "", -1, #PB_Font_HighQuality)
GoScintilla::SetStyleColors(1, #STYLES_COMMANDS_G, RGB(200,010,000))
GoScintilla::SetStyleColors(1, #STYLES_COMMANDS_M, RGB(000,000,200))
GoScintilla::AddKeywords(1, "G90.1 G91 G91.1 G92 G92.1 G92.2 G92.3 G94 G95 G96 G97 G98 G99", #STYLES_COMMANDS_G) ;just an extract of the full list
GoScintilla::AddKeywords(1, "M00 M01 M02 M03 M04 M05 M06 M07 M08 M09 M17 M29 M30 M97 M98 M99", #STYLES_COMMANDS_M)
[/size]

.... but it fails.
#STYLES_COMMANDS_G works OK, commands shown in red.
#STYLES_COMMANDS_M should be blue, but is shown in black (no other colour works).

So what is the secret? I have another, similar project where the commands are bespoke and there are several type groups, each of which want to be a different colour....... :shock:

Re: GoScintilla bespoke colours for commands

Posted: Tue May 05, 2020 11:53 pm
by IdeasVacuum
...Got it: Constants. The Enumeration for Styles cannot start above 250.