Brian Frost
Brian Frost

Reputation: 13454

Delphi TActionMainenuBar - 2nd-level submenu menu item is disabled

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?

Upvotes: 1

Views: 1559

Answers (1)

Brian Frost
Brian Frost

Reputation: 13454

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

Upvotes: 2

Related Questions