I have a unit with a lot of actions, some actions have shortcuts and some have even the same shortcut. This is because they belong to different modules in applications and they are not in context at the same time.
Now I have a global nonmodal dialog (called objectinspector) that can be started anytime anywhere. It have some actions with shortcuts that are the same as other places in the modules.
So I want to temporary override those actions that share equal shortcuts when objectinspector is active and release it when deactivated.
I have this code in the objectinspectors OnActivate event:
ClientActions.RegisterAction(ClientActions.actObjectInspectorNewWindow, ShowNewObject);
- ClientActions is the unit that contains the actions.
- RegisterAction is a method that connect the event with the action.
- actObjectInspectorNewWindow is the actual action.
- ShowNewObject is the event that should be called when action is executed.
So for every module and modalless dialog there is a couple of actions that is registred by the above method. The problem come when 2 actions share the same shortcut. It seems that the actions that first is registred win and is executed when user press the shortcut. I prefered that the last action that register an action with that shortcut is executed.
How can this be done ?
Regards