TOPMENU section

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

Syntax

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

Attributes

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

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