Menu State

The MENU ADD statements provide for an ItemState& parameter. For popup menus, this may be either %MF_ENABLED or %MF_DISABLED. For menu items, the state may be one of %MF_ENABLED, %MF_DISABLED, %MF_CHECKED, %MF_UNCHECKED, %MF_GRAYED, or %MF_SEPARATOR.

These equates are included in the DDT.INC file, which is a subset of the WIN32API.INC file. A DDT application that requires the use of these equates would normally include a line such as #INCLUDE "DDT.INC". If your application requires the inclusion of the WIN32API.INC declaration file, you should omit the inclusion of DDT.INC.

A DDT menu requires the parent DDT dialog to contain at least one child control for the menu to operate correctly. This control may be a BUTTON or LABEL, etc, and the control may be located out of the visible client area of the dialog if necessary.

 

The Dessert Menu

In addition to creating menus dynamically, DDT provides a rich set of additional menu functions to allow you to manipulate your menus at run-time. The following is a brief summary of these functions:

MENU DELETE

Delete (remove) a menu item from a menu, or a popup menu from a menu bar.

MENU DRAW BAR

Redraw the menu bar for a given menu. This must be used if a menu is changed at run-time, regardless of whether the menu is visible or not.

MENU GET STATE

Obtain the current state of a menu item (%MF_ENABLED, etc). If the menu item is a separator, the returned value will be %MF_SEPARATOR.

MENU GET TEXT

Retrieve the text for a given menu item.

MENU SET STATE

Set the current state of a menu item.

MENU SET TEXT

Change the text of a specific menu item, and can be used to change the command accelerator of the item.

 

For a more comprehensive list of menu statements and functions, See the Command Summary for DDT.

 

See Also

Menus

Menu Walkthrough

More on the Menu

Menu Example