How to disable GET Controls from an Edit ?

How to disable GET Controls from an Edit ?

Postby shri_fwh » Mon Oct 25, 2010 1:25 pm

Hi FWH Users,

I created a Dialog window and that having near about 30-35 Get controls. As one of my requirment is that all the GET Controls should allow to edit on the particular condition. if particular condition is true then User will be able to edit the data in the GET controls. As GET control's already have READONLY clause to prevent from the EDIT but if we do the GET controls display properties will changes (it's look very dirty than normal GET display ) and user can not enter. I do not want that , however the GET should control should display as it is normal and even cursor should allow to enter in the GET fields but user will not be able to do any changes in the GET field , if user tires then pop error message should display. Is there any property of Window that I can disable all GET controls at glance? I would differenciate between READONLY and DISABLE propertise is that READONLY will allow to the user to enter in GET fields but user can not change anything where as DISABLE will not allow to user to enter in the GET fields.

Thanks
Shridhar
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: How to disable GET Controls from an Edit ?

Postby Marcelo Via Giglio » Mon Oct 25, 2010 1:35 pm

Hola,

try this
Code: Select all  Expand view


AEVAL( oDlg:aControls, {|o| IF( o:CLASSNAME = "TGET", o:disable(), ) } )

 


regards

Marcelo
Marcelo Via Giglio
 
Posts: 1064
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: How to disable GET Controls from an Edit ?

Postby shri_fwh » Tue Oct 26, 2010 11:57 am

Hi,

Sorry for the delay in repsonse. I used below code to disable the all GETs inthe Dialog but the look of the GETs is not good. All GETs got dimmed with GRAY color. Is there any function that it should disable the GETS without changing their display propertise? The GETs should display as it is.

AEVAL( oDlg:aControls, {|o| IF( o:CLASSNAME = "TGET", o:disable(), ) } )
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: How to disable GET Controls from an Edit ?

Postby James Bott » Tue Oct 26, 2010 1:30 pm

>The GETs should display as it is.

It is standard Windows behavior for disabled controls to display grayed out. This gives a visual indication that the control cannot be changed. Everyone knows this. Changing from the standard will just confuse users--they will wonder why they can't get the cursor into the GET. I don't recommend it.

Changing the behavior of the GETs would require either subclassing the GET class or modifying the GET class source.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: How to disable GET Controls from an Edit ?

Postby Daniel Garcia-Gil » Tue Oct 26, 2010 5:31 pm

Shridhar

from version 8.12 (december 2008) we can use 2 new datas for TGet class nClrTextDis, nClrPaneDis to custom color in disable status

* New: Class TGet DATAs nClrTextDis, nClrPaneDis to allow the change of the colors of the get when it is disabled. Codeblocks are allowed too.


please check test: testget3.prg

http://rapidshare.com/files/177854316/DisGet.rar
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: How to disable GET Controls from an Edit ?

Postby James Bott » Tue Oct 26, 2010 6:31 pm

Daniel,

Well, I guess I was wrong. I didn't know about the new GET colors. Thanks for pointing that out.

If one were to change the colors, I would still recommend making the colors of a disabled GET different than those of an enabled GET so the user can see the difference.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: How to disable GET Controls from an Edit ?

Postby shri_fwh » Wed Oct 27, 2010 5:53 am

Hi ,

Thanks a lot to all of you for your kind support.,

As Daniel suggest, the two new Data variables in the GET class to change its color it will work. Thanks Daniel pointing that out. I will apply in my code and see how the GET will look.

Thanks a lot once again to Marcelo, Daniel, and James for sharing their valuable experience.
Shridhar
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 83 guests