Disable controls in folders

Disable controls in folders

Postby DonDrew » Sun Oct 09, 2011 12:27 am

I'm unable to disable any of the controls in my folders.


I create the control in the usual way:

REDEFINE GET oPC_InvDate VAR dPC_InvDate ID 2101 of oFld:aDialogs[PCashFldr]


Added: oPC_InvDate:lUpdate=.t.
oFld:lUpdate=.t.

Then attempt to disable the get control:

oPC_InvDate:Disable()
oFld:Update()

It doesn't work. What am I missing?

Don
DonDrew
 
Posts: 63
Joined: Mon Aug 02, 2010 5:38 pm

Re: Disable controls in folders

Postby Bayron » Sun Oct 09, 2011 3:02 am

Maybe trying with:

Code: Select all  Expand view
oFld:aDialogs[PCashFldr]:Refresh()
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Disable controls in folders

Postby DonDrew » Sun Oct 09, 2011 9:11 am

Thank you. Unfortunately that didn't change anything.

I can't toggle ANY of the folder controls - listboxes, comboboxes, gets - nothing.

Don
DonDrew
 
Posts: 63
Joined: Mon Aug 02, 2010 5:38 pm

Re: Disable controls in folders

Postby Enrico Maria Giordano » Sun Oct 09, 2011 11:03 am

Can you build a reduced and self-contained sample (compilable and runnable) that can I test here? I used to have no problem in disabling folder controls.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Disable controls in folders

Postby kok joek hoa » Sun Oct 09, 2011 11:48 am

Dear Dondrew

Try :

REDEFINE GET oPC_InvDate VAR dPC_InvDate ID 2101 of oFld:aDialogs[PCashFldr] update


when disable control ,do :

ofld:setoption[PCashFldr]
oPC_InvDate:Disable()
oFld:aDialogs[PCashFldr]:refresh()

or

ofld:setoption[PCashFldr]
oPC_InvDate:Disable()
oFld:Update()


Regards,

Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: Disable controls in folders

Postby DonDrew » Sun Oct 09, 2011 1:06 pm

Thanks all for your responses. I think I just found my problem.

Each control has a "when" statement associated with it. Every time the folder is updated the control is enabled/disabled as controlled by the "when" statement. I should have seen that before. Sometimes it's impossible to see the forest through the trees. :oops:

What I need to do is modify the when condition to enable the control only if it has not been disabled by another process. How can I check the status of a specific control?

Don
DonDrew
 
Posts: 63
Joined: Mon Aug 02, 2010 5:38 pm

Re: Disable controls in folders

Postby ukoenig » Sun Oct 09, 2011 1:43 pm

Don,
a Sample-Test-button to Disable / Enable a Combobox
MsgAlert( IsWindowEnabled( oCombo:hWnd )

Code: Select all  Expand view

@ 50, 120 BTNBMP oBtn1 OF oFld1:aDialogs[2] ;
SIZE 65, 35 PIXEL 2007 ;
NOBORDER ;
PROMPT "Fld-control" + CRLF + "&Disable" + CRLF + "Enable" ;
FILENAME c_path + "\Images\Select.Bmp" ;
ACTION ( IIF( IsWindowEnabled( oCombo:hWnd ), ;
          oCombo:Disable(), oCombo:Enable() ), ;
          MsgAlert( IsWindowEnabled( oCombo:hWnd ), "Enabled / Disabled" ) ) ;
FONT oFont[1] ;
LEFT
oBtn1:lTransparent := .t.  
oBtn1:cToolTip =  { "Enable / Disable" + CRLF + "Controls","Enable / Disable", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 0, )
 


Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests