[Gambas-user] Need help with TextEditor

Rolf-Werner Eilert rwe-sse at osnanet.de
Fri Sep 17 16:28:56 CEST 2021


Am 16.09.21 um 19:09 schrieb Bruce Steers:
> 
> 
> On Thu, 16 Sept 2021 at 16:40, Rolf-Werner Eilert <rwe-sse at osnanet.de 
> <mailto:rwe-sse at osnanet.de>> wrote:
> 
>     Thank you for the links, Bruce. I browsed through several source files,
>     and think I understood the principle.
> 
>     What I miss is, how do I tell the highlighter which style is which
>     color?
> 
>     In the HTML code for instance there is
> 
>     Add(sQuote, Highlight.String)
> 
>     But where is a definition for the color for Highlight.String? I
>     remember
>     in the old editor, I had to define colors for these.
> 
>     If I get that to run, I guess I could do the rest by code. In my case
>     it's only two colors other than "Normal", one for "command" and one for
>     "string".
> 
>     Regards
>     Rolf
> 
> 
> You set the texts highlight style with Add()
> there are various highlight styles to choose from.
> al the constants listed on this page.
> http://gambaswiki.org/wiki/comp/gb.eval.highlight/highlight 
> <http://gambaswiki.org/wiki/comp/gb.eval.highlight/highlight>
> 
> by setting it's style you set whet colour it will be displayed as as per 
> the theme.
> 
> for example..
> TextEditor1.Styles[Highlight.Operator].Color = Color.Green
> BruceS
> 
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 


Ah ok, now I got it. It's still pretty much the same like in the old 
editor. I have to browse the characters line for line and do everything 
myself.

 From a first reading I'd thought I could define (somewhere) that for 
instance

everything in {} should be blue
everything in [] should be green

and the rest would be done automagically by the single call of some 
function.

Regards
Rolf


More information about the User mailing list