Page 1 of 1

activate Toolbar Button with Code ?

Posted: Sun May 24, 2020 4:42 am
by AUGE_OHR
hi,

i have a Toolbat Button

Code: Select all

      DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 50, 50 FLAT BORDER

         BUTTON MYRELOAD ;
                 TOOLTIP 'reload Crtl-R' ;
                 PICTURE "MYRELOAD" ;
                 ACTION ReRead( nGridFocus )
is it possible to "activate" Action ReRead() "from other Thread" :idea:

p.s. can´t call ReRead() direct from Thread while it "produce dupe in GRID..."

---

i saw some Code like this

Code: Select all

            SendMessage( nHFrame, 273 /*WM_COMMAND*/, 3026 /*IDT_VIEW_FIT_WIDTH*/, 0 )
         OTHERWISE
            PostMessage( nHFrame, 273 /*WM_COMMAND*/, 457 /*IDM_ZOOM_CUSTOM*/, 0 )
those IDT_ or IDM_ are Button from Toolbar.

under Xbase++ i can use

Code: Select all

   PostAppEvent(xbeTBAR_ButtonClick, oMYRELOAD, , oToolBar_1 )
need some help to "translate" Xbase++ Technique to HMG

Re: activate Toolbar Button with Code ?

Posted: Sun May 24, 2020 7:19 am
by dragancesu
ON KEY control+r ACTION ReRead( nGridFocus )

Re: activate Toolbar Button with Code ?

Posted: Sun May 24, 2020 7:36 am
by AUGE_OHR
hi,
dragancesu wrote: Sun May 24, 2020 7:19 am ON KEY control+r ACTION ReRead( nGridFocus )
this i have and it work fine.

but how to "send" control+r from Thread to Main ... hm ... :idea:

Re: activate Toolbar Button with Code ?

Posted: Tue May 26, 2020 9:31 am
by Rathinagiri
Why can't you call the function ReRead( ) wherever required in the code?

Re: activate Toolbar Button with Code ?

Posted: Wed May 27, 2020 12:01 am
by AUGE_OHR
hi,
Rathinagiri wrote: Tue May 26, 2020 9:31 am Why can't you call the function ReRead( ) wherever required in the code?
sorry it was just a try while i got a Error but that was other Reason

dragancesu gave me right direction when want to "send key"

Code: Select all

   HMG_PressKey( VK_CONTROL, VK_R )
it is not going to Toolbar Button like under Xbase++
it is going to my ON KEY which is in Window