17 listbox
The listbox is a selection mechanism which makes it possible to select one or more element out of a number of text elements by a mouse click.
Definition
{ export | reexport } { model } listbox { <Identifier> } { <standard attributes> <plain attributes> <geometry attributes> <hierarchy attributes> <layout attributes> <text attributes> <object-specific attributes> }
Events
Children
Parent
Menu
Methods
17.1 Attributes
Attribute |
RLD |
PID |
Properties |
Short Description |
---|---|---|---|---|
string object |
string text |
S.G/D/C |
overwrites the Automation Identifier for Microsoft UI Automation |
|
object string |
text string |
S.G/D/C |
overwrites the Automation Name for Microsoft UI Automation |
|
identifier |
accel |
S,G/D/C |
accelerator of object |
|
integer |
integer |
S,G/D/C |
active listbox item |
|
boolean |
boolean |
S,G/D/C |
selection state of listbox object |
|
identifier |
color |
S,G/D/C |
background color |
|
identifier |
color |
S,G/D/C |
border color |
|
integer |
integer |
S,G/D/C |
width of object border |
|
class |
class |
-,G/-/- |
class/id of object |
|
string |
string |
S,G/D/C |
listbox is filled from rules |
|
identifier |
instance |
-,G/-/- |
control currently belonging to object |
|
identifier |
cursor |
S,G/D/C |
cursor belonging to object |
|
boolean |
boolean |
S,G/-/- |
cut operation not yet carried out |
|
boolean |
boolean |
-,G/-/- |
changing state during cut operation |
|
identifier |
instance |
-,G/-/- |
dialog to which the object belongs |
|
object |
document |
S,G/-/- |
accesses the I-th XML Document |
|
boolean |
boolean |
-,G/-/- |
returns if the object class is an USW class |
|
class |
class |
-,G/-/- |
returns the I-th registered USW class |
|
identifier |
color |
S,G/D/C |
foreground color |
|
integer |
integer |
S,G/D/C |
number of the first displayed character (horizontal scroll position). |
|
object |
record |
S,G/-/C |
accesses the first record of an object |
|
boolean |
boolean |
S,G/-/C |
input focus on object |
|
integer |
integer |
S,G/-/C |
focusitem in a listbox |
|
identifier |
font |
S,G/D/C |
object font |
|
identifier |
func |
S,G/D/C |
function belonging to object |
|
identifier |
instance |
-,G/-/- |
object groupbox |
|
integer |
integer |
S,G/D/C |
object height |
|
string identifier |
string text |
S,G/D/C |
help text of object |
|
integer index |
integer index |
-,G/-/- |
current index of object in the child list of its parent |
|
integer |
integer |
S,G/D/C |
number of listbox items |
|
string |
string |
S,G/D/C |
name/identifier of object |
|
object |
record |
S,G/-/C |
accesses the last record of an object |
|
object |
object |
-,G/-/- |
layoutbox of object |
|
boolean |
boolean |
S,G/D/- |
defers the display of a visibly created object |
|
attribute |
attribute |
-,G/-,- |
user-defined attribute [I] of object |
|
integer |
integer |
-,G/-,- |
number of user-defined attributes |
|
identifier |
instance |
S,G/D/C |
object menu |
|
identifier |
instance |
S,G/D/C |
model belonging to object |
|
boolean |
boolean |
S,G/D/C |
multiple selection in listbox |
|
integer |
integer |
-,G/-/- |
next selected item in listbox |
|
boolean |
boolean |
S,G/D/- |
special options of object |
|
identifier |
instance |
S,G/-/- |
parent of object |
|
integer |
integer |
S,G/D/- |
height of the space for pictures displayed left of the items |
|
object |
tile |
S,G/D/C |
picture for each item |
|
object |
tile |
S,G,D,C |
picture for each item when the item is selected |
|
integer |
integer |
S,G/D/- |
width of the space for pictures displayed left of the items |
|
boolean |
boolean |
S,G/D/C |
positions refer to grid |
|
integer |
integer |
-,G/-/- |
real height of object |
|
boolean |
boolean |
-,G/-/- |
real selectivity of object |
|
boolean |
boolean |
-,G/-/- |
real visibility of object |
|
integer |
integer |
-,G/-/- |
real width of object |
|
integer |
integer |
-,G/-/- |
real distance from left (in pixel) |
|
integer |
integer |
-,G/-/- |
real distance from top (in pixel) |
|
object |
record |
S,G/-/C |
accesses the I-th record of an object |
|
integer |
integer |
-,G/-/- |
queries the number of child records |
|
integer |
scope |
-,G/-/- |
queries the object type (Default, Model or instance) |
|
enum |
enum |
S,G/-/C |
multisel has become superfluous for tablefield and listbox by selstyle |
|
boolean |
boolean |
S,G/D/C |
selectivity of object |
|
boolean |
boolean |
S,G/D/C |
size refers to grid of parent object |
|
string object |
string text |
S,G/-/C |
text to be displayed in statusbar |
|
object |
object |
-,G/-/- |
toolbar of object |
|
.toolhelp |
string object |
string text |
S,G/D/C |
gives a short explanation of object at the cursor |
integer |
integer |
S,G/D/C |
first displayed listbox item |
|
anyvalue |
anyvalue |
S,G/D/C |
object userdata (any DM datatype) |
|
anyvalue |
anyvalue |
S,G/D/C |
userdata of listbox items |
|
boolean |
boolean |
S,G/D/C |
visibility of object |
|
integer may be 0 |
integer |
S,G/D/C |
actual width of object |
|
identifier |
instance |
-,G/-/- |
window to which object belongs |
|
integer (-1, 0, 1) |
integer |
S,G/D/C |
definition type of x-coordinates |
|
integer |
integer |
S,G/D/C |
x-coordinate, distance from left |
|
integer |
integer |
S,G/D/C |
x-coordinate, distance from right |
|
integer (-1, 0, 1) |
integer |
S,G/D/C |
definition type of y-coordinates |
|
integer |
integer |
S,G/D/C |
y-coordinate, distance from bottom |
|
integer |
integer |
S,G/D/C |
y-coordinate, distance from top |
17.2 Specific Attributes
Layout Attributes
The color of the listbox border can be defined with .bordercolor.
Listbox-specific Attributes
In order to realize the data exchange between application and listbox, there are the following additional listbox attributes.
To change the selectivity of individual listbox items and their selection states, the attributes .active and .sensitive can be indexed. If .sensitive is used without an index the entire listbox will be affected; .active is not allowed without an index in the listbox.
Example
listbox.multisel := true;
listbox.active[i] := false;
These commands deselect the listbox item.
Note
The attribute .sensitive[index] is ignored in the Motif version. If the attributes .active and .sensitive are not explicitly specified, the default for .active is false, the default for .sensitive is true .
The number of texts to be displayed in the listbox can be specified with .itemcount.
17.2.1 Selection Control in Listbox Object
The following values are valid for the attribute .selstyle:
single |
maximal one item is active at the same time |
multiple |
compatible to .multisel = true |
extended |
see description below |
The element onto which you click is the current element.
Action |
Selection |
---|---|
|
delete previous selection, activate current element |
Shift + |
maintain previous selection, activate area from last |
Ctrl + |
maintain previous selection, toggle activation of current element |
Ctrl + Shift + |
maintain previous selection, area from last |
Interaction of .selstyle with attribute .selection[] which is used to select a selection type in the tablefield.
Selection Type |
Current Element |
---|---|
sel_single |
a single element |
sel_header |
a header element |
sel_row |
a row |
sel_column |
a column |
Please note that a single-column tablefield behaves like a listbox with .selstylesingle and extended.
17.3 Example
window main
{
child listbox selection
{
.xleft 10;
.ytop 10;
.xauto 1;
.yauto 1;
.width 50;
.height 100;
.sensitive true;
.multisel false;
.itemcount 6;
.borderwidth 1;
.content[1] "selection 1";
.content[2] "selection 2";
.content[3] "selection 3";
.content[4] "selection 4";
.content[5] "selection 5";
}
}