I have a Get with an Action. I would like to execute the action when the user press Enter too.
Is it possible?.
Thanks
@ 2, 295 GET cGet of oDlg SIZE 140, 10 ;
ACTION msgalert("hello") PIXEL UPDATE @ 2, 295 GET cGet of oDlg SIZE 140, 10 ;
ACTION msgalert("hello") PIXEL UPDATEUwe,
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
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.
oGet:bKeyDown = { | nKey | If( nKey = VK_RETURN, msgalert("hello"), ) }#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 NILoGet2:bKeyDown = { | nKey | If( nKey == VK_RETURN, ( oGet2:Assign(), MSGALERT(CGET2) ), ) }Thank you.
It works perfect now.
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