Inserting menu items in a descendent menu

Modifying the ShiftToRight property

When defining a descendent menu, you might want to insert menu items in the middle of the menu bar or in the middle of a drop-down or cascading menu. To do this, you set the ShiftToRight property in a menu item’s Properties view on the General properties page.

If the ancestor menu has no menu items with ShiftToRight set, you can add a new menu item to the end of the descendent menu. To add new menu items elsewhere in the menu, set the ShiftToRight property for the descendent menu items that will follow the new menu item.

The ShiftToRight property is used for menu items on the menu bar (where items need to shift right if a new item is inserted) and for menu items in a drop-down or cascading menu (where items might need to shift down if a new item is inserted). The property name is ShiftToRight, but in drop-down or cascading menus, it means shift down.

Where you can insert menu items in a descendent menu

In a descendent menu, a group of menu items can be one of four types. Each type has an insertion rule.

Table 13-3: Insertion rules for groups of menu items

Type of group

Insertion rule

Inherited menu items without ShiftToRight set

You cannot insert a new menu item before any of these menu items

Inherited menu items with ShiftToRight set in ancestor

You can insert before the first menu item in the group but not before the others

New items without ShiftToRight set

You can insert a new menu item before any of these menu items

New items with ShiftToRight set

You can insert a new menu item before any of these menu items

Where you set the ShiftToRight property

You set the ShiftToRight property in an ancestor menu only if you know that you will always want a group of menu items to shift right (or down) when you inherit from the menu and add a new menu item. For example, if you have New, Edit, and Tools menus on the menu bar, set the ShiftToRight property for the Tools menu items if you are going to inherit from this menu, because Tools is usually the last item on a menu bar.

How to insert menu items in a descendent menu

If you can insert a menu item in a descendent menu, the Insert Menu Item option on the Insert menu and the pop-up menu is enabled. The Insert Menu Item is enabled if ShiftToRight is set in the selected item before which you are inserting, and in all menu items following it.

To insert a menu item in a descendant, you use the same method you use to insert an item in a new menu, whether the menu item is on the menu bar or on a drop-down or cascading menu. For information about inserting menu items, see “Working with menu items”.