1
votes

With Delphi XE5 I am converting a TMainMenu to a TActionMainMenuBar but I am having issues with a submenu node within a category being disabled at runtime, for example in my 'File' category. Most 'File' category items are actions dragged over from the Action Manager, but I also want to group two of those actions under a submenu node within the File menu. With TMainMenu I would simply use Create submenu and edit the resulting TMenuItem caption, but I see that the TActionMainMenuBar has context items for each client item, and this is what I've tried to use. The result is that the layout looks ok but the submenu item is disabled at runtime (presumably because it does not have an action).

This is what I see at design time - I've created the 'Batch Reporting' item myself using 'Add item' in the object inspector.

This is what I see at design time - I've created 'Batch Reporting' myself..

This is what I see at run time, the item is disabled.

enter image description here

This is what I see in the object inspector with my context items included.

enter image description here

Should I be setting a special property on the 'Batch Reporting' item to give it a 'no action' status? Or am I forced to use an action with a 'do nothing' OnExecute?

1
In Delphi XE3 I couldn't even see the items added through the Structure pane's Add item popup menu item (so totally wrong). When I've added items through the Items collection editor in the Object Inspector, the items were visible and those having subitems were enabled even without assigned actions (worked as expected). Delphi version might be important here...TLama
@TLama: Thanks, I've noted that I'm using XE5.Brian Frost

1 Answers

2
votes

I've found the answer - I was using the 'Context Items' of the submenu, I should have been using 'Items' as shown below. Very confusing!

enter image description here