Contents Up Previous Next

Listbox

A listbox displays a choice of strings. It must be the child of a panel. In a single-selection listbox, only one choice may be highlighted. In a multiple-selection listbox, several may be highlighted.

list-box-create
list-box-append
list-box-find-string
list-box-clear
list-box-get-selection
list-box-get-string-selection
list-box-is-selected
list-box-set-selection
list-box-set-string-selection
list-box-number
list-box-delete
list-box-get-string
list-box-get-first-selection
list-box-get-next-selection


list-box-create

long ( list-box-create long panel-id string callback string label
long multiple, optional long x optional long y
optional long width optional long height optional string style optional string name)

Creates a list box item on the given panel. The callback may be the empty string ("'') to denote no callback, or a word or string for the function name. The function will be called when an item in the list box is selected or deselected, with the list box ID as argument. The value of multiple should be 1 if multiple selections are required, or 0 if only a single selection is required.

style is a bit list of some of the following:

wxNEEDED_SB Create scrollbars if needed.
wxALWAYS_SB Create scrollbars immediately.
wxHSCROLL Create horizontal scrollbar if contents are two wide (Windows only).

name gives the group box a name that can be retrieved with window-get-name.

If no position is given, the panel item is placed after the last item. The value -1 may be passed to denote a default, so that the position may be left unspecified and the size given.


list-box-append

long ( list-box-append long list-box-id string item
optional string client-data)

Append a string to the list box, with an optional client data string.


list-box-find-string

long ( list-box-find-string long list-box-id string item)

Find the string in the list box and return the integer position if found, -1 if not.


list-box-clear

long ( list-box-clear long list-box-id)

Clear all strings from the list box.


list-box-get-selection

long ( list-box-get-selection long list-box-id)

Get the position of the selection (for single-selection list boxes only).


list-box-get-string-selection

string ( list-box-get-string-selection long list-box-id)

Get the selected string (for single-selection list boxes only).


list-box-is-selected

long ( list-box-is-selected long list-box-id long item)

Returns 1 if item is selected, 0 otherwise.


list-box-set-selection

long ( list-box-set-selection long list-box-id long item-pos long flag=1)

Set a selection by item position.

If flag is 1, the item is selected, otherwise it is deselected.


list-box-set-string-selection

long ( list-box-set-string-selection long list-box-id string item)

Set a selection by string.


list-box-number

long ( list-box-number long list-box-id)

Return the number of items in the list box.


list-box-delete

long ( list-box-delete long list-box-id long item-pos)

Delete an item in the list box.


list-box-get-string

string ( list-box-get-string long list-box-id long item-pos)

Return the string at the given position.


list-box-get-first-selection

long ( list-box-get-first-selection long list-box-id)

Get the first selection position in a multi-selection list box (-1 for no more selections).


list-box-get-next-selection

long ( list-box-get-next-selection)

Get the next selection position in a multi-selection list box (-1 for no more selections).