Progress
Language Tutorial
for Windows


Menu Basics

Menus are an important part of an event-driven programming model, since menus allow users to control the flow of an application. Progress defines a menu as a widget containing a list of commands or options available to users. In Progress, a menu is always associated with another widget. In the tutorial, you learn about the most common type of menu: the menu bar. A menu bar is a horizontal bar displayed at the top of a window. The menu bar is always associated with a window widget. To learn about other types of menus, see the Progress Programming Handbook .

A menu bar consists of submenus. A submenu is a vertical list of commands and options available to a user. So, the menu bar form of menu is a collection of lists of commands and options. The titles of the submenus are listed across the menu bar. To a user, a menu bar is a collection of pull-down menus. To a Progress programmer, a menu bar is a collection of submenus—the menu bar is syntactically the menu. This slight distinction in terminology is important to help make the discussion in this chapter clear. The terms submenu and pull-down menu are analogous, and the terms menu and menu bar are analogous.

A submenu consists of menu items. A menu item is an individual command or option, or even another submenu. When a submenu is a menu item of another submenu, it is known as a nested submenu. Nested submenus appear to the side of the main submenu when chosen.

When complete, the menu bar you present to a user is a hierarchical structure consisting of a:

The widgets that make up the complete menu bar are related to each other. For example, submenus on the menu bar are children of the parent menu bar. Each of the menu bar submenus are siblings to each other. Similarly, menu items are children of a parent submenu, and so on. When you code a complete menu bar, you build it from the bottom up. The lower-level widgets must exist before you can relate them to the higher-level widgets.

The menu widget itself does not have a parent—a menu is always owned by one widget. In the case of the menu bar, the window widget owns it. Each Progress window can own one menu bar.

Figure 11–1 shows a menu bar with two menu titles, File and Edit. When you choose Edit, a pull-down menu with three menu items appears below Edit. When you choose the menu item Add, a pull-down menu with four menu items appears to the side of Add. The arrow to the right of Add indicates that there is a nested submenu.

Figure 11–1: Example of a Window with a Menu Bar


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