GoScintilla bespoke colours for commands

Windows specific forum
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

GoScintilla bespoke colours for commands

Post 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:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: GoScintilla bespoke colours for commands

Post by IdeasVacuum »

...Got it: Constants. The Enumeration for Styles cannot start above 250.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply