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

activate

cut

dbselect

deactivate

extevent

focus

help

hscroll

key

paste

scroll

select

vscroll

Children

document

record

transformer

Parent

groupbox

layoutbox

module

notepage

splitbox

toolbar

window

Menu

Pop-up menu

Methods

:delete()

:exchange()

:find()

:insert()

17.1 Attributes

Attribute

RLD

PID

Properties

Short Description

.acc_label

string

object

string

text

S.G/D/C

overwrites the Automation Identifier for Microsoft UI Automation

.acc_text

object

string

text

string

S.G/D/C

overwrites the Automation Name for Microsoft UI Automation

.accelerator

identifier

accel

S,G/D/C

accelerator of object

.activeitem

integer

integer

S,G/D/C

active listbox item

.active[integer]

boolean

boolean

S,G/D/C

selection state of listbox object

.bgc

identifier

color

S,G/D/C

background color

.bordercolor

identifier

color

S,G/D/C

border color

.borderwidth

integer

integer

S,G/D/C

width of object border

.class

class

class

-,G/-/-

class/id of object

.content[integer]

string

string

S,G/D/C

listbox is filled from rules

.control

identifier

instance

-,G/-/-

control currently belonging to object

.cursor

identifier

cursor

S,G/D/C

cursor belonging to object

.cut_pending

boolean

boolean

S,G/-/-

cut operation not yet carried out

.cut_pending_changed

boolean

boolean

-,G/-/-

changing state during cut operation

.dialog

identifier

instance

-,G/-/-

dialog to which the object belongs

.document[integer]

object

document

S,G/-/-

accesses the I-th XML Document

.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

.fgc

identifier

color

S,G/D/C

foreground color

.firstchar

integer

integer

S,G/D/C

number of the first displayed character (horizontal scroll position).

.firstrecord

object

record

S,G/-/C

accesses the first record of an object

.focus

boolean

boolean

S,G/-/C

input focus on object

.focusitem

integer

integer

S,G/-/C

focusitem in a listbox

.font

identifier

font

S,G/D/C

object font

.function

identifier

func

S,G/D/C

function belonging to object

.groupbox

identifier

instance

-,G/-/-

object groupbox

.height

integer

integer

S,G/D/C

object height

.help

string

identifier

string

text

S,G/D/C

help text of object

.index

integer

index

integer

index

-,G/-/-

current index of object in the child list of its parent

.itemcount

integer

integer

S,G/D/C

number of listbox items

.label

string

string

S,G/D/C

name/identifier of object

.lastrecord

object

record

S,G/-/C

accesses the last record of an object

.layoutbox

object

object

-,G/-/-

layoutbox of object

.mapped

boolean

boolean

S,G/D/-

defers the display of a visibly created object

.member[integer]

attribute

attribute

-,G/-,-

user-defined attribute [I] of object

.membercount

integer

integer

-,G/-,-

number of user-defined attributes

.menu

identifier

instance

S,G/D/C

object menu

.model

identifier

instance

S,G/D/C

model belonging to object

.multisel

boolean

boolean

S,G/D/C

multiple selection in listbox

.nextactive[integer]

integer

integer

-,G/-/-

next selected item in listbox

.options[enum]

boolean

boolean

S,G/D/-

special options of object

.parent

identifier

instance

S,G/-/-

parent of object

.picheight

integer

integer

S,G/D/-

height of the space for pictures displayed left of the items

.picture[integer]

object

tile

S,G/D/C

picture for each item
(IDM for Windows and IDM for Qt)

.picture_hilite[integer]

object

tile

S,G,D,C

picture for each item when the item is selected
(IDM for Windows and IDM for Qt)

.picwidth

integer

integer

S,G/D/-

width of the space for pictures displayed left of the items

.posraster

boolean

boolean

S,G/D/C

positions refer to grid

.real_height

integer

integer

-,G/-/-

real height of object

.real_sensitive

boolean

boolean

-,G/-/-

real selectivity of object

.real_visible

boolean

boolean

-,G/-/-

real visibility of object

.real_width

integer

integer

-,G/-/-

real width of object

.real_x

integer

integer

-,G/-/-

real distance from left (in pixel)

.real_y

integer

integer

-,G/-/-

real distance from top (in pixel)

.record[integer]

object

record

S,G/-/C

accesses the I-th record of an object

.recordcount

integer

integer

-,G/-/-

queries the number of child records

.scope

integer
(1, 2, 3)

scope

-,G/-/-

queries the object type (Default, Model or instance)

.selstyle

enum

enum

S,G/-/C

multisel has become superfluous for tablefield and listbox by selstyle

.sensitive

boolean

boolean

S,G/D/C

selectivity of object

.sizeraster

boolean

boolean

S,G/D/C

size refers to grid of parent object

.statushelp

string

object

string

text

S,G/-/C

text to be displayed in statusbar

.toolbar

object

object

-,G/-/-

toolbar of object

.toolhelp

string

object

string

text

S,G/D/C

gives a short explanation of object at the cursor

.topitem

integer

integer

S,G/D/C

first displayed listbox item

.userdata

anyvalue

anyvalue

S,G/D/C

object userdata (any DM datatype)

.userdata[integer]

anyvalue

anyvalue

S,G/D/C

userdata of listbox items

.visible

boolean

boolean

S,G/D/C

visibility of object

.width

integer

may be 0

integer

S,G/D/C

actual width of object

.window

identifier

instance

-,G/-/-

window to which object belongs

.xauto

integer

(-1, 0, 1)

integer

S,G/D/C

definition type of x-coordinates

.xleft

integer

integer

S,G/D/C

x-coordinate, distance from left

.xright

integer

integer

S,G/D/C

x-coordinate, distance from right

.yauto

integer

(-1, 0, 1)

integer

S,G/D/C

definition type of y-coordinates

.ybottom

integer

integer

S,G/D/C

y-coordinate, distance from bottom

.ytop

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

Click

delete previous selection, activate current element

Shift + Click

maintain previous selection, activate area from last Click without Shift up to current element

Ctrl + Click

maintain previous selection, toggle activation of current element

Ctrl + Shift + Click

maintain previous selection, area from last Click without Shift up to current element maintains the activation state of the first one

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";

  }

}

Figure 13-22: Listbox