FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Push Button behaviour is different for Action Event
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Push Button behaviour is different for Action Event
Posted: Mon Dec 06, 2010 06: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 24.04, BCC 7 32 bit, MariaDB
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Push Button behaviour is different for Action Event
Posted: Mon Dec 06, 2010 10:28 AM
Shridhar

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

Code (fw): Select all Collapse
#define WM_NEXTDLGCTL                   0x0028


and change

Code (fw): Select all Collapse
@10,10 button oBtn size 40,30 caption "Save" ACTION ( SaveData() , oDlg:PostMsg( WM_NEXTDLGCTL, oGet:hWnd, 1 ) ) of oDlg
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Push Button behaviour is different for Action Event
Posted: 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 24.04, BCC 7 32 bit, MariaDB
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Push Button behaviour is different for Action Event
Posted: Sun Oct 28, 2012 05: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 (fw): Select all Collapse
  // 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 24.04, BCC 7 32 bit, MariaDB
Posts: 117
Joined: Tue Jan 03, 2006 06:18 PM
Re: Push Button behaviour is different for Action Event
Posted: Sun Oct 28, 2012 09: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

Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Push Button behaviour is different for Action Event
Posted: Sun Oct 28, 2012 10:48 AM

Hi Kok

Thanks...! Its working :D

Thanks
Shridhar

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB

Continue the discussion