A List allows the user to select one or more items from a list. Each list item contains a text string, a bitmap graphic, or both.
Standard Properties:
class, enabled, height, left, look, parent, proto, sizeHControl, sizeVControl, top, version, visible, width.
sizeHControl, sizeVControl: Only SIZE_AS_NEEDED and SIZE_AS_SPECIFIED will be supported. SIZE_AS_NEEDED will only be partially supported: when the component becomes visible and their height or width is zero, the component will size itself to a default value.
behavior integer (0-2)
This property determines how many items may be selected at any one time.
0 At most one item.
1 Exactly one item.
2 Any number of items.
captions[] string
Array of strings to display. To change a list item's string, change the appropriate element of this array. To add a new list item to the end of the list, do something like the following:
list1.captions[list1.numItems] = "Last Minute Addition"
You may take advantage of this behavior to add several list items at a time:
list1.captions[list1.numItems + 9] = "Longstocking"
...would create 10 new list items, the first nine having blank captions, the last one having the caption "Longstocking."
To add a new list item in the middle of the list, use the Insert() action.
numItems integer (0-1024)
Number of items in the list. This property is read-only. To change the number of properties in the list, add items to the captions and/or graphics properties or use the Insert(), Delete(), or Clear() actions.
numSelections integer(0-numItems)
The number of items selected. This property is read-only.
numVisibleItems integer (1-15)
This property is ignored.
selectedItem integer(-1-(numItems-1))
The index a selected item, or -1 if there is no item selected. Changing the value of this property deselects all previously selected items and selects the item whose index is the new value of selectedItem; setting this property to -1 deselects all items in the list.
selections[numItems] integer (0-1)
This array keeps track of whether each item is selected. You may use this array to select and deselect items. If the list's behavior demands that exactly one item be selected, then setting an item unselected via the selections property (by settings its array element to zero) will have no effect.
_changed( self AS component, index AS integer )
This event is generated when the user clicks on a list item, causing that list item to be selected or unselected. Not all clicks result in a change of selection--only those clicks that do will generate this event.
self component
The List experiencing the event.
index integer (0-numItems)
If the List's behavior property is zero or one, then this argument is the index of the item the user selected or unselected.
If the List's behavior property is two, then this argument is the index of the first item currently selected in the list, or zero if there is no item selected.
This action deletes an item from the List.
If this deletes the selected item in an exclusive list (i.e., a list with behavior of 1), then the first list item, if any, will get the selection.
(To blank out a list item's string without deleting the item, set the appropriate element of the captions array to ".")