[Gambas-user] Need help with TextEditor
Rolf-Werner Eilert
rwe-sse at osnanet.de
Thu Sep 16 17:39:45 CEST 2021
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
Am 15.09.21 um 12:46 schrieb Bruce Steers:
>
>
> On Wed, 15 Sept 2021 at 11:31, Bruce Steers <bsteers4 at gmail.com
> <mailto:bsteers4 at gmail.com>> wrote:
>
> You need to study the gb.eval.highlight component.
> http://gambaswiki.org/wiki/comp/gb.eval.highlight
> <http://gambaswiki.org/wiki/comp/gb.eval.highlight>
>
> You can see how it's used in gambas syntax highlighting by studying
> the TextEditorMode_Style classes in the gb.form.editor component
> https://gitlab.com/gambas/gambas/-/tree/master/comp/src/gb.form.editor/.src
> <https://gitlab.com/gambas/gambas/-/tree/master/comp/src/gb.form.editor/.src>
>
>
>
> Oops sorry not the Mode files the highlight files found here in
> gb.eval.highlight....
> https://gitlab.com/gambas/gambas/-/tree/master/comp/src/gb.eval.highlight/.src
> <https://gitlab.com/gambas/gambas/-/tree/master/comp/src/gb.eval.highlight/.src>
>
>
> The code you are looking for as you run through the line characters is
> something like this...
>
>
> If sChar = "{" Or If sChar = "}" Then |TextHighlighter.Add(Highlight.Operator, 1)|
>
>
> Like i say though i didn't start from the ground up with what I did so
> i'm not sure how to properly initiate the highlighting routine
>
> BruceS
>
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
More information about the User
mailing list