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.

This figure is a screenshot of the custform form with a toolbar added in Chapter 5.

Figure 1. A form with a topmenu displayed on a Windows™ platform

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:

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.