ucombobox (Combo Box)

The ucombobox widget combines an input field with a drop-down list. It allows users to select one item from a previously defined list, or enter their own data instead. It is applicable only to form components. Uniface provides a logical widget called ComboBox, which is mapped to ucombobox.

ComboBox widget

For more information, see Specifying a Widget for a Field or Entity.

Widget Overview
Logical widget name: ComboBox
Maps to physical widget:

ucombobox

Default definition: ComboBox=ucombobox(font=listfont;dimmedbackcolor=off;autoselect=on)
Use for: String fields with ValRep list.
Supported triggers: trigger valueChanged
Supported properties: See Widget Properties
Supported in egrid(Grid) widget? Yes. Some properties may not be applicable.

For more information, see egrid (Grid) and Widgets and Properties Supported in Grid Widget.

Supports MSAA? : Yes, for testing purposes only. For more information, see Accessibility.

Description

A combo box is similar to an editable drop-down list. It consists of an edit box together with a selection list of predefined items. The list appears when the user clicks a button to the right of the editable section.

If the Insert Mode property is set to Unique or Always, any value entered by the user is added to the drop-down list. This is only in effect for the lifetime of the widget instance. If you require more permanent storage of user entries, use ProcScript to do this.

Uniface sets the field to the value associated with the selected item and activates the valueChanged trigger for that field. This is the only trigger that can be activated by a combo box is the valueChanged trigger.

This widget is not available in character mode. It is mapped to a text field.

Note:  The values specified for a field with a ucombobox are limited to 255 characters. If the value is greater than this, the field becomes read-only.

ValRep Handling

Unlike the DropDown and ListBox widgets, the ComboBox only displays values. If the ValRep list assigned to the field contains Representations, these are ignored.

For more information, see ValRep

Widget Properties

Combo Box Widget Properties

Property

Technical Name

Dynamic?

3-D Effect (3d)

3D

No

Attach to Window Border (attach)

Attach

Yes

Auto Select (autoselect)

AutoSelect

Yes

Background Color (BackColor)

BackColor

Yes

Dimmed Background Color (DimmedBackColor)

DimmedBackColor

Yes

Bottom Line (BottomLine)

BottomLine

Yes

Draw 3-D Frame Outside (DrawOutside)

DrawOutside

No

Visible Entries (Entries)

Entries

Yes

Force Fit

ForceFit

No

Foreground Color (ForeColor)

ForeColor

Yes

Frame

Frame

No

Insertion Mode

Insert

No

Label Font (LabelFont)

LabelFont

Yes

Show Ellipsis

ShowEllipsis

No

Sort Alphabetically

Sort

No

Value

Not mapped to a widget property, but is handled in the same way as a ValRep list.

Widget Font (Font)

Font

Yes

Attach Margin (AttachMargin)

 

Yes

Double-Click (DblClk)

DblClk

Yes

Popup Rectangle (PopupRect)

 

Yes

Note:  The Frame and 3-D Effect properties are only supported on 16-bit Windows platforms.

Related Topics