SHORTCUT KEY for DIALOG BOX BUTTON . . .
2019-10-14-145328
All --
I am translating an IMAGE-PRO PLUS MACRO into an APP for IMAGE-PRO (10).
The customer is used to triggering one of their macro functions by pressing
CONTROL + T
and anther by pressing
F8
I see within the properties of a PUBLIC FUNCTION that is the result of a RECORD MACRO that I can set
SHORTCUT = CTRLT
to trigger the PUBLIC FUNCTION.
It seems that this PUBLIC FUNCTION must be a SIMPLE SCRIPT and that it cannot call another function.
Can you recommend a way that I can link a keyboard shortcut to a at GUI BUTTON or the function triggered by a GUI BUTTON?
Thanks.
-- Matt
0
Best Answer
-
Hi Matt,
No, you cannot use Hello.Shortcut = MediaCy.IQL.Application.mcScriptShortcut.CtrlT with any function as .Shortcut is a property of SimpleScript.
My example should work for anything, just be sure you put the code into "module.vb (not app). First try my function as it is, and if it works, try to modify for your needs.
Yuri
0
Answers
You can link any GUI button to a a script with calls to any sub or function, which could be executed by a keyboard shortcut.
Will it work for you?
Yuri
Hello.Shortcut = MediaCy.IQL.Application.mcScriptShortcut.CtrlT
I actually meant a different implementation:
and
So the button click and Ctrl-T will do the same action.
Yuri
One of the ways to handle that is by using events. You can create an object with events in the Module, assign to it in the app (WithEvents), then raise events in the loop of Hello function and update text box in the UpdateControls event handler of the app.
You can use WoundHealing app as an example (http://www.mediacy.com/support/imagepro/appcenter/wound-healing-application-detail): Search for UpdateControls event, which is raised from the Module and handled in the App.
Yuri