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>
  <scrollbar 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

activate

close

deactivate

deiconify

extevent

help

hscroll

iconify

key

move

resize

scroll

select

vscroll

Children

canvas

checkbox

document

edittext

groupbox

image

listbox

menubox

menuitem

menusep

notebook

poptext

pushbutton

radiobutton

record

rectangle

scrollbar

spinbox

statictext

tablefield

toolbar

transformer

treeview

window

Parent

dialog

module

window

Menu

Pop-up menu

menuitem

45.2 Attributes

Attribute

RLD

PID

Properties

Short Description

.acc_label

string

object

string

text

S.G/D/C

overwrites the Automation Identifier for Microsoft UI Automation

.acc_text

object

string

text

string

S.G/D/C

overwrites the Automation Name for Microsoft UI Automation

.accelerator

identifier

accel

S,G/D/C

accelerator of object

.bgc

identifier

color

S,G/D/C

background color

.bordercolor

identifier

color

S,G/D/C

border color

.borderstyle

enum

enum

S,G/D/C

defines the style, i.e. representation and characteristics of the borders (since IDM version A.06.01.a)

.borderwidth

integer

integer

S,G/D/C

border width

.child[integer]

object

object

S,G/-/C

accesses the I-th child object

.childcount

integer

integer

-,G/-/-

queries the number of child objects

.class

class

class

-,G/-/-

class/id of object

.closeable

boolean

boolean

S,G/D/C

window can be closed by closebox

.cursor

identifier

cursor

S,G/D/C

cursor belonging to object

.cut_pending

boolean

boolean

S,G/-/-

cut operation has not been executed yet

.cut_pending_changed

boolean

boolean

-,G/-/-

changing state during a cut operation

.dialog

identifier

instance

-,G/-/-

dialog to which the object belongs

.dialogbox

boolean

boolean

S,G/D/C

window becomes dialogbox

.display

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

.external

boolean

boolean

-,G/-/-

returns if the object class is an USW class

.external[integer]

class

class

-,G/-/-

returns the I-th registered USW class

.fgc

identifier

color

S,G/D/C

foreground color

.firstchild

object

object

S,G/-/C

accesses the first child object

.firstmenu

identifier

instance

S,G/-/-

first menu of window

.firstrecord

object

record

S,G/-/C

accesses the first record of an object

.focus

boolean

boolean

S,G/-/C

input focus on object

.font

identifier

font

S,G/D/C

object font

.function

identifier

func

S,G/D/C

function belonging to object

.height

integer

integer

S,G/D/C

object height

.help

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

.hsb_linemotion

integer

integer

S,G/D/C

horizontal scroll value for scrolling line by line

.hsb_optional

boolean

boolean

S,G/D/C

horizontal scrollbar is only displayed if necessary

.hsb_pagemotion

integer

integer

S,G/D/C

horizontal scroll value for scrolling page by page

.hsb_visible

boolean

boolean

S,G/D/C

visibility of horizontal scrollbar

.icon

object

tile

S,G/D/C

assigns object to icon

.iconic

boolean

boolean

S,G/D/C

window can be turned into icon

.iconifyable

boolean

boolean

S,G/D/C

mechanism for iconifying in window title

.ignorecursor

boolean

boolean

S,G/D/C

ignoring the cursor

.label

string

string

S,G/D/C

name/identifier of object

.lastchild

object

object

S,G/-/C

accesses the last child object

.lastmenu

identifier

instance

S,G/-/C

last menu of window

.lastrecord

object

record

S,G/-/C

accesses the last record of an object

.mapped

boolean

boolean

S,G/D/-

defers the display of a visibly created object

.maxheight

integer

integer

S,G/D/C

maximal window height

.maximized

boolean

boolean

S,G/-/-

maximize state of window

.maxwidth

integer

integer

S,G/D/C

maximal window width

.member[integer]

attribute

attribute

-,G/-,-

user-defined attribute [I] of object

.membercount

integer

integer

-,G/-,-

number of user-defined attributes

.menu

identifier

instance

S,G/D/C

object menu

.menu[integer]

identifier

instance

S,G/-/C

menu child [I] of window

.menubgc

identifier

color

S,G/D/C

background color of menu

.menucount

integer

integer

-,G/-/C

number of menu elements in window

.menufgc

identifier

color

S,G/D/C

foreground color of menu

.minheight

integer

integer

S,G/D/C

minimal window height

.minwidth

integer

integer

S,G/D/C

minimal window width

.model

identifier

instance

S,G/D/C

model belonging to object

.moveable

boolean

boolean

S,G/D/C

window can be moved interactively

.options[enum]

boolean

boolean

S,G/D/-

special options of object

.parent

identifier

instance

S,G/-/-

parent of object

.posraster

boolean

boolean

S,G/D/C

positions refer to grid

.preedit

enum

enum

S,G/D/C

controls the display and selection of the input mode for the edittexts within the window

.real_height

integer

integer

-,G/-/-

real height of object

.real_sensitive

boolean

boolean

-,G/-/-

real selectivity of object

.real_visible

boolean

boolean

-,G/-/-

real visibility of object

.real_width

integer

integer

-,G/-/-

real width of object

.real_x

integer

integer

-,G/-/-

real distance from left (in pixel)

.real_xraster

integer

integer

-,G/-/-

width of grid internally used

.real_y

integer

integer

-,G/-/-

real distance from top (in pixel)

.real_yraster

integer

integer

-,G/-/-

height of grid internally used

.record[integer]

object

record

S,G/-/C

accesses the I-th record of an object

.recordcount

integer

integer

-,G/-/-

queries the number of child records

.reffont

identifier

font

S,G/D/C

reference font of object

.scope

integer
(1, 2, 3)

scope

-,G/-/-

queries the object type (Default, Model or instance)

.sensitive

boolean

boolean

S,G/D/C

selectivity of object

.sizeable

boolean

boolean

S,G/D/C

window size can be changed interactively

.sizeraster

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

.sysmodal

boolean

boolean

S,G/D/C

specifies whether window defined as dialogbox (.dialogbox = true) is displayed in front of all other windows on the desktop

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

.title

string

identifier

string

text

S,G/D/C

text displayed in titlebar

.titlebar

boolean

boolean

S,G/D/C

window has title bar

.titlebgc

identifier

color

S,G/D/C

background color of title bar

.titlefgc

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

.userdata

anyvalue

anyvalue

S,G/D/C

object userdata (any DM data type)

.userplaced

boolean

boolean

S,G/D/C

window is positioned when opened

.vheight

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

.visible

boolean

boolean

S,G/D/C

visibility of object

.vsb_linemotion

integer

integer

S,G/-/C

vertical scroll value for scrolling line by line

.vsb_optional

boolean

boolean

S,G/D/C

vertical scrollbar will be displayed, if necessary

.vsb_pagemotion

integer

integer

S,G/D/C

vertical scroll value for scrolling page by page

.vsb_visible

boolean

boolean

S,G/D/C

visibility of vertical scrollbar

.vwidth

integer

integer

S,G/D/C

internal (virtual) width of object

.width

integer

(may be 0)

integer S,G/-/C width of the object

.xauto

integer

(-1, 0, 1)

integer

S,G/D/C

definition type of x-coordinates

.xleft

integer

integer

S,G/D/C

x-coordinate, distance from left

.xorigin

integer

integer

S,G/D/C

shift of the origin along the x-axis in objects with scrollbars

.xraster

integer

integer

S,G/D/C

units in x-direction

.xright

integer

integer

S,G/D/C

x-coordinate, distance from right

.yauto

integer

(-1, 0, 1)

integer

S,G/D/C

definition type of y-coordinates

.ybottom

integer

integer

S,G/D/C

y-coordinate, distance from bottom

.yorigin

integer

integer

S,G/D/C

shift of the origin along the y-axis in objects with scrollbars

.yraster

integer

integer

S,G/D/C

units in y-direction

.ytop

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:

To create a MDI frame window:

To create a MDI child 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:

MDI frame window:

MDI child window:

A normal window:

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:

Operation Mode of Scrollbars in Windows and Groupboxes

The visibility of scrollbars is influenced by the attributes

and

The following rules are valid:

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

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 of the window object

.options[…] Value

Default Value

Meaning

opt_window_size

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 (client area) of the window.

opt_animated

false

true: Animated, interactive moving of toolbars. However, this leads to significantly more resize and move events.

false: No animations when moving toolbars.

opt_nested_docks

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.

opt_tabbed_docks

false

The option only affects toolbars with the notepage style.

true: Tabbed docks that share the space are possible. Tabbed docks can be operated similar to notebooks and notepages (see chapter “Particularities of the Toolbar on Qt” at the toolbar object).

false: Tabbed docks are not possible.

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;

}

Figure 13-54: Window

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:

Figure 13-55: Window with Scrollbars