1 Eloquence Dialog System
Attributes
An object has attributes (variables) which control its functionality within a pre-defined range. Attributes depend on the object class. Attributes can be set and requested (get).
In order to reference an attribute, its name is appended to the object path separated by a period. Attribute names are not case-sensitive.
e.g. Dialog.Group.Radio1.ACTIVE
references the attribute ACTIVE of the object Radio1, which is in the groupbox "Group" in the dialog named "Dialog".
Attribute Types
Attributes are of different data types, depending on the type of information:
- String - character string (terminated by \0)
- Integer
- Boolean - 0 (=no, off, False), 1 (=yes, on, True)
- Any - string or integer
There are two groups of attributes.
- Base attributes - These attributes are available to all objects.
- Class-specific attributes - Each class defines additional attributes only available to objects of this class.
Base Attributes
The base attributes are available for all objects.
class Attribute
The class attribute returns the class name of the referenced object. It is set implicitly when the object is created and cannot be modified.
x, y Attribute
x, y define the position of the upper left corner of the object relative to its parent object, except for the root object (dialog) which is relative to the screen.
w, h Attribute
w, h define the object width and height. Note that all objects are clipped by the parent size. w and h must be greater than zero, otherwise the object is invisible.
The fgc, bgc Attributes
This Attribute has different meanings in ASCII as in Dialog Manager.
In ASCII it defines an display enhancement, because here are no colors available.
In Dialog Manager colors can be defined and selected with this two Attributes.
- .fgc
- Define dialog-object "foreground" enhancements or colors
- .bgc
- Define dialog-object "background" enhancements or colors
In SSCII DLG both attributes accept a numerical argument, which specifies the enhancement by an additive value:
- 0
- use default enhancement
- +2
- blinking video
- +4
- underline video
- +8
- half-bright video
A value of 16 will disable default enhancements.
For example:
DLG SET "Dialog.EditText.fgc",9
will cause the addressed EditText to be displayed reverse/half bright video instead of the default underline enhancement.
For example:
DLG SET "Dialog.EditText.fgc",Input
will cause the addressed EditText to be displayed in the color befined by "Input".
visible Attribute
The visible attribute defines if an object is visible or not. Note that an object is only visible if its parent object is visible.
sensitive Attribute
The sensitive attribute defines whether the object may receive the keyboard focus. This attribute is ignored for all object classes which do not provide keyboard support.
rule Attribute
The rule attribute is of type integer, and can have any value. The value of the rule attribute affects the dialog handling. The rule attribute serves several purposes, depending on the value and object class:
- If the object class is PushButton and the object is "executed", the dialog will be suspended, returning the rule value. If the rule value is set to -1, the help subsystem will be called instead.
- If the object class is CheckBox, RadioButton or ListBox and the object is "executed", and the rule value is non-zero, the dialog will be suspended, returning the rule value. If the rule value is set to -1, the help subsystem will be called instead.
- In all other cases, if the focus will be moved from an object with a non-zero rule value, the dialog will be suspended, returning the rule value.
focus Attribute
The focus attribute will serve a dual purpose. If retrieved it will return non-zero if the object has the keyboard focus. If set, it will force the setting of the keyboard focus to the specified object, its children or the next available object, whatever is available first.
So you may specify focus for parent object and the first child is selected.
focusobj
NOTE: This attribute is not available with Dialog Manager.
It can be read only and returns the Objectpath of the object which has the focus currently.
The kbind Attribute
NOTE: This attribute is not available with Dialog Manager.
It makes it possible to override the default keyboard handling for a specific object by assigning a rule for a key value.
For example:
The following statement assigns a rule value of 103 for a PageDown key (which has a key code of 338):
DLG SET "Object.kbind[338]",103
NOTE: The Eloquence KBCODE statement displays the code for a given key.
It is not recommended to make frequent use of the kbind attribute since this may lead to confusion due to nonstandard keyboard behavior.
The kbind attribute affects the actual object and its child objects. If you define a kbind attribute for a GroupBox, it is also active for all child objects. A different definition in a child object has priority over a parent definition.
The following GET and SET operations on the kbind attribute are defined:
- If a zero is assigned to a kbind attribute or a kbind attribute with index zero, all key assignments are removed. For example:
DLG SET "Object.kbind",0
DLG SET "Object.kbind[0]",0
- If a zero value is assigned to a kbind index, the specified key assignment will be removed. For example:
DLG SET "Object.kbind[338]",0
- If a nonzero value is assigned to a kbind index, the specified key will be assigned with the given rule value. For example:
DLG SET "Object.kbind[338]",103
- The value returned by a kbind attribute or a kbind attribute with an zero index is the number of kbind assignments. For example:
DLG GET "Object.kbind",N
DLG GET "Object.kbind[0]",N
- The value returned by a kbind attribute with an index N is the Nth key assignment. For example:
DLG GET "Object.kbind[1]",N
The following example program will demonstrate the various DLG GET/SET operations on the kbind attribute:
DLG SET "Object.kbind",0 ! Clear all key assignments
DLG SET "Object.kbind[65]",20 ! 'A' returns 20
DLG SET "Object.kbind[32]",21 ! space returns 21
DLG GET "Object.kbind",Nkeys ! Get number of values
DISP "Nkeys=";Nkeys
FOR I=1 TO Nkeys ! Get all values
DLG GET "Object.kbind["&VAL$(I)&"]",K
DISP "kbind["&VAL$(I)&"]=";K
NEXT I
The following keys can not be reassigned, because they are processed internally:
- The ESC key (27)
- The BREAK key (0) and the ^Y key (25)
- The ^L key (12)
- The ^N key (14)
- The Insert key (331)
- The key assigned to the alt attribute.
help Attribute
The help attribute may hold a string used by the help subsystem to identify the section in the helpfile.
udata Attribute
The udata ("user data") attribute is used to store a value of any data type. If you need to assign your own information to an object (e.g. to validate data entry) you may use the udata attribute.
first, next Attribute
The first, next attributes are not regular attributes like the ones described above. The .first attribute returns the first dialog name when used without an object name. If an object name is provided, it returns the first child object name for the given object.
The .next attribute returns the next dialog name when used without an object name. If an object name is provided, it returns the next object name.
An empty string is returned if requested information is not available (e.g., no child or last object).
alt Attribute
NOTE: This attribute is not available with Dialog Manager.
The alt attribute is only available for the Dialog Object. If it is nonzero, it is the key number of the key to be used as an ALT key in this dialog. The alt attribute must be defined in order to enable keyboard accelerators in the dialog (see below).
With Dialog Manager the "Alt"-Key is used to work with keyboard accelarators.
Keyboard Accelerators
If a '&' character is contained in the label text of a StaticText, CheckBox, RadioButton or PushButton object type, the following character will be displayed underlined and used as a keyboard accelerator.
NOTE: If you want to display a "&" in a StaticText of an ASCII DLG Dialog, you must not define the alt attribute. In a Dialog Manager Dialog you have to define three "&" to display an "&".
If the alt attribute is enabled in the dialog, pressing the ALT key (In ASCII DLG: specified by the alt attribute) and a keyboard accelerator, causes the focus to change to the first object defining the accelerator key.
If the object type is StaticText, keyboard focus is changed to the next object in Tab order. If the object type is of type CheckBox, RadionButton or PushButton, the object is selected.
If pressing a key which is not accepted by the current object (the object which has the focus), it will be used as an accelerator.
For example, pressing an alphanumeric key while the current object is of type PushButton will cause an accelerator lookup.
Example for an ASCII DLG dialogfile:
Dialog Sample {
...
.alt = 266 # Alt key is F2
StaticText Label1 {
...
.text = "Label &1"
}
EditText Edit {
...
}
PushButton OK {
...
.text = "&OK"
}
}
Pressing the keys F2 and 1 will change the focus to the EditText "Edit". Pressing the keys F2 and O will trigger the PushButton "OK".
Eloquence Dialog Manual - 19 DEC 2002