1

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?

4

1 回答 1

2

我找到了答案 - 我正在使用子菜单的“上下文项目”,我应该一直使用“项目”,如下所示。非常混乱!

在此处输入图像描述

于 2014-05-07T10:53:01.537 回答