Progress
Language Tutorial
for Windows


Working with Combo Boxes

A combo box consists of a fill-in field or variable, a button, and a selection list. A combo box can display any single value from the selection list in the fill-in field. This single value can also be assigned to the underlying field or variable.

Progress provides the following types of combo-box widgets:

You can use the combo-box widget with a CHARACTER, INTEGER, DECIMAL, LOGICAL, or DATE field or variable. The value representations in the drop-down list conform to the data type of the underlying field or variable. Like radio sets and selection lists, combo boxes are useful for representing fields or variables that have a limited number of possible values. One advantage of combo boxes is that they take up less screen space than radio sets and selection lists.

To select a value in the graphical interface, the end user can apply the following techniques:

When the user selects an item, it triggers the VALUE-CHANGED event.

Thus, a combo box combines the functionality of a fill-in field, selection list, and radio set. It uses a fill-in field to display the selected item, and like a selection list displays a list of available values. Like a radio set, it supports sets of values for any Progress data type and allows selection of any one value at a time.

Figure 7–8 shows the parts of a combo box.

Figure 7–8: Parts of a Combo Box

This is the syntax for defining a combo box.

SYNTAX
VIEW-AS COMBO-BOX
  [ LIST-ITEMS item-list | LIST-ITEM-PAIRS item-pair-list ] 
  [ INNER-LINES lines ] [ size-phrase ] [ SORT ]
  [ TOOLTIP tooltip ]
  [ SIMPLE | DROP-DOWN | DROP-DOWN-LIST ]
  [ MAX-CHARS characters ] 
  [ AUTO-COMPLETION [ UNIQUE-MATCH ] ] 

Table 7–10 describes the combo box syntax elements.

Table 7–10: Combo Box Syntax
Element
Description
LIST-ITEMS
Specify a comma separated lists of values to populate the drop down list. Note that you can populate a combo box at run time in the same way you populate a selection list.
LIST-ITEM-PAIRS
Specify a list of label-value pairs. Each pair represents the label and value of a field or variable. When the user selects a label, Progress assigns the corresponding value to the field or variable.
INNER LINES
Specify the number of entries that the drop-down list can display. If you set INNER-LINES to less than the actual number of entries, the user can scroll through the drop-down list.
size-phrase
Specify the size of the widget in the interface. By default, Progress sizes the widget to correspond to the natural look of the native platform. Note that the height is always 1 on all platforms.
SORT
Sorts the LIST-ITEMS into alphabetical order.
TOOLTIP tooltip
Defines a text message string that automatically displays when the mouse pointer pauses over the combo box.
SIMPLE
Specify a combo-box widget with a read/write edit control and a selection list that is always visible.
DROP-DOWN
Specify a combo-box widget with a read/write edit control and a selection list that appears when you click the drop-down button.
DROP-DOWN-LIST
Specify a combo-box widget with a read-only edit control and a selection list that appears when you click the drop-down button. This is the default.
MAX-CHARS
Specify the maximum number of characters the edit control can hold.
AUTO-COMPLETION
Specify that the edit control automatically complete keyboard input to the combo-box, based on a potential match, by searching through the items in the drop-down list.
UNIQUE-MATCH
Specify that the edit control complete keyboard input to the combo-box, based on a unique match, by searching through the items in the drop-down list.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095