Progress
Language Tutorial
for Character


Defining a Menu Bar

Once you’ve defined the contents of each submenu, you need to define a menu bar and associate the submenus to it. The DEFINE MENU statement defines a menu, and the MENUBAR phrase makes the menu a menu bar. This is the syntax for the DEFINE MENU statement.

SYNTAX
DEFINE
  [ [ NEW ] SHARED ] MENU menu-name
  [ MENUBAR ] 
  {   LIKE menu-name
    | menu-element-descriptor ...
  } 

Table 11–3 explains the relevant components of the syntax.

Table 11–3: MENU Options 
Component
Description
NEW SHARED
Defines a menu that you can share among procedures.
SHARED
Specifies a menu created in another procedure with the DEFINE NEW SHARED MENU statement.
MENU
Specifies the menu you are defining.
MENUBAR
Specifies that the menu is a menu bar.
LIKE
Specifies a previously defined menu whose characteristics you want to apply to the new menu.
menu-element-descriptor
Specifies an element to display on the menu. You must specify at least one menu element, unless you use the LIKE option.

This is an example of a complete DEFINE MENU statement:

DEFINE MENU mbar MENUBAR
    SUB-MENU sm-Table       LABEL "Tables"
    SUB-MENU sm-Reports     LABEL "Reports"
    SUB-MENU sm-Help        LABEL "Help". 

First, the DEFINE MENU statement creates the menu bar and names it mbar. Then it assigns each of the previously defined submenus to it. The LABEL option once again lets you provide titles for the menu items. The order in which you list the submenus is important—Progress places the menu titles of the submenus on the menu bar starting with the first listed submenu.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095