I'm adding my custom commands to a custom command bar and custom handling them (IUIX_CmdHandler).
I need to set the state of the item (enabled/disabled) to be the same as one of the existing commands, let's call it "enableAs".
My idea was to handle the OnGetItemState method and read the state of the "enableAs", so something like:
Code: Select all
enabledAs : IUIX_Cmd;
...
enabledAs := InstUI.CmdManager.Cmds.Find('cmd.close'); //so "hijacking" cmd.close to gets its state
enabledAs.Handler.OnGetItemState(enabledAs, nil, pOwner, cmdItemState);
... // fails on the above line / no bar displayed and weird stuff like that
nState := cmdItemState;
In short: I want to get the state of the "cmd.close" command (as example) and set its state for my custom command's state. How?
-žarko