Discussion:
Questions on colourising the background
Andreas Tscharner
2013-10-09 20:24:36 UTC
Permalink
Hello World,

I have written a lexer for DMIS, a "programming language" for measuring
machines. A DMIS program can have different sections for different
measuring machines. These sections are normally run in parallel.
To visualize these sections I want a different background colour for
each section.

My questions:
1) How can I colourise the background for different sections differently
without changing the other styles for keywords, strings, etc.?
2) How can I colourise the background completely, e.g. the whole line
and not only that part where the text is?

TIA and best regards
Andreas
--
Andreas Tscharner ***@gmail.com
------------------------------------------------------------------------
Der entscheidende Vorteil eines Chats gegenueber einem normalen Telefon-
anruf ist der, dass ersterer langsamer geht und mehr kostet (fuer den
lebenswichtigen Austausch von Informationen wie "hya folks", "C U
l8er" und ":-)") ... Aus Murphy's Computergesetzen
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-10-09 22:07:12 UTC
Permalink
I have written a lexer for DMIS, a "programming language" for measuring machines. A DMIS program can have different sections for different measuring machines. These sections are normally run in parallel.
To visualize these sections I want a different background colour for each section.
You could define a style for each language style for each section so #languageStyles * #sections styles. Only around 256 styles are possible so that will limit the number of sections.
1) How can I colourise the background for different sections differently without changing the other styles for keywords, strings, etc.?
While you could use indicators, they aren't really designed for this case. There will be limitations and there may also be performance issues. The best indicator to use here would be INDIC_STRAIGHTBOX with SCI_INDICSETUNDER(indicator,1) although there will be a blank between lines.

It would be reasonable to add an INDIC_FILL to fill the whole line height that could be used along with SCI_INDICSETUNDER to change the background colour of ranges.
2) How can I colourise the background completely, e.g. the whole line and not only that part where the text is?
For normal styles, SCI_SETEOLFILLED(style, 1). Not possible for indicators.

Its complex to add a fill to line end attribute to indicators as the indicator code is spread amongst a few locations and the current line end code for selections (which can behave similarly) also has multiple cases.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...