Adding a Topmenu
A topmenu presents a pull-down menu on a form, composed of actions defined by the current interactive BDL instruction in your program.
The same options that were displayed to the user as a toolbar can also be defined as buttons on a pull-down menu ( a topmenu). To change the presentation of the menu options to the user, simply modify and recompile the form specification file.

The TOPMENU section of the form specification allows you to design the pull-down
menu. The TOPMENU section must appear after SCHEMA,
and must contain a tree of GROUP elements that define the pull-down
menu. The GROUP TEXT value is the title for the pull-down menu
group.
A GROUP can contain the following elements:
- a
COMMAND- specifies the action the menu option must be bound to - a
SEPARATOR- a horizontal line GROUPchildren - a subgroup within a group.
Values can be assigned to attributes such as TEXT, COMMENT, and
IMAGE for each item in the TOPMENU.
As in a toolbar, the TOPMENU commands are enabled by actions defined by the
current interactive BDL instruction (dialog), which in our example is the
MENU statement in the custquery.4gl module.
When a TOPMENU option is selected by the user, the program triggers the
action to which the TOPMENU command is bound.
Example ( in custform.per)
The example shows a TOPMENU section in the form specification file
(custform.per) for Chapter 5.
01 SCHEMA custdemo
02
03 TOPMENU
04 GROUP form (TEXT="Form")
05 COMMAND quit (TEXT="Quit", COMMENT="Exit the program", IMAGE="exit")
06 END
07 GROUP stores (TEXT="Stores")
08 COMMAND find
09 SEPARATOR
13 COMMAND next
14 COMMAND previous
15 END
16END
17
...- Lines
04and07This exampleTOPMENUwill consist of two groups on the menu bar of the form. TheTEXTdisplayed on the menu bar for the first group will be Form, and the second group will be Stores. - Line
08to14Under the menu bar item Stores, the command-identifier find on line05will be bound to theMENUstatement actionfindon line14in the custmain.4gl file. The wordfindmust be identical (including case) in both theTOPMENUcommand and theMENUstatement action. The other command-identifiers are similarly bound.
The revised form specification file must be recompiled before it can be used in the program.