FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ON CHANGE's GET method update BUTTON
Posts: 17
Joined: Wed Apr 15, 2009 05:41 PM
ON CHANGE's GET method update BUTTON
Posted: Thu Apr 30, 2009 03:26 PM

Greetings,

I have this issue...
LOCA cId:= SPAC(10), cPassword:= SPAC(10)...

@ 74,180 GET cId PIXEL ON CHANGE oBtn:Refresh()
@ 85,180 GET cPassword PASSWORD PIXEL ON CHANGE oBtn:Refresh()
@ 102, 85 BUTTON oBtn PROMPT '&Start' WHEN ( !EMPTY( cId ) .AND. !EMPTY( cPassword ) ) ACTION ( ValidInfo( cId, cPassword ) )
...
happen that the button oBtn start disable because cId and cPassword are empties, but if I write in cId and start to write in cPassword, oBtn remain disable and I can't send the proper code to enable. I try with ( oBtn:Refresh(), .T. ), ( oDlg:Refresh(), .T. ), ( SysRefresh(), .T. ), etc... oBtn only updates to enable when cId or cPassword lost focus.

What code is proper in the ON CHANGE method to update state in the BUTTON..?

Thank you for your help...

Saludos / Greetings
Jair A. Linares
FWH 13.07/ Harbour 3.2.0 dev (r1306132159)/ Borland C++ 5.82 / UEStudio 9.20/ Help&Manual 5
jair.linares71@gmail.com
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Re: ON CHANGE's GET method update BUTTON
Posted: Thu Apr 30, 2009 03:37 PM
fusion wrote:Greetings,

I have this issue...
LOCA cId:= SPAC(10), cPassword:= SPAC(10)...

@ 74,180 GET cId PIXEL ON CHANGE oDlg:aEvalWhen()
@ 85,180 GET cPassword PASSWORD PIXEL ON CHANGE oDlg:aEvalWhen()
@ 102, 85 BUTTON oBtn PROMPT '&Start' WHEN ( !EMPTY( cId ) .AND. !EMPTY( cPassword ) ) ACTION ( ValidInfo( cId, cPassword ) )
...
happen that the button oBtn start disable because cId and cPassword are empties, but if I write in cId and start to write in cPassword, oBtn remain disable and I can't send the proper code to enable. I try with ( oBtn:Refresh(), .T. ), ( oDlg:Refresh(), .T. ), ( SysRefresh(), .T. ), etc... oBtn only updates to enable when cId or cPassword lost focus.

What code is proper in the ON CHANGE method to update state in the BUTTON..?

Thank you for your help...
Posts: 17
Joined: Wed Apr 15, 2009 05:41 PM
Re: ON CHANGE's GET method update BUTTON
Posted: Thu Apr 30, 2009 04:39 PM

thank you Marcelo for your response, but it doesn't work...

I try with...

ON CHANGE oDlg:aEvalWhen()
ON CHANGE ( oDlg:aEvalWhen() )
ON CHANGE ( oDlg:aEvalWhen(), .T. )
ON CHANGE ( oDlg:aEvalWhen(), SysRefresh() )
ON CHANGE ( oDlg:aEvalWhen(), oDlg:Refresh() )
ON CHANGE ( oDlg:aEvalWhen(), oBtn:Refresh() )
ON CHANGE ( oDlg:aEvalWhen(), oBtn:Refresh(), oDlg:Refresh() )
ON CHANGE ( oDlg:aEvalWhen(), oDlg:Refresh(), oBtn:Refresh() )

and the button remain disable with the cId and cPassword filled...

Saludos / Greetings
Jair A. Linares
FWH 13.07/ Harbour 3.2.0 dev (r1306132159)/ Borland C++ 5.82 / UEStudio 9.20/ Help&Manual 5
jair.linares71@gmail.com
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Re: ON CHANGE's GET method update BUTTON
Posted: Thu Apr 30, 2009 05:18 PM

Hi,

I don't sure but I can't see the container (dialog or win) of the get and button I think the ..... OF oDlg was missing in your code

regards

Marcelo

Posts: 17
Joined: Wed Apr 15, 2009 05:41 PM
Re: ON CHANGE's GET method update BUTTON
Posted: Thu Apr 30, 2009 06:37 PM

Thanks again Marcelo, but that's not the problem... (the container is oDlg..)

Review your comments I'm trying with...

@ 85,180 GET cPassword OF oDlg PIXEL PASSWORD ON CHANGE ( oBtn:aEvalWhen(), oDlg:aEvalWhen(), UpdateWindow(), MsgInfo( 'Testing' ) )

It works !, but if I get MsgInfo() off, doesn't work...

Another thing, it works after the second character....

Thanks again, and I will testing and hopeful for any suggestions...

Saludos / Greetings
Jair A. Linares
FWH 13.07/ Harbour 3.2.0 dev (r1306132159)/ Borland C++ 5.82 / UEStudio 9.20/ Help&Manual 5
jair.linares71@gmail.com
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Re: ON CHANGE's GET method update BUTTON
Posted: Thu Apr 30, 2009 08:29 PM
Jair,

i don't think that the ON CHANGE clause is the right event to watch.
Please try somethig like:

Code (fw): Select all Collapse
@ 85,180 GET cPassword OF oDlg PIXEL PASSWORD;
         VALID ( if ( empty( cPassword ), oBtn:Disable(), oBtn:Enable() ), .t. )

Maybe that works for you.

Regards,
Detlef
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
Re: ON CHANGE's GET method update BUTTON
Posted: Fri May 01, 2009 02:42 PM
Jair,
fusion wrote:It works !, but if I get MsgInfo() off, doesn't work...

please try this:
Code (fw): Select all Collapse
@ 74,180 GET oGet1 VAR cId PIXEL 
@ 85,180 GET oGet2 VAR cPassword PASSWORD PIXEL ON CHANGE (oGet1:SetFocus(),oGet2:SetFocus())

Hi,
Davide
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: ON CHANGE's GET method update BUTTON
Posted: Fri May 01, 2009 03:01 PM

Continue the discussion