Progress
Language Tutorial
for Character
Menu Bar Example
You’ve learned all the basics, so now you can put it all together. This example implements enough of a menu bar to demonstrate what you’ve learned. Perform these steps:
- Open
lt-11-01.p
and run it. The following display appears:
![]()
- Choose Tables from the menu bar and browse through the submenu and the nested submenu.
- Choose the Reports and Help submenus and browse through them.
- Choose Reports
Mailing Labels. The editor in the window displays the list of customer mailing labels.
- Choose Tables
Exit.
- Press SPACEBAR to return to the Procedure Editor.
First, look at the code that sets up the menu structure:
These notes help to explain the include file code:
- The DEFINE SUB-MENU statement defines one pull-down menu and the menu items of that pull-down menu. The ampersand (&) in the label, establishes the mnemonic for the menu item (covered later).
- This submenu appears as a menu item in the next DEFINE SUB-MENU statement, so its definition must come first.
- The Exit menu item is always the last menu item of the first submenu on the menu bar.
- Use RULE to provide a graphic divider between groups of menu items. Use SKIP to add space between menu items.
- The DISABLED option disables this menu item on startup (covered later).
- The TOGGLE-BOX option makes the menu item a toggle (covered later).
- The DEFINE MENU statement defines a Progress menu. The MENUBAR phrase makes the menu a menu bar and associates submenus with it.
- This critical step makes the window the owner of the menu bar. In this case, the owner is the default window.
Next, look at the following code, which uses the previous menu structure to implement the mailing list report you saw in the last section:
These notes help explain the main code:
- This reference includes the menu structure in the procedure.
- Choosing the Exit menu item ends the application by closing the window.
- Like most menu items, choosing this item executes a RUN statement to an internal or external procedure. Here, the internal procedure runs a report.
- The Exit command of the menu bar satisfies the WAIT-FOR condition by closing the application window.
- The internal procedure executes the customer mailing label report.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |