Push Button behaviour is different for Action Event

Push Button behaviour is different for Action Event

Postby shri_fwh » Mon Dec 06, 2010 6:04 am

Hi,

I have a Dialog window having some GET controls and Buttons.
A Button ACTION clause calls a procedure to save data after that Setfocus method (of GET class) is calling.

Please see below code for more info.

@10,10 button oBtn size 40,30 caption "Save" ACTION ( SaveData() , oGet:Setfocus() ) of oDlg


When user click or press SPACE BAR on the Button the ACTION event is working fine, but when user press ENTER Key on the button,
the SaveData() procedure is calling but focus control is not moving into oGet control (by calling oGet:Setfocus() method).
If user press ENTER Key on the Button should perform as same as SPACE BAR pressing.
How can achieve if user PRESS ENTER Key . Please guide me for the same.

Thanks in advance... !

Thanks
Shridhar
FWH 9.11
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: Push Button behaviour is different for Action Event

Postby Daniel Garcia-Gil » Mon Dec 06, 2010 10:28 am

Shridhar

the windows and dialog process the messages the different way
to use in dialog

Code: Select all  Expand view
#define WM_NEXTDLGCTL                   0x0028


and change

Code: Select all  Expand view
@10,10 button oBtn size 40,30 caption "Save" ACTION ( SaveData() , oDlg:PostMsg( WM_NEXTDLGCTL, oGet:hWnd, 1 ) ) of oDlg
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Push Button behaviour is different for Action Event

Postby shri_fwh » Mon Dec 06, 2010 10:51 am

Thanks Daniel for your kind support....!

Just another Question , will it work with SPACE bar and click as well ?

thanks
Shridhar
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: Push Button behaviour is different for Action Event

Postby shri_fwh » Sun Oct 28, 2012 5:26 am

Hi Daniel ,

Very long back I raised the query about Push Button different behavior when user press ENTER KEY for DIALOG window. The solution that you provided to me it works fine for DIALOG Window but IT DOES NOT WORK WINDOW MDICHILD . Could you please guide me. if anybody has solution please reply/post for the same. Thanks in advance...!

Code: Select all  Expand view

  // The below code does not work for MDICHILD Window
    @10,10 button oBtn size 40,30 caption "Save" ACTION ( SaveData() , oDlg:PostMsg( WM_NEXTDLGCTL, oGet:hWnd, 1 ) ) of oDlg
 
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: Push Button behaviour is different for Action Event

Postby kok joek hoa » Sun Oct 28, 2012 9:22 am

Dear shri_fwh,

Try :


@10,10 button oBtn size 40,30 caption "Save" ACTION ( SaveData() , obtn:ojump:= oGet , oGet:Setfocus() , oGet:refresh() ) of oDlg

regards,

Kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: Push Button behaviour is different for Action Event

Postby shri_fwh » Sun Oct 28, 2012 10:48 am

Hi Kok

Thanks...! Its working :D

Thanks
Shridhar
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nelido, Otto and 70 guests