Page 1 of 1

Gets not Greyed when WHEN is false

Posted: Wed Jan 04, 2006 11:58 am
by Dan Landon
I just noticed that GET clauses do not grey out when the WHEN clause is false. COMBOBOXes are greyed as expected. I'm pretty sure that this did work this way at one time.

For example:

@ 1, 1 GET oCalldate VAR cCallDate WHEN ( .F. ) OF oDlg

does not show the field greyed out.

Does anyone else see this issue?

I am using xBase ver 1.9 RC2.

Dan

Posted: Wed Jan 04, 2006 1:06 pm
by Antonio Linares
Dan,

We have modified it intentionatelly. Now you can set any color you want for disabled GETs. Simply do oGet:SetColor( ..., ... ).

Posted: Thu Jan 05, 2006 11:48 am
by Dan Landon
How do I set the greyed color? I don't generally do anything with colors so I don't know anything about colors.

Dan

Posted: Thu Jan 05, 2006 12:29 pm
by Antonio Linares
Dan,

If you use a WHEN clause to disable them, then you can do it from there:

Code: Select all

   ... GET oGet VAR ... WHEN ( lEnable := ValidCondition(), If( lEnable, oGet:SetColor( nColor1, nColor2 ), oGet:SetColor( nColor3, nColor4 ) ), lEnable )
If this makes your code more complex, we may look to implement a way to let colors default as with previous versions. Many users were requiring to change the color of disabled GETs as they are hardly visible.

Posted: Thu Jan 05, 2006 11:49 pm
by Dan Landon
Hello Antonio,

It does make the code a bit unreadable. What about a global setting that will set the colors of all disabled gets to specific colors? The user could override any get then for a unique purpose or even change the global setting for disabled gets to other colors. The gets could inherit the default setting when a dialog is activated and be changed when necessary for specific purposes for each get while the dialog is activated.

I really prefer the greyed out gets the way they were, but I do understand that some users would find them hard to read.

Dan

Posted: Mon Jan 09, 2006 7:40 am
by Antonio Linares
Dan,

We have implemented a new DATA in class TGet, named lDisColors, that it is .t. by default.

If lDisColors is .t. then the painting is standard as usual. If .f., then the GET colors are used.

You may review samples\TestGet2.prg to see how to use this new DATA. We email you the new libs and appreciate your feedback.

Posted: Tue Jan 10, 2006 10:59 pm
by Dan Landon
Hello Antonio,

This implementation was a good idea. Works just fine.

Thanks
Dan