Working with IMenu Parts

The following tasks are associated with using an IMenu* part in visual composition. Tasks that are common to many parts are described in related topics.

Defining a menu as a menu bar
To define a menu on the free-form surface as a menu bar for a frame window, connect the IMenu* this attribute to the IFrameWindow* menu attribute. The menu bar is implemented as an IMenuBar part in generated code. Leave room for the menu bar in the client area.

Defining a menu as a submenu
To define a menu on the free-form surface as a submenu for a cascade menu item in another menu, connect the IMenu* this attribute to the IMenuCascade* menu attribute. The menu is implemented as an ISubmenu part in generated code.

Defining a menu as a pop-up menu
To define a menu on the free-form surface as a pop-up menu for a control, connect the IMenu* this attribute to the control's menu attribute. The menu is implemented as an IPopUpMenu part in generated code.

Adding a submenu to a menu
To add a pull-down menu to a menu bar or a cascade menu to another menu, drop an IMenu* part on the target menu instead of on the free-form surface. The following happens automatically:

The new menu is implemented as an ISubmenu part in generated code.

Adding a menu item to a menu
To add a menu item to a menu, select an IMenuItem* part from the palette and drop it on the menu. If you have already added menu items, you can drop the new menu item within the list of existing menu items.

Adding a menu separator to a menu
To add a menu separator to a menu, select an IMenuSeparator* part from the palette and drop it between the menu items you want to separate.

Reordering menu items
To move the menu items within your menu, drag them within the IMenu* part.


Related procedures
Setting Part Style Properties
Setting Part Color Properties
Setting Part Font Properties
Setting Part Handlers Properties
Setting Part Framing Properties
Working with VisualAge User Interface Parts

Related references
IMenu
Property Settings -- IMenu
Portability -- IMenu