C
Claes Bergefall
Appearantly a ContextMenu doesn't fire its Popup event
when invoking a menu item with a shortcut.
This kind of makes the Popup event useless for enabling
or disabling menu items (if you're using shortcuts)!?
Example:
Suppose you have two menu items in a context menu
and that they have the keyboard shortcuts F2 and F3.
Using the popup event you now enable or disable
the menu items according to some set of rules each time
the menu is shown (as recommended by the documentation).
Let's say that the menu item with shortcut F2 became
disabled. Now, pressing F2 has no effect anymore since it's
disabled. And since the popup event isn't fired we have
no way of telling the system that it should be enabled
again! Only way to enable it again is by physically
showing the context menu.
On a regular menu (MainMenu) this problem doesn't exist
since you always have a visible top menu item (e.g. File or Edit)
that will fire the popup event for you when you press a
shortcut key (unless you have disabled the top menu item)
I would like to enable/disable a menu item when the user
tries to invoke it (or showing the context menu) just like
you do on the main menu.
Any ideas on how to handle this in a context menu?
/claes
when invoking a menu item with a shortcut.
This kind of makes the Popup event useless for enabling
or disabling menu items (if you're using shortcuts)!?
Example:
Suppose you have two menu items in a context menu
and that they have the keyboard shortcuts F2 and F3.
Using the popup event you now enable or disable
the menu items according to some set of rules each time
the menu is shown (as recommended by the documentation).
Let's say that the menu item with shortcut F2 became
disabled. Now, pressing F2 has no effect anymore since it's
disabled. And since the popup event isn't fired we have
no way of telling the system that it should be enabled
again! Only way to enable it again is by physically
showing the context menu.
On a regular menu (MainMenu) this problem doesn't exist
since you always have a visible top menu item (e.g. File or Edit)
that will fire the popup event for you when you press a
shortcut key (unless you have disabled the top menu item)
I would like to enable/disable a menu item when the user
tries to invoke it (or showing the context menu) just like
you do on the main menu.
Any ideas on how to handle this in a context menu?
/claes