34 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”
34.1 Attributes
Attribute |
RLD |
PID |
Properties |
Short Description |
---|---|---|---|---|
integer |
integer |
-,G/-/- |
color variant |
|
integer |
integer |
-,G/-/- |
number of colors |
|
integer |
integer |
-,G/-/- |
number of colors for screen I in multiscreen systems (IDM for Motif only) |
|
enum |
enum |
-,G/-/- |
type of screen possible values: |
|
enum |
enum |
-,G/-/- |
type of screen for screen I in multiscreen systems (IDM for Motif only) possible values as for .color_type |
|
identifier |
cursor |
S,G/D/C |
cursor variant |
|
string |
string |
S,G/-/- |
accesses environment variables set through the option -IDMenv |
|
string |
string |
S,G/-/- |
accesses environment variables |
|
string |
string |
-,G/-/- |
absolute path of the error file |
|
boolean |
boolean |
-,G/-/- |
returns if the object class is an USW class |
|
class |
class |
-,G/-/- |
returns the I-th registered USW class |
|
identifier |
font |
S,G/D/C |
font variant |
|
string identifier |
string format |
S,G/D/C |
format variant |
|
integer |
integer |
-,G/-/- |
accelerator variant |
|
integer |
integer |
-,G/-/- |
text variant |
|
string |
string |
-,G/-/- |
absolute path of the log file |
|
integer |
integer |
-,G/-/- |
number of logical mouse buttons |
|
string |
string |
-,G/-/- |
identification of operation system |
|
enum |
enum |
-,G/-/- |
type of operation system possible values: |
|
boolean |
boolean |
S,G/D/- |
special options of object |
|
identifier |
cursor |
S,G/-/- |
temporary cursor for the entire dialogs in general |
|
integer |
integer |
-,G/-/- |
maximal height of mouse cursor |
|
integer |
integer |
-,G/-/- |
maximal height of mouse cursor for screen I in multiscreen systems (IDM for Motif only) |
|
integer |
integer |
-,G/-/- |
maximal width of mouse cursor |
|
integer |
integer |
-,G/-/- |
maximal width of mouse cursor for screen I in multiscreen systems (IDM for Motif only) |
|
integer | integer | -,G/-/- | specified system scaling | |
integer |
integer |
-,G/-/- |
screen number of the default screen in multiscreen systems (IDM for Motif only) |
|
integer |
integer |
-,G/-/- |
screen number of screen I in multiscreen systems (IDM for Motif only) |
|
integer |
integer |
-,G/-/- |
screen height in pixels |
|
integer |
integer |
-,G/-/- |
screen height in pixels for screen I in multiscreen or multimonitor systems (IDM for Motif & Windows only) |
|
integer |
integer |
-,G/-/- |
screen width in pixels |
|
integer |
integer |
-,G/-/- |
screen width in pixels for screen I in multiscreen or multimonitor systems (IDM for Motif & Windows only) |
|
integer |
integer |
-,G/-/- |
number of available screens (IDM for Motif & Windows only) |
|
string |
string |
S,G/-/- |
search path for dialog, module, interface and binary files for imports with use |
|
string |
string |
-,G/-/- |
terminal for AlphaWindows, e.g. vt220 |
|
string |
string |
-,G/-/- |
terminal type for AlphaWindows, e.g. "/dev/tty" |
|
integer |
integer |
-,G/-/- |
tile variant |
|
.toolhelp |
integer |
integer |
S,G/D/C |
specified for which dpi value the images were created |
.toolhelp |
text |
text |
S,G/-/- |
specified text to be displayed in pop-up |
enum |
enum |
-,G/-/- |
query of tookit type possible values: |
|
string |
string |
-,G/-/- |
query of toolkit |
|
integer |
integer |
-,G/-/- |
query of toolkit version |
|
string |
string |
-,G/-/- |
absolute path of the trace file |
|
.tracetime |
integer |
integer |
S,G/-/- |
|
boolean |
boolean |
S,G/-/- |
executing tracing completely |
|
string |
string |
-,G/-/- |
query of DM version string |
|
enum |
enum |
-,G/-/- |
query of kind of window system possible values: |
|
string |
string |
-,G/-/- |
query of window system |
|
integer |
integer |
-,G/-/- |
query of version of window system |
|
integer |
integer |
-,G/-/- |
horizontal DPI (dots per inch) of screen |
|
integer |
integer |
-,G/-/- |
horizontal DPI (dots per inch) of screen I in multiscreen systems (IDM for Motif only) |
|
integer |
integer |
-,G/-/- |
vertical DPI (dots per inch) of screen |
|
integer |
integer |
-,G/-/- |
vertical DPI (dots per inch) of screen I in multiscreen systems (IDM for Motif only) |
34.2 Specific Attributes
The object messagebox ignores the .overridecursor set at the object setup and always displays the cursor defined for this messagebox or the default cursor.
Example for the Display of the Overridecursor
Msgbox1.cursor := setup.overridecursor;
querybox(Msgbox1);
Msgbox1.cursor := null;
You may change the variant of a text resource also during runtime, namely in the
- Rule Language
- programming language
So far the language was determined on starting an application with the command line option -IDMlanguage.
Rule Language
setup.language := <variant number of language>
Example
text "Language" // English (default)
{
1: "Language"; // German
}
on MENUITEM_LANGUAGE select
{
setup.language := 1;
}
C and COBOL Interface
The corresponding variant number of the chosen language has to be assigned to the setup object with DM_SetValue.
Note
It is helpful to set the language before loading the dialog as the text of every visible object has to be changed. If no object is visible yet the language may be changed very quickly.
34.3 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.
34.4 Attributes for Controlling the Tracing
The setup object provides several attributes to control the tracing:
.errfile, .logfile, .tracefile, .tracetime and .tracing.
See Also
Chapter “Tracing” in manual “Development Environment”