This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20.6
Window Types

Window Types  


 

You can use one of the following constants from the "Open Form Window" theme to specify the type of window that you open with Open form window:

Constant Type Value
Modal form dialog box Longint 1
Movable form dialog box Longint 5
Plain form window Longint 8
Pop up form window Longint 32
Sheet form window Longint 33
Toolbar form window Longint 35
Palette form window Longint 1984
Form has no menu bar Longint 2048
Form has full screen mode Mac Longint 65536
Controller form window Longint 133056

This section shows each type of window under Windows (left) and macOS (right).

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.

  • 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

  • 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: No
  • Usage: DIALOG, ADD RECORD(...;...*) or equivalent
  • Windows of this type are modal, but can be moved.

  • 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.

This type of window features the following advanced specifics:

  • The window cannot have a close box but 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.

Sheet windows are specific to macOS. These windows 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 macOS 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:
    • 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 3 of the Open form window command).
  • Usage: DIALOG, ADD RECORD(...;...*) or equivalent, under macOS (not standard under Windows).

A toolbar form window is created with the location, size and graphical properties of a toolbar, i.e.:

  • The window will always be displayed just under the menu bar.
  • The window's horizontal size will be automatically adjusted to fill all available horizontal space on the desktop (on macOS) or inside 4D's application window (on Windows in MDI mode). The window's vertical size is based on the form properties like all other form window types.
  • The window has no border, cannot be moved and cannot be resized manually.
  • It is not possible to create two different toolbar windows at the same time in the same process (otherwise error -10613, "Cannot create two form windows of type toolbar" is generated).

Toolbar form windows and macOS full screen mode: If your application displays both a toolbar window and standard windows that support full screen mode (Form has full screen mode Mac option), interface rules require that you hide the toolbar when a standard window enters full screen mode. To know if a window has switched to full screen mode, just test whether its vertical size is exactly the same as the screen's height (see the HIDE TOOL BAR command).

This type of window allows you to generate floating windows. 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.

This type of window is similar to the Palette form window with the following specificity: on Windows, the floating window will be referenced by an icon in the task bar (on Windows, regular floating palettes are not displayed in the task bar).

This type of window is useful when the database is running in SDI mode on Windows. In this mode, floating palettes are hidden when their parent application is moved to the background. Thus, if your database interface is based upon a single floating window (for example to display a monitor view), you need to use a Controller form window to reference the application in the task bar and make sure it will remain reachable even if it has been moved to the background.

For example:

 $win:=Open form window("myMonitor";Controller form window;On the left;Vertically centered)

Note: Under macOS, this window type behaves like a regular Palette form window.

This option is intended for use when the database is running in SDI mode on Windows.

In this context, all windows of your application display by default the current process menu bar. If you want to open a window without menu bar, you need to add the Form has no menu bar constant to the type parameter. For example, this code creates a plain form window without menu bar in a SDI application on Windows:

Note: This option has no effect:

  • in a macOS application,
  • in a Windows application in MDI mode.

The "full screen" option is available under macOS for document type windows. When this option is used, a "Full screen" button is displayed in 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 Form has full screen mode Mac constant to the type parameter. For example, this code creates a form window with a full-screen button under macOS:

 $win:=Open form window([Interface];"User_Choice";Plain form window+Form has full screen mode Mac)
 DIALOG([Interface];"User_Choice")

Note: Under Windows, this option has no effect.

 
PROPERTIES 

Product: 4D
Theme: Windows

 
PAGE CONTENTS 
 
HISTORY 

Modified: 4D v16 R4

 
ARTICLE USAGE

4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)