Progress
Programming
Handbook
Creating Window Families
By default, when you create a window, Progress parents that window transparently to the window system. In this way, windows are siblings of each other. You must manage these windows individually.
You can also parent a window (child window) to another window (parent window) by setting the child window’s PARENT attribute to the widget handle of the parent window. Windows that are parented by a window, which in turn is parented by the window system, form a window family. The window parented by the window system is the root window of the window family. Windows parented by any child window, in turn, form a child window family. A child window can only be parented by one window at a time.
Window Families vs. Individual Windows
Each window in a window family, by itself, functions much the same as an individual window. That is, you can individually move, resize, and interact with a member of a window family like an individual window.
However, window families share a number of additional properties that make them convenient for both applications and users to manage:
- Coordinated viewing and hiding — When you view any member of a window family, the whole window family is viewed, unless the HIDDEN attribute is TRUE for at least one other member. If HIDDEN is TRUE for a parent or ancestor window, no windows in the window family are viewed, however any HIDDEN attribute setting for the explicitly viewed window is set to FALSE. If HIDDEN is TRUE for a descendant window, all windows in the family are viewed except the hidden descendant window and all of its descendants. When you hide a member of a window family (set VISIBLE to FALSE), that window and all of its descendant windows are hidden (VISIBLE set to FALSE), but none of their HIDDEN attributes are affected.
- Coordinated minimizing and restoring — When you minimize (iconify) a window, all of its descendants disappear from view, unless they are already minimized. Any minimized descendants remain minimized and can be restored individually. When you restore a parent window, any of its hidden descendants are redisplayed. Note that when you hide a window (set VISIBLE to FALSE), any minimized descendants are hidden also, and when you redisplay that window, its minimized descendants reappear minimized.
- Coordinated close events — If a parent window receives a WINDOW–CLOSE event, it propagates a PARENT–WINDOW–CLOSE event to all of its descendant windows. However, any action on these events is trigger-dependant. The WINDOW–CLOSE does not propagate any events upward to ancestor windows.
For more information on window family properties, see the WINDOW Widget, HIDDEN Attribute, and VISIBLE Attribute reference entries in the Progress Language Reference .
Window Family Example
The following procedure creates a window family with three windows—a parent, child, and grandchild window. By choosing the buttons in the default window (Control Panel), you can visualize most of the properties described in the previous list.
Figure 21–1 shows the Control Panel window and the example window family.
Figure 21–1: Window Family
![]()
Combine the VIEW, HIDE, and HIDDEN button events with the WINDOW–MINIMIZE and WINDOW–RESTORE events using the window controls to see how window hiding and viewing work together with window minimizing and restoring.
For an example that uses a window family in a database application, see the "Persistent Multi-window Management" section.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |