ON CHANGE's GET method update BUTTON

ON CHANGE's GET method update BUTTON

Postby fusion » Thu Apr 30, 2009 3: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
User avatar
fusion
 
Posts: 17
Joined: Wed Apr 15, 2009 5:41 pm
Location: Cali, Colombia, Sur america

Re: ON CHANGE's GET method update BUTTON

Postby Marcelo Via Giglio » Thu Apr 30, 2009 3: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...
Marcelo Via Giglio
 
Posts: 1050
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: ON CHANGE's GET method update BUTTON

Postby fusion » Thu Apr 30, 2009 4: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
User avatar
fusion
 
Posts: 17
Joined: Wed Apr 15, 2009 5:41 pm
Location: Cali, Colombia, Sur america

Re: ON CHANGE's GET method update BUTTON

Postby Marcelo Via Giglio » Thu Apr 30, 2009 5: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
Marcelo Via Giglio
 
Posts: 1050
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: ON CHANGE's GET method update BUTTON

Postby fusion » Thu Apr 30, 2009 6: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
User avatar
fusion
 
Posts: 17
Joined: Wed Apr 15, 2009 5:41 pm
Location: Cali, Colombia, Sur america

Re: ON CHANGE's GET method update BUTTON

Postby Detlef Hoefner » Thu Apr 30, 2009 8:29 pm

Jair,

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

Code: Select all  Expand view

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

Maybe that works for you.

Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Re: ON CHANGE's GET method update BUTTON

Postby Davide » Fri May 01, 2009 2:42 pm

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

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

Hi,
Davide
Davide
 
Posts: 190
Joined: Tue Mar 14, 2006 1:59 am
Location: Italy

Re: ON CHANGE's GET method update BUTTON

Postby Daniel Garcia-Gil » Fri May 01, 2009 3:01 pm

User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 28 guests