TOPMENU section

The TOPMENU section defines a pull-down menu with options that are bound to actions.

Syntax

TOPMENU [topmenu-identifier] [ ( topmenu-attribute [,...] ) ]
  group
  [...]
END
  1. topmenu-identifier defines the name of the top menu (optional).
  2. topmenu-attribute can be: STYLE, TAG.
where topmenu-group is:
GROUP group-identifier [ ( group-attribute [,...] ) ]
  { command
  | group
  | separator
  } [...]
END
  1. group-identifier defines the name of the group, it is mandatory.
  2. group-attribute is one of: STYLE, TEXT, IMAGE, COMMENT, TAG, HIDDEN.
where command is:
COMMAND command-identifier [ ( command-attribute [,...] ) ]
  1. command-identifier defines the name of the action to bind to, it is mandatory.
  2. command-attribute is one of: STYLE, TEXT, IMAGE, COMMENT, TAG, HIDDEN, ACCELERATOR.
and separator is:
SEPARATOR [separator-identifier] [ ( separator-attribute [,...] ) ]
  1. separator-identifier defines the name of the separator (optional).
  2. separator-attribute is one of: STYLE, TAG, HIDDEN.

Form attributes

ACCELERATOR, COMMENT, HIDDEN, IMAGE, STYLE, TEXT, TAG.

Style attributes

Common: backgroundColor, border, fontFamily, fontSize, fontStyle, fontWeight, localAccelerators, showAcceleratorInToolTip, textColor, textDecoration.

Class-specific: none.

Usage

The TOPMENU section is used to define a pull-down menu in a form.

The TOPMENU section must appear in the sequence described in form file structure.

The TOPMENU section is optional.

In a TOPMENU section, you build a tree of GROUP elements to design the pull-down menu. A GROUP can contain COMMAND, SEPARATOR or GROUP children. A COMMAND defines a pull-down menu option that triggers an action when it is selected. In the topmenu specification, command-identifier defines which action a menu option is bound to. For example, if you define a topmenu option as "COMMAND zoom", it can be controlled by an "ON ACTION zoom" clause in an interactive instruction.

The topmenu commands are enabled depending on the actions defined by the current interactive instruction. For example, you can define a topmenu option with the action name "cancel" to bind the pull-down item to this predefined dialog action.

An accelerator name can be defined for a topmenu command; this accelerator name will be used for display in the command item. You must define the same accelerator in the action defaults section for the action name of the topmenu command.

TOPMENU elements can get a STYLE attribute in order to use a specific rendering/decoration based on presentation style definitions.

Example

TOPMENU tm ( STYLE="mystyle" )
  GROUP form (TEXT="Form")
    COMMAND help (TEXT="Help", IMAGE="quest")
    COMMAND quit (TEXT="Quit")
  END
  GROUP edit (TEXT="Edit")
    COMMAND accept (TEXT="Validate", IMAGE="ok", TAG="acceptMenu")
    COMMAND cancel (TEXT="Cancel", IMAGE="cancel")
    SEPARATOR
    COMMAND editcut   -- Gets its decoration from action defaults 
    COMMAND editcopy  -- Gets its decoration from action defaults 
    COMMAND editpaste -- Gets its decoration from action defaults 
  END
  GROUP records (TEXT="Records")
    COMMAND append (TEXT="Add", IMAGE="plus")
    COMMAND delete (TEXT="Remove", IMAGE="minus")
    COMMAND update (TEXT="Modify", IMAGE="accept")
    SEPARATOR (TAG="lastSeparator")
    COMMAND search (TEXT="Search", IMAGE="find")
  END
END