Form specification files / Form file structure |
The TOPMENU section defines a pull-down menu with options that are bound to actions.
TOPMENU [menu-identifier] ( menu-attribute [,...] ) group [...] END
GROUP group-identifier ( group-attribute [,...] ) { command | group | separator } [...] END
COMMAND command-identifier ( command-attribute [,...] )
SEPARATOR [separator-identifier] ( separator-attribute [,...] )
The TOPMENU section must appear in the sequence described in form file structure. The section is optional.
The TOPMENU section is provided to define a pull-down menu in a form. 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 according to 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 he 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 following presentation style definitions.
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