How to: Add Items to the AOT Add-Ins Menu

The shortcut menu in the Application Object Tree (AOT) has an Add-ins menu where you can find various development tools such as the cross-reference system and the Visual MorphXplorer.

To add your own tool to the Add-ins submenu

  1. Create a menu item for the tool. For more information, see How to: Create Menus and Menu Items.

  2. Locate the item you want to add to the Menu Items node.

  3. Drag the menu item onto sysContextMenu in the Menus node.

All items in the sysContextMenu menu are automatically added to the Add-ins submenu. If you want to disable items according to the current context, you need to add to the verifyItem method for the SysContextMenu class.

verifyItem( identifiername MenuItemName , MenuItemType MenuItemType ) is automatically called for each item you add to the sysContextMenu menu. It takes the name of the menu item and the menu item type as parameters, and must return 0 (zero) if the item isn't available.


The following extract from verifyItem shows the testing performed when the parameter is the menu item MorphXplorer.

case menuItemDisplayStr(MorphXplorer):
    if (this.selectionCount() != 1 || 
        firstNode.AOTIsOld()  //Does not work for old nodes
        return 0;
    if (!docNode &&
         (_firstType==UtilElementType::Class ||
        return 1;
    return 0;

There are other classes called SysContextMenu*, for example, SysContextMenuCompare. These classes are used when there are several levels in the add-ins hierarchy. For example, when you activate Compare on two objects, the Add-ins submenu is also available in the Compare dialog. The first() and next() methods on sysContextMenuCompare define the proper context.

Community Additions