DisabledBackColor or Style method missing

Moderator: Rathinagiri

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

DisabledBackColor or Style method missing

Post 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
Luigi from Italy
www.L3W.it
User avatar
concentra
Posts: 256
Joined: Fri Nov 26, 2010 11:31 am
Location: Piracicaba - Brasil

Re: DisabledBackColor or Style method missing

Post 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...
[[]] Mauricio Ventura Faria
Post Reply