Toggle a GET as readonly/not readonly

Toggle a GET as readonly/not readonly

Postby Ollie » Wed Jan 03, 2007 7: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby James Bott » Wed Jan 03, 2007 8: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Ollie » Wed Jan 03, 2007 8: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby James Bott » Wed Jan 03, 2007 8:36 pm

oGet:disable(), oGet:enable()
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Enrico Maria Giordano » Wed Jan 03, 2007 8:47 pm

Or

Code: Select all  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Ollie » Wed Jan 03, 2007 8: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby Enrico Maria Giordano » Wed Jan 03, 2007 8:51 pm

Code: Select all  Expand view
REDEFINE GET oDBF:TEST1 ID 4030 OF oFld:aDialogs[ 1 ] UPDATE WHEN .F.


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

Postby Ollie » Wed Jan 03, 2007 9: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)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 100 guests