List Box (Single Field Multi-Column) Control Syntax

Syntax

[%C= CW . TCW [ ;H ] % Width [ " ], Height [ " ] Variable_Name ^# Choices [ ! Event ][ ? Enabled ] ]

Arguments

%C % ^#

Character. The leading [%C% and trailing ] and ^# characters are required.

CW

Numeric. Column width in characters.

;H

Character. Enables horizontal scrolling.

Width

Numeric. The width of the control.

Height

Numeric. The height of the control.

Variable_Name

Character. The name of a character variable to receive the user selection, or a numeric variable to receive the index value of the selected radio button. The index of the top-most button is 1.

Choices

Character. See Choices Syntax. You must either use the use {DATA} command or the K Directive to preserve the formatting of selected items.

Event

Character. Optional. See Event Syntax.

Enabled

Logical. Optional. See Enabled Syntax.

Description

One or more Multi-Select List Box objects may appear inside the Format section of a UI_DLG_BOX() function. The selections are stored in the %mw% variable.

You must have an Event if you want to respond to the user's selection in the Code section of the dialog box.

Example

For example, the following script allows you to select multiple cities:

cities = <<%dlg%
Atlanta
New York
Los Angeles
Boston
Johannesburg
Sydney
%dlg%
ui_dlg_box("Multi-Select List Box",<<%dlg%
{wrap=30}
%M%.30,5cities_chosen^#cities;
{line=1,0};
This variable shows what entries in the above list box are selected.;
%mw%.30,5cities_chosen;

%dlg%)
images/XD_Multi_Column_List_Box.gif

This example changes the justification of alternate rows:

list = <<%txt%
Amount
{J=R}$7.23
Balance
{J=R}$2.34
%txt%
ui_dlg_box("test","%O={@@}%.30,20selected^#list")
images/XD_Multi_Column_Single_Field_List_Box.gif

See Also