Page 1 of 1

DisabledBackColor or Style method missing

Posted: Tue Jun 07, 2011 8:50 pm
by l3whmg
Hello everyone.
I'm doing some tests and I realized that, in case you want to use a different background color (see DISABLEDBACKCOLOR) for disabled fields (see ENABLED := ...), you must: first, set the parameter of background color and then the state of enabled/disabled.
This is and will be a rule or is it a mistake?

The problem is due to the fact that the background colors are applied when you enable or disable the field (take a look to control.prg, ENABLED method).

My opinion is that there are, and will be, other cases, but I think it is better to establish a rule rather than complicate the code. Team: what do you think about it?

This code work fine

Code: Select all

WITH OBJECT TextBox():New()
...
:DisabledBackColor := { 153, 255, 153}
:Enabled := .F.
...
END WITH
This code fails

Code: Select all

WITH OBJECT TextBox():New()
...
:Enabled := .F.
:DisabledBackColor := { 153, 255, 153}
...
END WITH
Best regards

Re: DisabledBackColor or Style method missing

Posted: Wed Jun 08, 2011 4:22 pm
by concentra
Hi Luigi !
l3whmg wrote:Hello everyone.
I'm doing some tests and I realized that, in case you want to use a different background color (see DISABLEDBACKCOLOR) for disabled fields (see ENABLED := ...), you must: first, set the parameter of background color and then the state of enabled/disabled.
This is and will be a rule or is it a mistake?

The problem is due to the fact that the background colors are applied when you enable or disable the field (take a look to control.prg, ENABLED method).

My opinion is that there are, and will be, other cases, but I think it is better to establish a rule rather than complicate the code. Team: what do you think about it?

This code work fine

Code: Select all

WITH OBJECT TextBox():New()
...
:DisabledBackColor := { 153, 255, 153}
:Enabled := .F.
...
END WITH
This code fails

Code: Select all

WITH OBJECT TextBox():New()
...
:Enabled := .F.
:DisabledBackColor := { 153, 255, 153}
...
END WITH
Best regards
The problem seems to be with the DisabledBackColor method since it does nothing with the QT object itself.
DisabledBackColor method must be fixed in order to the apply the new colors when its called.
DisabledFontColor too...