## stylesheet, backcolor, ecc. (changelog 639)

Moderator: Rathinagiri

l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

### stylesheet, backcolor, ecc. (changelog 639)

Hi friends
To manage the style of a widget (button, textbox, label, etc.) I have introduced a new data (cStyleSheet inside basic.prg) a new method (StyleSheet inside basic.prg) and a very, very simple function to update the style (StyleUpdater inside misc.prg).
The first benefit of this is to handle FontColor, BackColor, DisabledBackColor and DisabledFontColor. On the other hand, it's open a lot of possibility.
At this moment, I checked one problem without solution: about label it's impossibile to change the backcolor if it's already setup. It seem to be a QT library problem and (perhaps) can be solved in other way, but I don't want introduce it now.

About textbox (but can be apply to other controls) I noticed that there isn't command "DISABLED" but only "READONLY" (it's the same too in HMG3); so I have also added this syntax inside hmg.ch

At the same time I solved the problem about properties order in a textbox disabled. In the next scenario, HMG4 fails it's action because backcolor don't change

Code: Select all

WITH OBJECT textbox():New()
...
:Enabled := .F.
:DisabledBackColor := {x,y,z}
...
END WITH
To solve this problem I have modified textbox.prg inside create() function.
This change gives me the opportunity to reiterate that the "CREATE()" method is very useful (and we should keep it and use it) to set all those properties that are not handled directly by the QT objects.

Furthermore, I found that some variables were initialised to "NIL". I am referring to: aFontColor, aBackColor (inside basic.prg) and lEnabled (inside control.prg).
This has caused problems for me and for that I initialized the following values:
aFontColor := {0,0,0} , aBackColor := {255,255,255) , lEnabled := .T.

you can find some examples here: samples\button\demo_5.prg, samples\label\demo_6.prg, samples\textbox\demo_6.prg

Please, use /w3 compiler option to compile and check. I receive this error:
Warning W0001 Ambiguous reference 'OCURRENTWINDOW'
Many thanks to everyone

Best regards
Luigi from Italy
www.L3W.it