182
Format 1: Define/Create List Box
LIST_BOX ctl_id,@(col,ln,wth,ht)[,ctrlopt]
Use this format to define or create a list box and give it a unique identifier in ctl_id.
When a user selects an item from a list box, the item's associated ctl_id is used in
generating a CTL value. Use an integer or numeric expression between -32000 and
+32000 for the ctl_id. The standard list box format lists a single element of data in a
single column format. Depending on the implementation, list box appearance and
format type may be changed using the following control options:
FNT= sets the font for the list box. If you omit this option, ProvideX uses the system
default font. Use FNT="*" asterisk to set the font to the standard text-mode fixed font.
Note: Some of the settings (including OPT="r", OPT="l", and OPT="e") are used
specifically for the creation of List View, Tree View list boxes.
FMT= defines various attributes, including column/row sizing, titles and images
depending on list box requirements. For more elaborate list box styles, see
The example below creates a standard list box that generates a CTL=100 when an
item is selected from it and uses FNT=text mode fixed font. The list box is loaded with
the items Dog, Cat, and Pig. The programmer writes Cat as the initial/highlighted
selection and removes Dog from the top of the list.
0010
PRINT 'CS'; LIST
0020
LIST_BOX 100,@(2,14,12,6),FNT="*"
0030
LIST_BOX LOAD 100,"Dog/Cat/Pig/"; WAIT 1
0040
LIST_BOX WRITE 100,"Cat"; WAIT 1
0050
LIST_BOX LOAD 100,1,*; WAIT 1
0060
END
Note: The LIST_BOX formats described below apply to all list box types.
Format 2: Remove
LIST_BOX REMOVE ctl_id[,ERR=stmtref]
Use the LIST_BOX REMOVE format to delete a list box. (To delete an individual
element, use the LIST_BOX LOAD directive instead.)
Format 3: Disable/Enable
LIST_BOX {DISABLE | ENABLE} ctl_id[,ERR=stmtref]
Use the LIST_BOX DISABLE format to gray out a list box so that it will be visible but
inaccessible to users. To reactivate it, use LIST_BOX ENABLE.