Window styles

Use the STYLE attribute to set a style for a window.

By default, windows are displayed as normal application windows, but you can use the WINDOWSTYLE attribute to show a window in front of other windows, as a "modal window".

The window style defines the type of the window (normal, modal) and its decoration, via a presentation style. The presentation style specifies a set of attributes in an external file (.4st).

There are different ways to define the style of a window: The STYLE attribute can be used in the OPEN WINDOW instruction to define the default style for a window, but it is better to specify the window style in the form file, with the WINDOWSTYLE attribute of the LAYOUT section. This avoids decoration-specific code in the programs.

Table 1. Standard window styles defined in the default presentation style file
Style name in 4st file Description
Window Defines presentation attributes for common application windows. When using MDI containers, normal windows are displayed as MDI children.
Window.main, Window.main2 Defines presentation attributes for starter applications, where the main window shows a start menu if one is defined by the application.
Window.dialog, Window.dialog2, Window.dialog3, Window.dialog4

Defines presentation attributes for typical OK/Cancel modal windows.

On iOS mobile devices, opening a new window with the predefined style 'dialog' causes the window to slide up from the bottom:
OPEN WINDOW w_opt WITH FORM "f_opt" ATTRIBUTES(STYLE="dialog")
Window.naked Defines presentation attributes for windows that do not show the default view for ring menus and action buttons (OK/Cancel).
Window.viewer Defines presentation attributes for viewers as the report pager (fglreport.per).

It is recommended that you not change the default settings of windows styles in the FGLDIR/lib/default.4st file. If you create your own style file, copy the default styles into your own file in a different directory.

It is not possible to change the presentation style attributes of windows dynamically in the AUI tree. The style is applied when the window and form are loaded.

If you open and display a second form in an existing window, the window style of the second form is not applied.