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

See Also

C function DM_ParsePath in manual “C Interface - Functions”

34.1 Attributes

Attribute

RLD

PID

Properties

Short Description

.color

integer

integer

-,G/-/-

color variant

.colorcount

integer

integer

-,G/-/-

number of colors

.colorcount[integer]

integer

integer

-,G/-/-

number of colors for screen I in multiscreen systems (IDM for Motif only)

.color_type

enum

enum

-,G/-/-

type of screen

possible values:

  • coltype_bw
  • coltype_color
  • coltype_grey

.color_type[integer]

enum

enum

-,G/-/-

type of screen for screen I in multiscreen systems (IDM for Motif only)

possible values as for .color_type

.cursor

identifier

cursor

S,G/D/C

cursor variant

.env[string]

string

string

S,G/-/-

accesses environment variables set through the option -IDMenv

.envvar[string]

string

string

S,G/-/-

accesses environment variables

.errfile

string

string

-,G/-/-

absolute path of the error file

.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

.font

identifier

font

S,G/D/C

font variant

.format

string

identifier

string

format

S,G/D/C

format variant

.keyboard

integer

integer

-,G/-/-

accelerator variant

.language

integer

integer

-,G/-/-

text variant

.logfile

string

string

-,G/-/-

absolute path of the log file

.mouse_buttons

integer

integer

-,G/-/-

number of logical mouse buttons

.opsys_string

string

string

-,G/-/-

identification of operation system

.opsys_type

enum

enum

-,G/-/-

type of operation system

possible values:

  • os_dos
  • os_mpe
  • os_nt
  • os_os2
  • os_unix
  • os_vms

.options[enum]

boolean

boolean

S,G/D/-

special options of object

.overridecursor

identifier

cursor

S,G/-/-

temporary cursor for the entire dialogs in general

.pointer_height

integer

integer

-,G/-/-

maximal height of mouse cursor

.pointer_height[integer]

integer

integer

-,G/-/-

maximal height of mouse cursor for screen I in multiscreen systems (IDM for Motif only)

.pointer_width

integer

integer

-,G/-/-

maximal width of mouse cursor

.pointer_width[integer]

integer

integer

-,G/-/-

maximal width of mouse cursor for screen I in multiscreen systems (IDM for Motif only)

.scale

integer integer -,G/-/- specified system scaling

.screen

integer

integer

-,G/-/-

screen number of the default screen in multiscreen systems

(IDM for Motif only)

.screen[integer]

integer

integer

-,G/-/-

screen number of screen I in multiscreen systems (IDM for Motif only)

.screen_height

integer

integer

-,G/-/-

screen height in pixels

.screen_height[integer]

integer

integer

-,G/-/-

screen height in pixels for screen I in multiscreen or multimonitor systems (IDM for Motif & Windows only)

.screen_width

integer

integer

-,G/-/-

screen width in pixels

.screen_width[integer]

integer

integer

-,G/-/-

screen width in pixels for screen I in multiscreen or multimonitor systems (IDM for Motif & Windows only)

.screencount

integer

integer

-,G/-/-

number of available screens (IDM for Motif & Windows only)

.searchpath

string

string

S,G/-/-

search path for dialog, module, interface and binary files for imports with use

.terminal

string

string

-,G/-/-

terminal for AlphaWindows, e.g. vt220

.terminaltype

string

string

-,G/-/-

terminal type for AlphaWindows, e.g. "/dev/tty"

tile

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

.toolkit

enum

enum

-,G/-/-

query of tookit type

possible values:

  • toolkit_alpha
  • toolkit_isa
  • toolkit_motif
  • toolkit_pm
  • toolkit_windows

.toolkit_string

string

string

-,G/-/-

query of toolkit

.toolkit_version

integer

integer

-,G/-/-

query of toolkit version

.tracefile

string

string

-,G/-/-

absolute path of the trace file

.tracetime

integer

integer

S,G/-/-

 

.tracing

boolean

boolean

S,G/-/-

executing tracing completely

.version_string

string

string

-,G/-/-

query of DM version string

.winsys

enum

enum

-,G/-/-

query of kind of window system

possible values:

  • winsys_none
  • winsys_pm
  • winsys_windows
  • winsys_x11

.winsys_string

string

string

-,G/-/-

query of window system

.winsys_version

integer

integer

-,G/-/-

query of version of window system

.xdpi

integer

integer

-,G/-/-

horizontal DPI (dots per inch) of screen

.xdpi[integer]

integer

integer

-,G/-/-

horizontal DPI (dots per inch) of screen I in multiscreen systems (IDM for Motif only)

.ydpi

integer

integer

-,G/-/-

vertical DPI (dots per inch) of screen

.ydpi[integer]

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

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”