SELECTION-LIST phrase
Describes the selection-list representation of a field or variable. A selection-list is a scrollable list of values. The SELECTION-LIST phrase is an option of the VIEW-AS phrase.
Note: Does not apply to SpeedScript programming.Syntax
SINGLEMULTIPLENO-DRAG
Specifies that the user cannot select items by simultaneously holding down the mouse select button and dragging the mouse through the list.If you specify NO-DRAG then the DRAG-ENABLED attribute is set to FALSE. You can set the DRAG-ENABLED attribute only before the selection-list is realized. The default is TRUE.In Windows, DRAG-ENABLED is always TRUE and the NO-DRAG option is ignored.LIST-ITEMSitem-list
LIST-ITEM-PAIRSitem-pair-list
Specifies a list of label-value pairs. Each pair represents a label and value of the associated field or variable. When the selection-list appears, it displays each pair’s label. Then, if the user selects a label, the AVM assigns the corresponding value to the field or variable. The syntax foritem-pair-list
is as follows:
label
value
SCROLLBAR-VERTICALSCROLLBAR-HORIZONTALsize-phrase
Specifies the outside dimensions of the selection-list widget. Following is the syntax for thesize-phrase
:
For more information, see the SIZE phrase reference entry.INNER-CHARScols
INNER-LINESrows
Specifies the number of character positions visible in each line of the selection-list and the number of lines visible in the selection-list. Bothcols
androws
must be integer constants.Note that the values you supply for INNER-CHARS and INNER-LINES specify only the size of the list, not the overall size of the selection-list widget. The overall size is determined by the size of the list plus the sizes of the margin and border heights and widths.SORTTOOLTIPtooltip
Allows you to define a help text message for a text field or text variable. The AVM automatically displays this text when the user pauses the mouse button over a text field or text variable for which a tooltip is defined.You can add or change the TOOLTIP option at any time. If TOOLTIP is set to "" or the Unknown value (?
), then the tooltip is removed. No tooltip is the default. The TOOLTIP option is supported in Windows only.ExampleThe
r-select.p
procedure prompts the user for a directory name and then populates a selection-list with the contents of the specified directory. After the user selects an item from the selection-list, the procedure echoes back the selection.The procedure uses the INPUT FROM statement to read the contents of the user-specified directory and creates a comma-separated list of all the file and directory names in the directory. It then assigns the comma-separated list to the LIST-ITEMS attribute of the selection-list. Because an assignment to an attribute depends on the widget being located in a frame, the DEFINE FRAME statement is used to locate the selection-list.
Notes
- When the selection-list appears, if it contains the value of the associated field or variable, that value is initially highlighted. Otherwise, no value in the selection-list is initially highlighted.
- The LIST-ITEMS option of the SELECTION-LIST phrase requires a list of quoted items ("a", "b", "c"), whereas the LIST-ITEMS attribute of a selection-list requires a quoted list of items ("a, b, c"). Similarly, the LIST-ITEM-PAIRS option of the SELECTION-LIST phrase requires a list of quoted items ("a", "1", "b", "2", "c", "3"); whereas the LIST-ITEM-PAIRS attribute of a selection-list requires a quoted list of items ("a, 1, b, 2, c, 3").
- If you specify the SORT option for a selection-list, then any items you add with ADD-FIRST, ADD-LAST, or INSERT methods are added in sorted order rather than the order you specify.
- In Windows, you can use a mnemonic to transfer focus to the selection-list.
See also
OpenEdge Release 10.2B
|