ON CHANGE's GET method update BUTTON

Post Reply
User avatar
fusion
Posts: 17
Joined: Wed Apr 15, 2009 5:41 pm
Location: Cali, Colombia, Sur america
Contact:

ON CHANGE's GET method update BUTTON

Post by fusion »

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
Marcelo Via Giglio
Posts: 1033
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: ON CHANGE's GET method update BUTTON

Post by Marcelo Via Giglio »

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

Re: ON CHANGE's GET method update BUTTON

Post by fusion »

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
Marcelo Via Giglio
Posts: 1033
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: ON CHANGE's GET method update BUTTON

Post by Marcelo Via Giglio »

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

Re: ON CHANGE's GET method update BUTTON

Post by fusion »

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
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Re: ON CHANGE's GET method update BUTTON

Post by Detlef Hoefner »

Jair,

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

Code: Select all

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

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

Re: ON CHANGE's GET method update BUTTON

Post by Davide »

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

Code: Select all

@ 74,180 GET oGet1 VAR cId PIXEL 
@ 85,180 GET oGet2 VAR cPassword PASSWORD PIXEL ON CHANGE (oGet1:SetFocus(),oGet2:SetFocus())
Hi,
Davide
Post Reply