activate Toolbar Button with Code ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

activate Toolbar Button with Code ?

Post 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
have fun
Jimmy
User avatar
dragancesu
Posts: 920
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: activate Toolbar Button with Code ?

Post by dragancesu »

ON KEY control+r ACTION ReRead( nGridFocus )
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: activate Toolbar Button with Code ?

Post 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:
have fun
Jimmy
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: activate Toolbar Button with Code ?

Post by Rathinagiri »

Why can't you call the function ReRead( ) wherever required in the code?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: activate Toolbar Button with Code ?

Post 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
have fun
Jimmy
Post Reply