TOPMENU section

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


TOPMENU [topmenu-identifier] [ ( topmenu-attribute [,...] ) ]
  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
  | placeholder
  | group
  | separator
  } [...]
  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, AUTOHIDE.
and placeholder is:
  1. ACTIONS stands for action views to be rendered for all default action views shown in the action panel.
  2. PROGRAMS stands for the list of current programs displayed by the front-end.
  3. WINDOWS stands for the list of windows created by the current program.
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


Style attributes

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

Class-specific: none.


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. Topmenu commands can be automatically hidden when the corresponding action is disabled, by using the AUTOHIDE attribute for the command.

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 include AUTOCOMMANDS place holders, with a mandatory CONTENT attribute, to define if the auto-commands must show action views for the current actions not bound to an explicit action view (CONTENT=ACTIONS), to show the list of current running programs (CONTENT=PROGRAMS), or to show the list of opened windows of the current program (CONTENT=WINDOWS).

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


TOPMENU tm ( STYLE="mystyle" )
  GROUP form (TEXT="Form")
    COMMAND help (TEXT="Help", IMAGE="quest")
    COMMAND quit (TEXT="Quit")
  GROUP edit (TEXT="Edit")
    COMMAND accept (TEXT="Validate", IMAGE="ok", TAG="acceptMenu")
    COMMAND cancel (TEXT="Cancel", IMAGE="cancel")
  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")
  GROUP windows (TEXT="Windows")