Defining window properties
Window properties are accessible when selecting the window in the class list and choosing the property view (Property tab bottom of the workspace).
Besides setting several options, the reference to the project window control, which defines the project window resources is is necessary. Window definitions support
- Assigning window's content control (F)
- Defining window options (B)
- Defining alignment/positioning type (D)
- Setting window size and position (C)
- Setting inner distance to window control (E)
- Associating window context class (A)
In order to provide text definitions for the window, the Text definition tab has to be activated in the windows property form.
The area defining the windows content has to be designed in a window control. The window control is associated via the control selection box:
Window controls have to be defined in the same class as the window, i.e. the class cannot be changed. The Field Control selection box contains all controls defined in the class in the drop list and one may select one of the controls already designed. When the control to be associated with the window does not yet exist, one may simply type the name of the control to be created in the edit field of the combo box. A control with the defined name will be created and initialized with default settings for a window control.
Several options may influence the project appearance and behavior.
- Title - indicates, that a title bar is shown. The title bar, by default, contains the text defined in text definitions under Title. The windows title may, however, also be changed by the application (ControlContext::setTitle()).
- Min/Max - Causes a minimize/maximize button to be displayed in the title bar
- Close - Creates a close button in the title bar
- Move - Allows moving the window by dragging the title bar
- Resize - Allows resizing the window
- System Modal - The window does not allow the user to give focus to another window
- Small Title - The title bar is displayed as small title bar
- Always on Top - The window will always stay on top of all applications
Not all option combinations are allowed, and not allowed options are reset and disabled. Thus, e.g. switching the Title option will disable Min/Max, Close, Move, Resize and Small Title options.
In order not to access other windows than the current one, system modal should be switched on. This is necessary, when starting a transaction while the dialog is opened. When the dialog is system modal, subordinated dialogs may be opened and accessed. When the dialog is not marked as system modal, the dialog may stay open while e.g. selecting another item in the list that had opened the dialog. In this case, the GUI frame work automatically displays data for the new selected item in the dialog window.
Position types are used for defining the parent which provides the offset for positioning subordinated dialogs.
A values set in size and position are pixel values. Usually, size and position need not to be defined. The size is determined from the control size assigned to the window. However, in order to change the size when opening the dialog, a size not smaller than the size of the control referenced might be set.
The position is the position in pixel relative to the position calculated from the alignment or position type settings. In case of screen, position (POS_Screen), which is the typical value for project windows, the position describes the position relative to the upper left corner of the screen. Otherwise, the position is added to the position of the defined parent.
In order to provide additional margins, a number of pixels may be defined as distance between the window border and the inner control displaying the data.
A window context class might become necessary in order to react properly on window events or in order to provide actions to be called in the context of the window (e.g. via window main menu or tool bar. When the window is a project or application window, the context should be associated with the project or application definition. When the window is activated via a window action or in different contexts, contet class should be assigned to the window resource.
When a context class has been assigned to the windows resource and the calling GUI action, the context class assigned in the windows resource will be ignored.
In order to assign the window context class, the context class name can be entered directly in the class name area or the associate dialog might be started clicking the associate button:
More details about creating and implementing GUI context classes are described in Assigning GUI context classes in Designer. How to implement context classes is described in Context classes.