version 11 (Modified)
You can use one of the following predefined constants to specify the type of window that you open with Open window:
Constant | Type | Value | Can be a floating window |
Plain window | Long Integer | 8 | No |
Plain no zoom box window | Long Integer | 0 | No |
Plain fixed size window | Long Integer | 4 | No |
Modal dialog box | Long Integer | 1 | No |
Alternate dialog box | Long Integer | 3 | Yes |
Movable dialog box | Long Integer | 5 | Yes |
Plain dialog box | Long Integer | 2 | Yes |
Palette window | Long Integer | 1984 | Yes |
Round corner window | Long Integer | 16 | No |
Pop up window | Long Integer | 32 | No |
Sheet window | Long Integer | 33 | No |
Resizable sheet window | Long Integer | 34 | No |
Metal Look | Long Integer | 2048 | Yes |
Compositing Mode | Long Integer | 4096 | Yes |
Floating Windows: 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.
Modal windows
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.
The following table shows each window type, on Windows (left) and on Macintosh (right).
Plain window (8)
Can have a title: Yes
Can have a close box or equivalent: Yes
Can be resized: Yes
Can be minimized/maximized or zoomed: Yes
Suitable for scroll bars: Yes
Usage: data entry with scrollbars, DISPLAY SELECTION, MODIFY SELECTION, etc.
Plain no zoom box window (0)
Can have a title: Yes
Can have a close box or equivalent: Yes
Can be resized: Yes
Can be minimized/maximized or zoomed: No on Macintosh
Suitable for scroll bars: Yes
Usage: data entry with scrollbars, DISPLAY SELECTION, MODIFY SELECTION, etc.
Plain fixed size window (4)
Can have a title: Yes
Can have a close box or equivalent: Yes
Can be resized: No on Macintosh
Can be minimized/maximized or zoomed: No
Suitable for scroll bars: Yes and No
Usage: data entry with ADD RECORD(...;...*) or equivalent
Modal dialog box (1)
Can have a title: No
Can have a close box or equivalent: No
Can be resized: No
Can be minimized/maximized or zoomed: No
Suitable for scroll bars: No
Usage: DIALOG, ADD RECORD(...;...;*) or equivalent
Windows of this type are modal
Alternate dialog box (3)
Can have a title: No
Can have a close box or equivalent: No
Can be resized: No
Can be minimized/maximized or zoomed: No
Suitable for scroll bars: No
Usage: DIALOG, ADD RECORD(...;...;*) or equivalent
Windows of this type are modal, unless used as floating windows
Movable dialog box (5)
Can have a title: Yes
Can have a close box or equivalent: No
Can be resized: No
Can be minimized/maximized or zoomed: No
Suitable for scroll bars: No
Usage: DIALOG, ADD RECORD(...;...;*) or equivalent
Windows of this type are modal, but can be moved and can be used as floating windows
Plain dialog box (2)
Can have a title: No
Can have a close box or equivalent: No
Can be resized: No
Can be minimized/maximized or zoomed: No
Suitable for scroll bars: No
Usage: DIALOG, ADD RECORD(...;...;*) or equivalent, splashscreens
Windows of this type are modal, unless used as floating windows
Palette window ( 1984 {+ 1} {+ 2} {+ 4} {+ 8} )
When you call Open window, you can add one or several of the following constants to Palette window in order to obtain variations in the behavior of the window:
Constant | Type | Value |
Has zoom box | Long Integer | 8 |
Has grow box | Long Integer | 4 |
Has window title | Long Integer | 2 |
Has highlight | Long Integer | 1 |
Can have a title: Yes, if Has window title variation is specified
Can have a close box or equivalent: Yes
Can be resized: Yes, if Has grow box variation is specified
Can be minimized/maximized or zoomed: Yes, if Has zoom box variation is specified
Suitable for scroll bars: Yes, if Has grow box variation is specified
Usage: Floating windows with DIALOG or DISPLAY SELECTION (no data entry)
Round corner window (16)
Can have a title: Yes
Can have a close box or equivalent: Yes
Can be resized: No on Macintosh
Can be minimized/maximized or zoomed: No
Suitable for scroll bars: No on Macintosh
Usage: Rare (obsolete)
Pop up window (32)
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 handle pop-up menus related to 3D "bevel" or "toolbar" type buttons.
Sheet window (33) and Resizable sheet window (34)
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).
Metal Look (2048)
Under Mac OS, it is possible to apply the metal look to windows. This type of look is found throughout the Macintosh interface. Under Windows, this property has no effect.
To apply the metal look to a window created by the Open window command, you can just add the Metal Look constant to the window type set in the type parameter. For example:
$win:=Open window(10;80;-1;-1;Plain window+Metal Look;"")
This look can be associated with the following types of windows:
Plain window
Plain no zoom box window
Plain fixed size window
Movable dialog box
Round corner window
Compositing Mode (4096)
The "compositing" mode is an internal mode for handling windows under Mac OS X, which is now recommended by Apple. In 4D, this mode is required more particularly to display certain dynamic objects such as Web areas.
For historical reasons, this mode is not used in all 4D windows. It is always used by the Open form window command and project forms executed from the Design environment. On the other hand, windows managed via the Open window command do not use it by default. To activate it, you need to pass the Compositing Mode constant when calling the command.
Under Windows, this property has no effect.
Note: Certain former architecture objects are not compatible with the compositing mode (for example 4D Chart areas). If they are displayed in windows in compositing mode, these objects will not work.
See Also
Open external window, Open window.