FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Disable controls in folders
Posts: 63
Joined: Mon Aug 02, 2010 05:38 PM
Disable controls in folders
Posted: 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

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Disable controls in folders
Posted: Sun Oct 09, 2011 03:02 AM
Maybe trying with:

Code (fw): Select all Collapse
 oFld:aDialogs[PCashFldr]:Refresh()

=====>

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

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 63
Joined: Mon Aug 02, 2010 05:38 PM
Re: Disable controls in folders
Posted: Sun Oct 09, 2011 09:11 AM

Thank you. Unfortunately that didn't change anything.

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

Don

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Disable controls in folders
Posted: 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

Posts: 117
Joined: Tue Jan 03, 2006 06:18 PM
Re: Disable controls in folders
Posted: 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

Posts: 63
Joined: Mon Aug 02, 2010 05:38 PM
Re: Disable controls in folders
Posted: Sun Oct 09, 2011 01: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

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Disable controls in folders
Posted: Sun Oct 09, 2011 01:43 PM
Don,
a Sample-Test-button to Disable / Enable a Combobox
MsgAlert( IsWindowEnabled( oCombo:hWnd )

Code (fw): Select all Collapse
@ 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 :-)
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.

Continue the discussion