Some window types described in this section are related to old versions of 4D and of the OS. This theme as well as the Open window command itself are now only kept for compatibility reasons. When you write new code for managing windows, we strongly recommend using the Open form window command, which is better suited to current interfaces.
If you pass one of these constants to Open window, you open a regular windows. To open a floating windows, pass a negative window type value to Open window.
The main characteristic of floating windows is that they remain in the foreground even if the user clicks on another window of the process. Floating windows are generally used to display permanent information or tool bars.
A modal window places the user in a state (or “mode”) where they can only act within this window. As long as the modal window is displayed, the menu commands and other application windows are inaccessible. To close a modal window, the user must either validate it, cancel it, or choose one of the options it offers. Warning dialog boxes are a typical example of modal windows. In 4D, windows of the types 1 and 5 are modal windows.
Note: A modal window always stays in the foreground. As a consequence, when a modal window calls a non-modal window, this latter window is displayed in the background, even though it was called subsequent to the modal window. You should thus avoid this type of operation.
On the other hand, when a modal window calls another modal window, this latter window will be displayed in the foreground.
Note: With this type of window, the set of values (constant+option) must always be passed as a negative value. Make sure that you pass, for example, -(Palette window+6) and not (-Palette window+6).
Sheet windows are specific to Mac OS X. These windows “drop down” over the title bar of the main window using animation and are displayed above the main window. They are automatically centered in the main window. Their properties are comparable to those of the modal dialog boxes. They are generally used to perform an action directly relating to the action occurring in the primary window.
You can only create a sheet window under Mac OS X if the last open window is visible and a document type (form).
The command opens a type 1 (Modal dialog box) window instead of a type 33 window or type 8 (Plain) window instead of type 34:
if the last opened window is not visible or is not a document type,
under Windows.
Since a sheet window must be drawn above a form, its display is pushed back in the On load event of the first form loaded in the window (see example 4 of the Open window command).
Usage: DIALOG, ADD RECORD or equivalent, under Mac OS (not standard under Windows).
This type of window has the same basic characteristics of the Plain dialog box (2) type windows and features the following advanced specifics:
The window is automatically closed and the "cancel" event is passed to the window when:
a click occurs outside the window;
the background window or the MDI (Multiple Document Interface) window is moved;
the user clicks the Esc key.
This window is displayed in front of its "parent" window (it must not be used as the main window of the process). The background window is not disabled. However, it no longer receives events.
You cannot resize or move the window using the mouse; however, when performing these actions programmatically, the redraw of background items is optimized.
Usage: This type of window is primarily used to generate pop-up menus related to 3D “bevel” or “toolbar” type buttons.
Limitations:
It is not possible to display pop-up menu objects inside this type of window.
Beginning with version 13 of 4D, this type of window does not permit the display of help tips under Mac OS.
Under Mac OS, it is possible to apply a texture appearance to windows. This type of look is found throughout the Macintosh interface. Under Windows, this property has no effect.
To apply a texture appearance to a window created by the Open window command, you can just add the Texture appearance constant to the window type set in the type parameter. For example:
The "full screen" option is available beginning with 4D v14 under OS X for document type windows. When this option is used, a "Full screen" button is displayed in the top right corner of the window:
When the user clicks on this icon, the window switches to full screen and 4D automatically hides the main tool bar. To use this option, you just add the Has full screen mode Mac constant to the type parameter for the Open window, Open form window and _o_Open external window commands. For example, this code creates a form window with a full-screen button under OS X: