[Gambas-user] Need help with TextEditor

Rolf-Werner Eilert rwe-sse at osnanet.de
Wed Sep 15 12:01:25 CEST 2021


The TextEditor is nice - but I would need it in Custom mode for some of 
my own files.

 From the example in the help I cannot see how to do that. Just to give 
you a hint what I need, here is a simple example of one of these files:

This is text {b1}this is bold{b0} bold is off.
Longer: {v§ if instr +Field1 [one] [write] else [this]}

where everything in {} should be highlighted in blue and the strings in 
[] should be highlighted in green.

There is one exception: Normally all {} are in one line only, there is 
merely one command {T... which can spread over several lines until the } 
comes.

Now when I come into

Public Sub TextEditor1_Highlight(Text As String)

I understand I get the whole line in Text. Now will I have to make a 
loop and look into each character and pick it with string.mid()  and 
then TextHighlighter.Add TextHighlighter.State etc.?

Or is there a way to just define {} for blue and [] for green?

Is there an example for Custom mode somewhere?

Thank you for your help!

Regards
Rolf



More information about the User mailing list