FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GET AND ENTER
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
GET AND ENTER
Posted: Sun Jul 31, 2011 11:36 AM
Hello.

I have a Get with an Action. I would like to execute the action when the user press Enter too.

Is it possible?.

Thanks

Code (fw): Select all Collapse
  @ 2, 295 GET cGet of oDlg  SIZE 140, 10 ;
       ACTION msgalert("hello")  PIXEL  UPDATE
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 55
Joined: Fri Jul 08, 2011 06:43 AM
Re: GET AND ENTER
Posted: Sun Jul 31, 2011 06:25 PM

Uwe,

Some years ago we had BTNGET from Manuel Mercado , but the last two (?) years the get class has also this possibilty; See Fivewin.ch , REDEFINE GET :

         [ ACTION <uAction> ] ;

Frank

Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET AND ENTER
Posted: Sun Jul 31, 2011 07:12 PM

Thank you.

I already use Action clause, which creates a button inside the get. It works perfect.

What I want is that when enter is pressed, it also runs action.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET AND ENTER
Posted: Sun Jul 31, 2011 09:02 PM
Try something like this:

Code (fw): Select all Collapse
oGet:bKeyDown = { | nKey | If( nKey = VK_RETURN, msgalert("hello"), ) }


EMG
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET AND ENTER
Posted: Sun Jul 31, 2011 11:19 PM
It does not work fine.

I have to press twice on Enter to get value.

Code (fw): Select all Collapse
#include "fivewin.ch"

FUNCTION MAIN()

LOCAL oDlg
LOCAL oGet1 , cGet1 := SPACE(10)
LOCAL oGet2 , cGet2 := SPACE(10)

DEFINE DIALOG oDlg


@ 2 , 1 GET oGet2 VAR cGet2


       oGet2:bKeyDown = { | nKey | If( nKey == VK_RETURN,  MSGALERT(CGET2)  ,) }



ACTIVATE DIALOG oDlg CENTERED

RETURN NIL
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: GET AND ENTER
Posted: Mon Aug 01, 2011 08:35 AM
Code (fw): Select all Collapse
oGet2:bKeyDown = { | nKey | If( nKey == VK_RETURN,  ( oGet2:Assign(), MSGALERT(CGET2) ), ) }


EMG
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: GET AND ENTER
Posted: Mon Aug 01, 2011 08:48 AM

Thank you.

It works perfect now.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 10
Joined: Tue Feb 10, 2015 09:11 PM
Re: GET AND ENTER
Posted: Wed Mar 04, 2015 02:40 PM

Antonio

How to use btnget with a resource file ?

REDEFINE BTNGET aoObjetos[9] VAR cReken PICTURE "99999" MESSAGE "Boekhoudrekening" ID 109 OF oDlg ;
RESOURCE "FW_BOEKHOUDPLAN" ACTION ( BrwBoekhoudplan(), aoObjetos[9]:SetFocus(), oDlg:Update() ) ;
VALID Rek_num(cReken) .or. Eval ( { || cReken := Rek_num( cReken), cNaam := Boekhoudplan->naam,.T. } )
aoObjetos[9]:cToolTip := "Standaard boekhoudrekening"

Compling the app. failed. Btnget.ch is included in the prg.

Best regards.

Bart

Continue the discussion