FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Toggle a GET as readonly/not readonly
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Toggle a GET as readonly/not readonly
Posted: Wed Jan 03, 2007 07:31 PM

How can I make my program do the following:

(I understand the 'WHEN' is not available)

REDEFINE CHECKBOX oDbf:IsGift ID 4015 OF oDlg UPDATE
REDEFINE GET oDBF:GiftFrom ID 4033 OF oDlg UPDATE WHEN oDBF:ISGIFT=.T.

i.e. I want the oDBF:GiftFfrom field to be "READONLY" when oDBF:IsGift is FALSE and
oDBF:GiftFfrom field to be "MODIFY-ABLE" when oDBF:IsGift is TRUE

Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Toggle a GET as readonly/not readonly
Posted: Wed Jan 03, 2007 08:15 PM

Try:

REDEFINE CHECKBOX oDbf:IsGift ID 4015 OF oDlg UPDATE;
ON CHANGE (if(oDBF:isGift, oGet:lReadonly:=.f., oGet:lReadOnly:=.t.), oGet:refresh())

REDEFINE GET oGet oDBF:GiftFrom ID 4033 OF oDlg UPDATE

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Toggle a GET as readonly/not readonly
Posted: Wed Jan 03, 2007 08:26 PM

That makes it READONLY, but is there a way I can (more visably) 'gray' it out (The way it looks when you use the NO MODIFY clause in a GET define.)

Do you know what I mean?

Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Toggle a GET as readonly/not readonly
Posted: Wed Jan 03, 2007 08:36 PM

oGet:disable(), oGet:enable()

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Toggle a GET as readonly/not readonly
Posted: Wed Jan 03, 2007 08:47 PM
Or

REDEFINE CHECKBOX oDbf:IsGift ID 4015 OF oDlg UPDATE;
         ON CHANGE oDlg:AEvalWhen()

REDEFINE GET oDBF:GiftFrom ID 4033 OF oDlg UPDATE WHEN oDBF:ISGIFT


EMG
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Toggle a GET as readonly/not readonly
Posted: Wed Jan 03, 2007 08:49 PM
That's what I was looking for - thanks.

I notice, however, that these fields look different:

REDEFINE GET oDBF:TEST1 ID 4030 OF oFld:aDialogs[ 1 ] UPDATE NO MODIFY

(has a gray background)

REDEFINE GET oGET VAR oDBF:TEST2 ID 4030 OF oFld:aDialogs[ 1 ] UPDATE
oGET:disable()


(has a white background)

How do I match them to look the same - the latter of the two looks better I think.
Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Toggle a GET as readonly/not readonly
Posted: Wed Jan 03, 2007 08:51 PM
REDEFINE GET oDBF:TEST1 ID 4030 OF oFld:aDialogs[ 1 ] UPDATE WHEN .F.


EMG
Posts: 233
Joined: Sat Dec 30, 2006 06:10 AM
Toggle a GET as readonly/not readonly
Posted: Wed Jan 03, 2007 09:04 PM

Nice!!!! Thanks.

Many thanks

Ollie.



Using:

xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)

Borland C++ 5.5.1

FWH 9.04 (2009 Apr)

Continue the discussion