37 setup
The setup object can be used to query the system configuration out of the dialog. The attributes query the window system, the screen resolution, the operating system, the color model, etc.
Definition
This object cannot be defined; it can only be queried in the rules!
Events
None
Children
None
Parent
None
Menu
None
C Function DM_ParsePath in manual “C Interface - Functions”
37.1 attributes
| Attribute | RLD | PID | Properties | Description |
|---|---|---|---|---|
|
integer |
integer |
-,G/-/- |
Color variant of the dialog. Also see chapter “Access to variants of resources”. |
|
|
integer |
integer |
-,G/-/- |
Number of colors. |
|
|
integer |
integer |
-,G/-/- |
Number of colors for each screen in multiscreen dialogs I (nur Motif). For more information on multiscreen dialogs, see resource display. |
|
|
enum |
enum |
-,G/-/- |
Query of the terminal type (Black and white, grayscale or color terminal). Possible values: coltype_bw, coltype_color, coltype_grey. |
|
|
enum |
enum |
-,G/-/- |
Query of the terminal type (Black and white, grayscale or color terminal) for multi screen dialogs for every screen I (only Motif). Possible values: coltype_bw, coltype_color, coltype_grey. More about multi screen dialogs see resource display. |
|
|
identifier |
cursor |
S,G/D/C |
Cursor variant of the dialog. Also see chapter “Access to variants of resources”. |
|
|
string |
string |
-,G/-/- |
Path to error file (Redirection from IDM error message to a file ). Also see chapter “Attributes for trace control”. |
|
|
string |
string |
D,G/-/- |
Environment variables of the system including values set with option -IDMenv. |
|
|
string |
string |
S,G/-/- |
Environment variables of the system. |
|
|
identifier |
font |
S,G/D/C |
Font variant of the dialog. Also see chapter “Access to variants of resources”. |
|
|
string identifier |
string format |
S,G/D/C |
Format variant of the dialog. Also see chapter “Access to variants of resources”. |
|
|
integer |
integer |
-,G/-/- |
Accelerator variantof the dialog. Also see chapter “Access to variants of resources”. |
|
|
integer |
integer |
-,G/-/- |
Language variant of the dialog. Also see chapter “Access to variants of resources”. |
|
|
string |
string |
-,G/-/- |
Path of logfiles. Also see chapter “Attributes for trace control”. |
|
|
integer |
integer |
-,G/-/- |
Number of logical mouse buttons. |
|
|
string |
string |
-,G/-/- |
Contains the Operation System identifier |
|
|
enum |
enum |
-,G/-/- |
Contains the Operation System type , e.g. os_nt, os_unix. |
|
|
boolean |
boolean |
S,G/D/- |
Options of the object. Index: opt_balloon_toolhelp – defines if toolhelp is shown as ballooon (true, Default) or a rectangle. Since version A.05.01.c on MS Windows available. |
|
|
identifier |
cursor |
S,G/-/- |
Global setting of a temporary cursor. |
|
|
integer |
integer |
-,G/-/- |
Maximum mouse cursor height in pixels. |
|
|
integer |
integer |
-,G/-/- |
Maximum mouse cursor height in pixels for multiscreen dialog for each screen I (only Motif). For more information on multiscreen dialogs, see resource display. |
|
|
integer |
integer |
-,G/-/- |
Maximum mouse cursor width in pixels. |
|
|
integer |
integer |
-,G/-/- |
Maximum mouse cursor width in pixels for multiscreen dialog for each screen I (only Motif). For more information on multiscreen dialogs, see resource display. |
|
|
integer |
integer |
-,G/-/- |
Current system scale. | |
|
integer |
integer |
-,G/-/- |
Screen number of default screen for multiscreen dialogs (only Motif). For more information on multiscreen dialogs, see resource display. |
|
|
integer |
integer |
-,G/-/- |
Provides the number of the I-th screen fo multidialog dialogs (only Motif). For more information on multiscreen dialogs, see resource display. |
|
|
integer |
integer |
-,G/-/- |
Screen height in pixels. |
|
|
integer |
integer |
-,G/-/- |
Screen height in pixels for multiscreen or multimonitor dialogs for each screen I (only Motif). For more information on multiscreen dialogs, see resource display. |
|
|
integer |
integer |
-,G/-/- |
Screen width in pixels. |
|
|
integer |
integer |
-,G/-/- |
Screen width in pixels for multiscreen or multimonitor dialogs for each screen I (only Motif and Windows). For more information on multiscreen dialogs, see resource display. |
|
|
integer |
integer |
-,G/-/- |
Number of available screens for multiscreen or multimonitor dialogs (only Motif and Windows). For more information on multiscreen dialogs, see resource display. |
|
|
string |
string |
S,G/-/- |
Access and set search path used for dialog, module, interface and binary files for imports with use |
|
|
string |
string |
-,G/-/- |
Terminal for AlphaWindows. |
|
|
string |
string |
-,G/-/- |
Terminal type for AlphaWindows. |
|
|
integer |
integer |
-,G/-/- |
Image variant of the dialog. Also see chapter “Access to variants of resources”. |
|
|
integer |
integer |
-,G/-/- |
DPI value images of the application have been designed |
|
|
enum |
enum |
-,G/-/- |
Toolkittype of the system, e.g. toolkit_motif, toolkit_windows, toolkit_qt. |
|
|
string |
string |
-,G/-/- |
Toolkit of the system. |
|
|
integer |
integer |
-,G/-/- |
Toolkit version of the system. |
|
|
string |
string |
-,G/-/- |
Path to the tracefile. Also see chapter “Attributes for trace control”. |
|
|
integer |
integer |
S,G/-/- |
Tracetime option of the tracefile. Also see chapter “Attributes for trace control”. |
|
|
boolean |
boolean |
S,G/-/- |
Switching tracing on and off at runtime. Also see chapter “Attributes for trace control”. |
|
|
string |
string |
-,G/-/- |
IDM version string. |
|
|
enum |
enum |
-,G/-/- |
Used window system, e.g. winsys_windows, winsys_x11, winsys_wayland. |
|
|
string |
string |
-,G/-/- |
Query of the window system. |
|
|
integer |
integer |
-,G/-/- |
Query of the window system version. |
|
|
enum |
enum |
-,G/-/- |
Percentage of usage of Windows GDI- and User Objects |
|
|
integer |
integer |
-,G/-/- |
Access DPI value in Xdirection for multiscreen dialogs for each screen I (only Motif). For more information on multiscreen dialogs, see resource display. |
|
|
integer |
integer |
-,G/-/- |
Access DPI value in Y direction. |
|
|
integer |
integer |
-,G/-/- |
Access DPI value Y direction for multiscreen dialogs for each screen I (only Motif). For more information on multiscreen dialogs, see resource display. |
37.2 Specific Attributes
The messagebox object ignores the .overridecursor defined during object setup and always displays the cursor defined for that messagebox or the default cursor.
Example for displaying the override cursor
Msgbox1.cursor := setup.overridecursor;
querybox(Msgbox1);
Msgbox1.cursor := null;
You can also change the variant of a text resource at runtime, namely in the
- Rule language
- Programming language
Previously, the language was set using the command-line option when starting an application. -IDMlanguage.
Rule Language
setup.language := <Variant number of the language>
Example
text "Language" // English (default)
{
1: "Language"; // German
}
on MENUITEM_LANGUAGE select
{
setup.language := 1;
}
C and COBOL interface
The setup object must be assigned the corresponding variant number of the selected language. DM_SetValue.
Note
It is helpful to set the language before loading the dialog, as the text of every visible object will need to be changed. If no object is yet visible, the language can be changed very quickly.
37.2.1 Access to Environment Variables
The environment variables of the program can be set using the setup object. For this purpose there are the two attributes .env[] and .envvar[].
.env[] contains all environment variables. Values which have been set with the option -IDMenv overwrite the values set in the environment.
Variables which have been set with the option -IDMenv are valid for IDM functions only. With the attribute .envvar[], however, you receive environment variables only.
The attributes .env[] and .envvar[] are gettable and settable. They are indexed with the names of the environment variables. If the environment variable has not been set, a fail is returned on querying.
In addition you may view all variables which have been set with -IDMenv. Use the attribute .count[] for this purpose. It is indexed via .env whose return value is be the number of IDM environment variables. Now .env[] can be indexed with numbers from 1 to .count[.env] in order to find out the names of the environment variables.
Example
!! Reading the PATH variable print setup.envvar["PATH"]; !! Setting an IDM environment variable setup.env["DIALOGPATH"] := "/usr/local/idm/examples"; load("DIALOGPATH:draw.dlg"); !! Reading all IDM variables for I:=1 to setup.count[.env] do print setup.env[I]+"="+setup.env[setup.env[I]]; endfor !! Deleting the variable setup.env["DIALOGPATH"] := null; !! Setting an unset environment variable if fail(setup.env["SERVER_OPT"]="") then setup.env["SERVER_OPT"] := "true"; endif
Note
Environment variables which have been set during a process will not result in changes in the environment variables of parent processes (e.g. shell) or existing child processes. Only new child processes can receive the changed environment variables.
37.3 Attributes for trace control
The setup object offers several attributes for controlling the tracing:
.errfile, .logfile, .tracefile, .tracetime and .tracing.
37.3.1 Access to the system configuration
The specific operating system or windowing system variant can be determined via the attributes .opsys_string, .opsys_type, .toolkit, .toolkit_string, .toolkit_version, .winsys, .winsys_string and .winsys_version.
The attributes .env[string] and .envvar[string] can be used to access the environment variables of the system or the dialog.
Information about the used display can be accessed with the attributes .colorcount, .color_type, .screen, .screencount, .screen_height, .screen_width, .terminal, .terminaltype, .xdpi and .ydpi erfragt. Provided that these attributes are indexed and available (see “attributes”), they are designed to support multiscreen dialog on Motif.
Information on the mouse cursor can be accessed additionally with the attributes .pointer_height and .pointer_width (indexed for multiscreen dialogues available).
37.3.2 Access to variants of resources
Besides using command-line options, the variants of different resources can also be queried or set at runtime. This is done via the corresponding attributes of the setup object.
The attribute names are chosen to be descriptive; for example, the attribute .color is used to access the color variants, language for the .language variants (text resource), etc.
The following attributes are available:
.color, .cursor, .font, .format, .keyboard, .language and tile.
The following chapter presents an example of the text resource (language variant).
The mouse cursor can be set globally for all dialog objects using the overridecursor attribute. However, the messagebox object ignores .overridecursor and always displays the cursor defined for the message box or the default cursor.
Example of displaying the override cursor at a messagebox
Msgbox1.cursor := setup.overridecursor;
querybox(Msgbox1);
Msgbox1.cursor := null;
37.3.2.1 Example using the text resource
You can also change the variant of a text resource at runtime, specifically in the
- Rule language
- Programming language
Previously, the language was set using the command-line option -IDMlanguage when starting an application.
Rule language
setup.language := <Variante number of the desired language>
Example
text "Language" // English (default)
{
1: "Sprache"; // German
}
on MENUITLANGUAGE select
{
setup.language := 1;
}
37.3.2.2 C or COBOL interface
You must assign the appropriate variant number of the desired language to the setup object using DM_SetValue.
37.4 Trace control options
The following attributes are available in the ISA Dialog Manager to influence tracing:
.errfile, .logfile, .tracefile, .tracetime and .tracing.
37.5 Differences and special features Qt
For IDM for Qt the attribute .toolkit has the enum value toolkit_qt and .toolkit_string the value Qt
.
The setup object has the attributes .colorname[integer], .cursorname[integer] and .fontname[integer], which contain lists of available color names, cursor names and fonts (see chapters “setup” to“setup”).
The .toolhelp attribute for controlling the display duration is not supported. Furthermore, the appearance of the toolhelp cannot be changed via .options[opt_balloon_toolhelp].
See also
Chapter“Tracing” in the manual “Development Environment”