When creating a dynamic menu-item and assigning an accelerator to the item, it seems that the menu would show the accelerator keys as a part of the label.
e.g.
create menu-item v_Handle assign
parent = p_Parent
label = 'Menu'
accelerator = 'Ctrl-M'
The menu would show "MenuCtrl+M". Is there a way to remove the Ctrl+M from the label?
When creating a dynamic menu-item and assigning an accelerator to the item, it seems that the menu would show the accelerator keys as a part of the label.
e.g.
create menu-item v_Handle assign
parent = p_Parent
label = 'Menu'
accelerator = 'Ctrl-M'
The menu would show "MenuCtrl+M". Is there a way to remove the Ctrl+M from the label?
Flag this post as spam/abuse.
Yep, have tried this to no avail.
I can fix it by commenting out the accelerator = 'Ctrl-M' part but then it would lose the shortcut as well
What you try to achieve? You want to have accelerator but not to be visible?
Also provide OE and OS info, please!
Currently the accelerator appears as a part of the menu label for some reason, e.g. if the menu name is called 'Customers' and I have Ctrl+C as the accelerator, it's showing up as 'CustomerCtrl+C'.
I want it to hide the accelerator from the label but still be able to use the accelerator shortcut. I'm using OE10.1B and Windows 8.1.
Thanks!
And what about static menu item with accelerator? Does it looks the same way?
And one more question - do you create dynamic menu items once per window lifetime(on window initialization), or they are recreated depending on some user actions?
A dumb question, but how do I define an accelerator key for a static main menu? It seems to be greyed out but is available for static sub menus:
As for the sub menus, they do show the accelerator keys but that's fine because there is more space to show them, but I just don't want them to appear on the main menus.
And yes we only need to define them once upon loading but the menus are positioned/labelled differently based on different parameters so we can't define them using static menus unfortunately.
What you are calling the sub menu is actually the menu item. Accelerator keys are for menu items and not for menus/sub menus.
If you had something like this
File -> New -> Word Doc
File -> New -> Excel
You can add accelerators for Word Doc and Excel but not for File or New.
In your example,you can define accelerators for Exit, Cut, Copy and Paste menu items using Key... button.
if you create dynamic menu items once upon loading, you can define anywhere triggers for the containing window for accelerator keyboard events next way:
create menu-item v_Handle assign parent = p_Parent label = 'Customer' /* accelerator = "Ctrl-C" */ triggers: on 'choose':U persistent run customer-proc in this-procedure. end triggers. on 'Ctrl-C' of {&window-name} anywhere persistent run customer-proc in this-procedure.
Thanks for that! The only thing is that the accelerator is actually a variable that changes based on a parameter (users can set their own accelerators).
So how do I call something like
v-shortcut = 'Ctrl-C'.
on v-shortcut
of
{&window-name}
anywhere
persistent
run
customer-proc
in
this-procedure
.
using accepted syntax?
AFAIK you can't.
I give up for now.
But I'm still interested what about static menu item accelerators?