You create a floating window with the DISPLAY FLOATING WINDOW statement. This statement constructs the specified window and returns a handle to it. A window created with the above statement is modal by default (the MODAL phrase can be added as commentary). To create a modeless window, you can add the MODELESS phrase. Note that managing multiple modeless windows is greatly simplified by associating a separate thread with each modeless window. See Multiple Execution Threads for more informaqtion.
The program's initial window, or main application window, is created either automatically, via the run-time system, or programmatically via the DISPLAY INITIAL WINDOW statement. If the first DISPLAY statement is not a DISPLAY INITIAL WINDOW (or DISPLAY STANDARD WINDOW statement), the run-time system automatically creates the initial window. The main application window is always a modeless window.
Because floating windows can be moved and, optionally, resized, their position and size are dynamic. To retrieve the current position and size of a floating window, you use the INQUIRE verb. INQUIRE returns information for the current window or the window identified by the specified handle.
To programmatically reposition or change the size or title of a window, you use the MODIFY verb. The MODIFY statement applies the specified values to the window identified by the handle or, if omitted, the current floating window.
Windows have a property called ACTION that can be used in DISPLAY and MODIFY statements. The ACTION property allows you to programmatically maximize, minimize, or restore a window. To use ACTION, assign it one of the following values (these names are found in acugui.def):
Maximizes the window. It has the same effect as if the user clicked the maximize button. Allowed only for windows that have RESIZABLE or AUTO-RESIZE specified or implied for them. In windows with RESIZABLE specified, when ACTION-MAXIMIZE causes the window to change size, an NTF-RESIZED event occurs. (This event does not occur, however, if AUTO-RESIZE is specified.)
Minimizes the window. It has the same effect as if the user clicked the minimize button. Allowed only for windows that have RESIZABLE or AUTO-RESIZE specified or implied for them.
If the window is currently maximized or minimized, restores the window to its previous size and position; otherwise, it has no effect. It has the same effect as if the user selected Restore from the menu. Allowed only for windows that can be maximized or minimized. In windows with RESIZABLE specified, and when ACTION-MAXIMIZE has caused the window to change size, an NTF-RESIZED event occurs when ACTION-RESTORE is used. (This event does not occur, however, if AUTO-RESIZE is specified.)
If you assign an ACTION value that is not allowed, there is no effect other than to trigger the ON EXCEPTION phrase of the MODIFY statement (if present). Note that you can use the ACTION phrase to create a window that is initially maximized or minimized.
You destroy a floating window with either the CLOSE WINDOW statement or DESTROY verb. You specify the handle of the window you want to destroy. Both verbs behave identically when acting on floating windows. You cannot destroy the main application window. It is closed automatically when the application terminates.
See Procedure Division Statements for a complete description of each of the above verbs. See Screen Description Entry for detailed information regarding creating and managing floating windows via the Screen Section.