Most developers have used standard 4D procedures like CenterWindow for years. Thus, it is common to have reusable procedures for opening windows within 4D.
With the advent of platform independence, window management has become more complex. Under Windows, the OPEN WINDOW command positions windows with respect to the top left corner of the application (or MDI) window, rather than the screen. This makes centering problematic.
There is also the issue of layout scaling to contend with. 4D 3.5 now allows developers to scale layouts to reflect the higher resolution common on most Windows machines. This implies that you should have a separate layout for each platform. Your window handling code has to take this into account and call the appropriate layout.
There are other desirable attributes of a good window management module. For example, window stacking (i.e., “cascaded” windows) should be handled transparently. This should work across all processes. Any new stacked windows should occupy the lowest possible position. Thus, bottom-most windows should free up their positions for any new stacked windows.
The window management module which is presented in this technote satisfies all of the following requirements:
• Window resizing based upon the current “look”
• Loading of the appropriate layout based upon the
• Opening windows at various positions, including
center, upper center, lower center, stacked, etc.
(window position is transparently handled by the
module, based upon the current platform)
• Handling of all window types, including modeless,
modal, and floating
• Transparent management of window stacking,
including across multiple processes
The window management module is completely reusable. All that is necessary is to copy it into your database and use it, with two exceptions:
• The window management module requires the platform
module which is documented in A Platform and Look
Detection Module, by Jeff Browning (TN 96-20, April
• The platform module requires the ACI_PACK extension
package. You will need to install this package into your