One property missing in laptop, why?
Posted
#1
(In Topic #1303)
Regular

Both run Xubuntu 18. In PC is all right. In laptop strangelly the property TextEditor.Styles[ selection (2) ] is not available.
The property value 2 there turns CurrentLine, which is actulally 3 in PC.
Results of this: In the laptop, I can not customize the selection color (broken component?) and all properties are shifted the value "1 less".
If I dump TextEditor.Style, it jumps Selection property in laptop:
Code
On PC: ON laptop:
---------------------------------------------------
Normal = 0 Normal = 0
Background = 1 Background = 1
Selection = 2 Currentline = 2
Currentline = 3 Breakpoint = 3
Breakpoint = 4Any ideas why and how to fix?
Posted
Guru

Laptop has a newer version.
Highlight.Selection is now depreciated and no longer a settable property.
Try is a good way to handle it…
Code (gambas)
then it works on older gambas and fails without an error on newer versions.
Or just do not use it.
Read this reply from Benoit… Re: TextEditor themes, Selection and IDE Background
Posted
Regular

Benoit: The TextEditor checks its background color to see if it is light or dark, and normally adapts the selection background color so that it is still visible.
Still visible but <COLOR color="#0000FF">no longer customizable</COLOR>. Older version became better than the new one.
This <COLOR color="#BF0040">brought another inconvenient</COLOR>: as the Styles list<COLOR color="#0000BF"> has changed the number and order of indexes</COLOR>!! String is 16 in one project and 15 in other
They could stop implementing the selection, but WHY TO REMOVE the array item changing order and length of an important object ???
If the white background uses <COLOR color="#0000FF">blue</COLOR> selection I think that dark themes should (as inversion) use something towards yellow, not the same as white background.
Posted
Regular

Posted
Guru

Due to the new nature of gb.highlight that can use many custom state names the Styles constants are kinda obsoleted.
Instead of Style constants we use the theme state keywords.
so not
TextEditor1.Style[Highlight.Background].Color
Now it's…
TextEditor1.Theme["Background"].Color
you can list the available State names with TextHighlighter[sName].States something like this…
Code (gambas)
Yeah I wasn't too keen on loosing Selection property but hey ho,
For the most part gb.highlight and the custom theme ability is a big improvement to the old method of a few hard coded highlight themes.
Posted
Guru

sergioabreu said
How do I copy the older version to Laptop ?
Haha , DON'T DO IT!!!!
Upgrade the code to the new way and upgrade the older gambas
1 guest and 0 members have just viewed this.


