OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Managing menus (adding menus for child windows, merging menus, and so on) can be a tedious and confusing chore.
ObjectWindows simplifies menu management with objects known as menu descriptors, which divide the menu bar into the following six groups, corresponding to conventional ways of arranging functions on a menu bar:
Organizing menus into functional groups makes it easy to insert a new menu into an existing menu bar. For example, consider an MDI application, such as Step 11 of the tutorial in the Learning ObjectWindows manual. The frame and client windows provide menus that let the user perform general application functions such as opening files, managing windows, and so on. The child windows handle the menu commands for functions specific to a particular drawing, such as setting the line width and color.
In the tutorial, the menu stays the same, but menu items handled by the child windows are grayed out when no child window is available to handle the command. An additional way to handle this would be to have the menu bar populated only with the menus handled by the frame and client windows. Then, when a child window is opened, the menus handled by the child window would be merged into the existing menu bar. The following figures show how an application that uses both these techniques looks to the user:
The first figure shows the application with no child windows open.
The second figure shows the application after a child window has been opened.
Adding menu descriptors to an application is a simple process:
To learn more about creating menu descriptors and using the menu descriptor handling functions, see the following topics: