27 poptext (Combobox)

With this object textual information can be displayed in a space-saving way, if only one piece of information out of several pieces of information is needed.

Definition

{ export | reexport } { model } poptext { <Identifier> }
{
  <standard attributes>
  <plain attributes>
  <geometry attributes>
  <hierarchy attributes>
  <layout attributes>
  <text attributes>
  <object-specific attributes>
}

In the description combobox is used as a synonym for poptext.

Events

activate

charinput

cut

deselect

deselect_enter

extevent

focus

help

key

modified

paste

select

Children

document

record

transformer

Parent

groupbox

layoutbox

module

notepage

splitbox

toolbar

window

Menu

Pop-up menu

27.1 Attributes

Attribute

RSD

PSD

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 text item of combobox

.alignment

integer

(-1, 0, 1)

integer

S,G/D/C

text alignment

.bgc

identifier

color

S,G/D/C

background color of object

.borderraster

boolean

boolean

S,G/D/-

controls computation of geometry with active grid

.class

class

class

-,G/-/-

object class

.content

string

string

S,G/-/-

displayed text of object

.control

identifier

instance

-,G/-/-

control which the object belongs to

.cursor

identifier

cursor

S,G/D/C

cursor belonging to the object

.cut_pending

boolean

boolean

S,G/-/-

cut operation has not been executed yet

.cut_pending_changed

boolean

boolean

-,G/-/-

state of change during cut operation

.dialog

identifier

instance

-,G/-/-

dialog for object

.document[integer]

object document S,G/-/-

accesses the I-th XML Document

.editable

boolean

boolean

S,G/D/C

editability of editable text

.endsel

integer

integer

S,G/D/C

end of the selection in the input field

.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 of object

.firstrecord

object

record

S,G/-/C

accesses the first record of an object

.focus

boolean

boolean

-,G/-/-

keyboard focus of object

.font

identifier

font

S,G/D/C

font of object

.function

identifier

func

S,G/D/C

function of object

.format

string

identifier

string

format

S,G/D/C

formatstring of a text

.formatfunc

identifier

func

S,G/D/C

link of application function to editable text

.groupbox

identifier

instance

-,G/-/-

groupbox which the object currently belongs to

.height

integer

integer

S,G/D/C

indicates height of object

.help

string

identifier

string

text

S,G/D/C

helptext of object

.hinttext string string S,G/D/C placeholder text of object (see also chapter “Notes for attribute .hinttext”)

.index

integer

integer

-,G/-/-

current index of object in the child list of its parent

.itemcount

integer

integer

S,G/D/C

number of elements in combobox

.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

.maxchars

integer

integer

S,G/D/C

maximum number of characters to be input in edittext

.member[integer]

attribute

attribute

-,G/-/-

i-th user-defined attribute of object

.membercount

integer

integer

-,G/-/-

number of user-defined attributes

.menu

identifier

instance

S,G/D/C

menu of object

.model

identifier

instance

S,G/D/C

model belonging to model

.notepage

identifier

instance

-,G/-/-

notepage which object currently belongs to

.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

indication of positions refers to raster

.real_height

integer

integer

-,G/-/-

actual height of object

.real_modified

boolean

boolean

-,G/-/-

actual change of content

.real_sensitive

boolean

boolean

-,G/-/-

actual selectability of object

.real_visible

boolean

boolean

-,G/-/-

actual visibility of object

.real_width

integer

integer

-,G/-/-

actual width of object

.real_x

integer

integer

-,G/-/-

real distance to left (in pixel)

.real_y

integer

integer

-,G/-/-

real distance to 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)

.sensitive

boolean

boolean

S,G/D/C

selectability of object

.showitem

integer

integer

S,G/D/C

number of visible items

.sizeraster

boolean

boolean

S,G/D/C

size referring to raster of parent object

startsel

integer

integer

S,G/D/C

start of the selection in the input field

.statushelp

string

identifier

string

text

S,G/D/C

text to be displayed in statusbar

.style

class

class

S,G/D/C

type of poptext, normal, editable (combobox) or listbox-like

.text

string

identifier

string

text

S,G/D/C

sets individual texts

.toolbar

object object -,G/-/- toolbar of object

.userdata

anyvalue

anyvalue

S,G/D/C

userdata of object of any datatype

.userdata[integer]

anyvalue

anyvalue

S,G/D/C

userdata of combobox items of any datatype

.visible

boolean

boolean

S,G/D/C

visibility of object

.width

integer

may be 0

integer

S,G/D/C

current width of object

.window

identifier

instance

-,G/-/-

window which object currently belongs to

.xauto

integer

(-1, 0, 1)

integer

S,G/D/C

type of x-coordinatedefinition

.xleft

integer

integer

S,G/D/C

x-coordinate, distance to the left

.xright

integer

integer

S,G/D/C

x-coordinate, distance to the right

.yauto

integer

(-1, 0, 1)

integer

S,G/D/C

type of y-coordinate definition

.ybottom

integer

integer

S,G/D/C

y-coordinate, distance to bottom

.ytop

integer

integer

S,G/D/C

y-coordinate, distance to top

27.2 Specific Attributes

Standard Attributes

In the combobox there is a .userdata attribute for each item which can be accessed by index. Without an index the usual .userdata attribute will be accessed.

Plain Attributes

These attributes are used to define size and position of the combobox. If the attributes .width or .height are set to 0, the DM will calculate the corresponding size automatically.

Attribute to control the creation of the activate and select events

The attribute .options[opt_old_select] controls the creation of the activate and select events, it is normally set to false.

If the attribute .options[opt_old_select] is set to false, then the select/activate events will be generated analog to the other sample objects, such as the listbox and treeview.

First modification to the old behavior is that the activate events no longer indicate the receiving of the focus (edittext and listbox style), but rather show a change in the activation status (.activeitem attribute). Secondly, a select event is only created by a "completed" selection of the user. This is true even when the same entry is selected a second time. In this sense "completed" means that the list is closed (exception: comment (1) and (2)) or when the modification does not require that the list be made visible.

Data type

boolean

Value range

false, true

Default value

false

Access

get, set

Supported on

Microsoft Windows, Unix

Summary

For a poptext with the attribute .options[opt_old_select]=false, the select and activate where triggered under the following conditions:

Action

Motif 1.2

Motif 2.1

MS Win

Event

cursor selection

(close list, on different entry)

*

 

*

 

*

-

activate and select

cursor selection

(open list, on different entry)

*

 

*

 

*

-

activate (and select in listbox style)

mouse selection

(list open, same entry)

*

*

*

select

mouse selection

(list open, different entry)

*

*

*

activate and select

close list

(i.e. Return but no mouse selection)

*

*

*

select

abort list (2)

(i.e. Esc)

*

*

*

activate in order to return to original entry

Comments

  1. The poptext list in the style listbox is always open. Therefore the keyboard selection behaves analog to the mouse selection. Naturally, in this style the list cannot be "aborted".
  2. Only on some window systems is it possible to abort an open list.
  3. The keys which can be used for cursor selection is dependent upon the system in use; normally these are the Up and Down cursor keys.

Example for the use of separate events with .options[opt_old_select] = false

Text Attributes

Text attributes are active in the styles "edittext" and "listbox" only. Usually (.style poptext) these attributes are ignored. .content is only readable in Style poptext. .content is a dynamic attribute in a combobox. It may be set during runtime only. This attribute cannot be defined statically in the dialog file.

The combobox contains three different types of representation and editability. These types are controlled with the attribute .style:

The event processing in the combobox (.style edittext or listbox) is different from the actual edittext. The select event for the combobox behaves different from the one for the edittext.

With the styles .style = edittext and .style = listbox, the attribute .real_modified indicates, whether the content actually has changed since the combobox has received the focus.

Notes for attribute .hinttext

This attribute is supported only by Windows and Qt. The poptext object must have the edittext style set.

On Windows, .hinttext is also supported if the attribute .style has the value listbox.

Note for Dialog Manager on Microsoft Windows

The height of a combobox cannot be set. The corresponding window system will automatically choose a value depending on the font.

The poptext supports Dialog Manager opt_hscroll option as of IDM version A.06.01.h. The horizontal scrollbar appears within the display area and thus covers the lowest lines. A vertical scrollbar is then also displayed for this purpose. Since the operation of scrollbars in an open list is not easy for the user, this option should only be used if there is no other solution.

Note for Dialog Manager on Motif

The attribute .showitem is not available since Motif version 2.1

27.3 Example

window PoptextDemo

{

  .active false;

  .title "PoptextDemo";

  child poptext Poptext

  {

    .xleft 5;

    .ytop 1;

    .text[1] "Item 1";

    .text[2] "Item 2";

    .text[3] "Item 3";

    .text[4] "Item 4";

    .activeitem 1;

    .showitem 4;

  }

  child poptext Combox

  {

    .xleft 20;

    .ytop 1;

    .text[1] "Combo 1";

    .text[2] "Combo 2";

    .text[3] "Combo 3";

    .text[4] "Combo 4";

    .activeitem 1;

    .style edittext;

    .showitem 4;

  }

  child poptext Listbox

  {

    .xleft 34;

    .ytop 1;

    .height 5;

    .text[1] "List 1";

    .text[2] "List 2";

    .text[3] "List 3";

    .text[4] "List 4";

    .text[5] "List 5";

    .text[6] "List 6";

    .text[7] "List 7";

    .text[8] "List 8";

    .activeitem 1;

    .style listbox;

  }

}

Figure 13-33: Window showing the different combobox shapes