activate BUTTON ACTION Codeblock via F2 - F9

activate BUTTON ACTION Codeblock via F2 - F9

Postby Jimmy » Tue May 02, 2023 3:38 pm

hi,

my BUTTON have a Caption which can be used as Hotkey using ALT + Key
now i like to use F2 - F9 to activate BUTTON

i can use o:bKeyDown Codeblock Slot to call a Functrion and use VK:* Key to identify

how to EVAL() ACTION Codeblock e.g. for VK_F2 :?:

Code: Select all  Expand view
   DEFINE BUTTONBAR oBar SIZE nPart, 48 BOTTOM OF oWnd

         DEFINE BUTTON OF oBar PROMPT "F2 &Filter" ;
                    GROUP BTNRIGHT ;
                    TOOLTIP "SET Filter" ;
                    NOBORDER RESOURCE "MYFILTER" ;
                    ACTION Filter( oBrwDBF )

   @  0,  2 XBROWSE oBrwDBF COLUMNS ColsNumber() ...
   ...
   oWnd:bKeyDown := { | nKey, nFlag | DoBrowseKey( nKey, nFlag, oWnd, oGet, oBar ) }

Code: Select all  Expand view
PROCEDURE DoBrowseKey( nKey, nFlag, oWnd, oGet, oBar )

   DO CASE
      CASE nKey = VK_ESCAPE
         oWnd:End()
      CASE nKey = VK_F2
         // how to EVAL() ACTION of F2 ?
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: activate BUTTON ACTION Codeblock via F2 - F9

Postby cnavarro » Tue May 02, 2023 4:11 pm

Try with
Code: Select all  Expand view


Eval( oBar:aControls[ 01 ]:bAction )
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: activate BUTTON ACTION Codeblock via F2 - F9

Postby Jimmy » Tue May 02, 2023 4:40 pm

hi,
cnavarro wrote:Try with
Code: Select all  Expand view
Eval( oBar:aControls[ 01 ]:bAction ) 

ah, yes
thx for Answer
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 109 guests