45 window
The basic object of a window system is – as already implied by the term – the window. All other objects have to be generated within a window.
The declaration of a window starts with the keyword window, followed by the window identifier and the window definition.
The window definition specifies the appearance, size and various other features of the window.
Definition
{ export | reexport } { model } window { <Identifier> } { <standard attributes> <plain attributes> <geometry attributes> <grid attributes> <hierarchy attributes> <layout attributes> < > <object-specific attributes> }
45.1 Definition of Child Objects
All other objects supported by the DM are located within a window. Thus they must be declared as children of a window either directly or indirectly. The keyword for this is child. It is followed by a keyword describing the object type, and an optional identifier. This identifier only has to be specified if the object is to be addressed out of the rules or out of the application afterward. It is followed by the object definitions in braces.
For further information, see chapter “Inheritance of Attributes” in manual “Programming Techniques”.
Definition
{export} child object class {<Identifier>}
{
object definition
}
Note
Integrating a menu into the window must be done with the keyword child. The menus integrated with child are located in the menu bar of the window. Their number is unlimited.
Events
Children
Parent
Menu
45.2 Attributes
Attribute |
RLD |
PID |
Properties |
Short Description |
---|---|---|---|---|
string object |
string text |
S.G/D/C |
overwrites the Automation Identifier for Microsoft UI Automation |
|
object string |
text string |
S.G/D/C |
overwrites the Automation Name for Microsoft UI Automation |
|
identifier |
accel |
S,G/D/C |
accelerator of object |
|
identifier |
color |
S,G/D/C |
background color |
|
identifier |
color |
S,G/D/C |
border color |
|
enum |
enum |
S,G/D/C |
defines the style, i.e. representation and characteristics of the borders (since IDM version A.06.01.a) |
|
integer |
integer |
S,G/D/C |
border width |
|
object |
object |
S,G/-/C |
accesses the I-th child object |
|
integer |
integer |
-,G/-/- |
queries the number of child objects |
|
class |
class |
-,G/-/- |
class/id of object |
|
boolean |
boolean |
S,G/D/C |
window can be closed by closebox |
|
identifier |
cursor |
S,G/D/C |
cursor belonging to object |
|
boolean |
boolean |
S,G/-/- |
cut operation has not been executed yet |
|
boolean |
boolean |
-,G/-/- |
changing state during a cut operation |
|
identifier |
instance |
-,G/-/- |
dialog to which the object belongs |
|
boolean |
boolean |
S,G/D/C |
window becomes dialogbox |
|
identifier |
display |
S,G/D/C |
screen on which the window is shown |
|
.document[integer] |
object |
document |
S,G/-/- |
accesses the I-th XML Document |
boolean |
boolean |
-,G/-/- |
returns if the object class is an USW class |
|
class |
class |
-,G/-/- |
returns the I-th registered USW class |
|
identifier |
color |
S,G/D/C |
foreground color |
|
object |
object |
S,G/-/C |
accesses the first child object |
|
identifier |
instance |
S,G/-/- |
first menu of window |
|
object |
record |
S,G/-/C |
accesses the first record of an object |
|
boolean |
boolean |
S,G/-/C |
input focus on object |
|
identifier |
font |
S,G/D/C |
object font |
|
identifier |
func |
S,G/D/C |
function belonging to object |
|
integer |
integer |
S,G/D/C |
object height |
|
string identifier |
string text |
S,G/D/C |
help text of object |
|
.hsb_arrows |
boolean |
boolean |
S,G/-/- |
defines whether horizontal scrollbar has arrows at its end |
integer |
integer |
S,G/D/C |
horizontal scroll value for scrolling line by line |
|
boolean |
boolean |
S,G/D/C |
horizontal scrollbar is only displayed if necessary |
|
integer |
integer |
S,G/D/C |
horizontal scroll value for scrolling page by page |
|
boolean |
boolean |
S,G/D/C |
visibility of horizontal scrollbar |
|
object |
tile |
S,G/D/C |
assigns object to icon |
|
boolean |
boolean |
S,G/D/C |
window can be turned into icon |
|
boolean |
boolean |
S,G/D/C |
mechanism for iconifying in window title |
|
boolean |
boolean |
S,G/D/C |
ignoring the cursor |
|
string |
string |
S,G/D/C |
name/identifier of object |
|
object |
object |
S,G/-/C |
accesses the last child object |
|
identifier |
instance |
S,G/-/C |
last menu of window |
|
object |
record |
S,G/-/C |
accesses the last record of an object |
|
boolean |
boolean |
S,G/D/- |
defers the display of a visibly created object |
|
integer |
integer |
S,G/D/C |
maximal window height |
|
boolean |
boolean |
S,G/-/- |
maximize state of window |
|
integer |
integer |
S,G/D/C |
maximal window width |
|
attribute |
attribute |
-,G/-,- |
user-defined attribute [I] of object |
|
integer |
integer |
-,G/-,- |
number of user-defined attributes |
|
identifier |
instance |
S,G/D/C |
object menu |
|
identifier |
instance |
S,G/-/C |
menu child [I] of window |
|
identifier |
color |
S,G/D/C |
background color of menu |
|
integer |
integer |
-,G/-/C |
number of menu elements in window |
|
identifier |
color |
S,G/D/C |
foreground color of menu |
|
integer |
integer |
S,G/D/C |
minimal window height |
|
integer |
integer |
S,G/D/C |
minimal window width |
|
identifier |
instance |
S,G/D/C |
model belonging to object |
|
boolean |
boolean |
S,G/D/C |
window can be moved interactively |
|
boolean |
boolean |
S,G/D/- |
special options of object |
|
identifier |
instance |
S,G/-/- |
parent of object |
|
boolean |
boolean |
S,G/D/C |
positions refer to grid |
|
enum |
enum |
S,G/D/C |
controls the display and selection of the input mode for the edittexts within the window |
|
integer |
integer |
-,G/-/- |
real height of object |
|
boolean |
boolean |
-,G/-/- |
real selectivity of object |
|
boolean |
boolean |
-,G/-/- |
real visibility of object |
|
integer |
integer |
-,G/-/- |
real width of object |
|
integer |
integer |
-,G/-/- |
real distance from left (in pixel) |
|
integer |
integer |
-,G/-/- |
width of grid internally used |
|
integer |
integer |
-,G/-/- |
real distance from top (in pixel) |
|
integer |
integer |
-,G/-/- |
height of grid internally used |
|
object |
record |
S,G/-/C |
accesses the I-th record of an object |
|
integer |
integer |
-,G/-/- |
queries the number of child records |
|
identifier |
font |
S,G/D/C |
reference font of object |
|
integer |
scope |
-,G/-/- |
queries the object type (Default, Model or instance) |
|
boolean |
boolean |
S,G/D/C |
selectivity of object |
|
boolean |
boolean |
S,G/D/C |
window size can be changed interactively |
|
boolean |
boolean |
S,G/D/C |
size refers to grid of parent object |
|
.statushelp |
string identifier |
string text |
S,G/D/C |
text to be displayed in the statusbar |
boolean |
boolean |
S,G/D/C |
specifies whether window defined as |
|
tile |
object |
tile |
S,G/D/C |
tile resource used as background image |
.tilestyle |
enum |
enum |
S,G/D/C |
controls how the background image set in .tile is arranged |
string identifier |
string text |
S,G/D/C |
text displayed in titlebar |
|
boolean |
boolean |
S,G/D/C |
window has title bar |
|
identifier |
color |
S,G/D/C |
background color of title bar |
|
identifier |
color |
S,G/D/C |
foreground color of title bar |
|
.toolbar |
object |
object |
-,G/-/- |
toolbar of object |
.toolbarcount |
integer |
integer |
-,G/-/- |
returns number of toolbars |
.toolhelp |
text |
text |
S,G/-/- |
specified text to be displayed in pop-up |
anyvalue |
anyvalue |
S,G/D/C |
object userdata (any DM data type) |
|
boolean |
boolean |
S,G/D/C |
window is positioned when opened |
|
integer |
integer |
S,G/D/C |
internal (virtual) height of object |
|
.vsb_arrows |
boolean |
boolean |
S,G/-/- |
defines whether vertical scrollbar has arrows at its end |
boolean |
boolean |
S,G/D/C |
visibility of object |
|
.vsb_linemotion |
integer |
integer |
S,G/-/C |
vertical scroll value for scrolling line by line |
boolean |
boolean |
S,G/D/C |
vertical scrollbar will be displayed, if necessary |
|
integer |
integer |
S,G/D/C |
vertical scroll value for scrolling page by page |
|
boolean |
boolean |
S,G/D/C |
visibility of vertical scrollbar |
|
integer |
integer |
S,G/D/C |
internal (virtual) width of object |
|
.width |
integer (may be 0) |
integer | S,G/-/C | width of the object |
integer (-1, 0, 1) |
integer |
S,G/D/C |
definition type of x-coordinates |
|
integer |
integer |
S,G/D/C |
x-coordinate, distance from left |
|
integer |
integer |
S,G/D/C |
shift of the origin along the x-axis in objects with scrollbars |
|
integer |
integer |
S,G/D/C |
units in x-direction |
|
integer |
integer |
S,G/D/C |
x-coordinate, distance from right |
|
integer (-1, 0, 1) |
integer |
S,G/D/C |
definition type of y-coordinates |
|
integer |
integer |
S,G/D/C |
y-coordinate, distance from bottom |
|
integer |
integer |
S,G/D/C |
shift of the origin along the y-axis in objects with scrollbars |
|
integer |
integer |
S,G/D/C |
units in y-direction |
|
integer |
integer |
S,G/D/C |
y-coordinate, distance from top |
45.3 Specific Attributes
Standard Attributes
The attribute .visible defines whether the window is visible immediately on starting the dialog.
Plain Attributes
In the object window, these attributes always refer to the screen on which the object is to be displayed, i.e. the coordinates are always specified in relation to the screen.
Of course it is possible to specify the coordinates and the dimension of a window in relation to the grid of the affiliated dialog. To do this, the attributes .posraster and .sizeraster have to be set to true.
Geometry Attributes
The additional geometry attributes .minheight, .minwidth, .maxheight, .maxwidth define the borders within which the window size can be changed interactively.
The attributes .vheight and .vwidth define which internal size the window is to have. It may be that only part of the internal size is visible at one time. To make the rest of the window visible you have to scroll the window.
The visible window part is controlled by the attributes .xorigin and .yorigin. They specify the relative shift of the window origin, which is normally located in the top left corner of the window.
The attributes .xraster and .yraster define the unit by which the position and dimension of the children are to be specified. The actual pixel coordinates then result from multiplying the grid factor .xraster or .yraster by the specified coordinate. The attribute .reffont can link the given grid units to the used font; the DM then calculates the values for .xraster and .yraster.
Layout Attributes
.borderstyle
Attribute is supported, but only border_none and border_toolkit are permitted. border_plain, border_raised and border_sunken are mapped to border_toolkit.
45.3.1 MDI Window
The MS-Windows multi-document interface (MDI) is supported by the Dialog Manager. To use this feature, you have to ensure the following:
- define the window as toplevel window
- the window has to have a titlebar
- the window may not have children other than windows
- define the window as immediate child of a MDI frame window
All other windows are normal windows that can be toplevel windows or child windows. Keep in mind that a normal child window cannot get an active border and does have the same system accelerator as a toplevel window.
Moreover, you have to pay attention to the following:
- cannot have children other than windows, therefore adding other children is an error
- setting titlebar to FALSE is an error
- always has a titlebar
- cannot have a menubar
- can only be a child of a MDI frame window
A normal window:
- cannot be a child of a MDI frame window
- if created as a child, always have a titlebar
- if created as a child, cannot have a menubar
Warning
Child windows not using MDI are not supported by MS Windows! This might cause a non-expected behavior of many attributes and events.
45.3.2 Scrollbar Attributes
The scrollbar attributes .hsb_... and .vsb_... define whether the window is to be provided with scrollbars.
The window can have the complete set of scollbar attributes:
- .hsb_linemotion
- .hsb_optional
- .hsb_pagemotion
- .hsb_visible
- .vsb_linemotion
- .vsb_optional
- .vsb_pagemotion
- .vsb_visible
Operation Mode of Scrollbars in Windows and Groupboxes
The visibility of scrollbars is influenced by the attributes
- .hsb/vsb_optional
- .hsb/vsb_visible
and
- .width/height
- .vwidth/vheight
The following rules are valid:
- A groupbox and a window can have horizontal scrollbars only if the virtual size .vheight is set.
- A groupbox and a window can have vertical scrollbars only if the virtual size .vwidth is set.
If no scrollbars are set, the virtual size will be ignored.
The attributes .hsb/vsb_visible and .hsb/vsb_optional control whether the scrollbars are to be visible at all times or only if necessary.
As mentioned above, scrollbars require the setting of the virtual size, i.e. if no virtual size is set, there are no scrollbars available.
If the scrollbars are visible
-
and .hsb/vsb_optional is true,
then the scrollbar is visible only if necessary.
-
and .hsb/vsb_optional is false
then the scrollbar is always visible.
Note
.hsb/vsb_optional is ignored by the Motif version, i.e. internally .hsb/vsb_optional is always implicitly set at true.
To query or to change the scrollbar slider position, the attributes .xorigin and .yorigin have to be used. These attributes specify the object origin shift.
The attributes .pagemotion and .linemotion define the shift in pixels of object contents during the relevant scrollbar action. The value 0 means that the system default value is to be used; in case of .pagemotion scrolling is then carried out by pages.
45.4 Particularities of the Window on Qt
The window object has four additional options for supporting toolbars and tabbed docks
, as well as sizing and positioning a window to be Qt-compliant.
Table 13-3:
.options[…] |
Default Value |
Meaning |
---|---|---|
false |
true: Size specifications (.width, .height, minimum and maximum values) refer to the entire window, including menu bar, toolbars, tabbed widgets and status bar, but without decoration (title bar, margins). false: Size specifications refer to the interior ( |
|
false |
true: Animated, interactive moving of toolbars. However, this leads to significantly more resize and move events. false: No animations when moving toolbars. |
|
false |
The option only affects toolbars with the notepage style. true: Adjacent, multi-row docks are possible. However, this leads to a not so clear operation with interactions and shifts. false: Only single-row docks are possible. |
|
false |
The option only affects toolbars with the notepage style. true: false: |
As on Motif (and unlike Microsoft Windows), on Qt the .sensitive attribute does not affect the title bar of the window. Even if .sensitive = false (and the window content is no longer operable), the title bar functions (close, move, minimize, maximize…) can still be used.
The attribute .moveablehas no effect on Qt. Windows can always be moved.
In general, the IDM for Qt generates significantly more move and resize events than the other IDM versions, because for each pixel to be increased, decreased, or moved a corresponding event is triggered. There is no reliable way to determine the state and end of the actions.
Some window states can only be changed by internally clobbering, which triggers activate and deactivate events, however.
It may still happen that size specifications in certain constellations are not correctly put into effect (e.g. when changing them in the minimized state). Currently, the behavior may vary depending on the Window Manager (for example, when minimizing).
45.5 Example
Creating a Window
window Window_3
{
.xleft 10;
.ytop 10;
.xauto 1;
.yauto 1;
.height 100;
.width 200;
.title "vacation planning";
.sensitive true;
.visible true;
.sizeable true;
.titlebar true;
.closeable true;
}
Generation of a Window with Scrollbars on the Right and at the Bottom
window Window_3
{
.title "vacation planning";
.xleft 10;
.ytop 10;
.xauto 1;
.yauto 1;
.height 100;
.width 200;
.sensitive true;
.visible true;
.sizeable true;
.titlebar true;
.closeable true;
.vwidth 400;
.vheight 300;
/* horizontal scrollbar */
.hsb_visible true;
/* vertical scrollbar */
.vsb_visible true;
}
Result of the preceding example of a window with scrollbars on the right and at the bottom: