Contents Up Previous Next

wxListBox is-a wxItem

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

wxListBox values
wxListBox multiple
wxListBox create
wxListBox append
wxListBox find-string
wxListBox clear
wxListBox get-selection
wxListBox get-string-selection
wxListBox set-selection
wxListBox set-string-selection
wxListBox number
wxListBox delete-item
wxListBox get-string
wxListBox get-first-selection
wxListBox get-next-selection


wxListBox values

multifield values

List of string values for initializing the wxListBox item.


wxListBox multiple

bool multiple

Initalize to TRUE for a multi-selection listbox, FALSE for a single-selection listbox.


wxListBox create

void ( create)

Creates a list box item on the given panel or dialog box. The following slots may be initialized.

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).


wxListBox append

bool ( append string item optional string client-data)

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


wxListBox find-string

long ( find-string string item)

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


wxListBox clear

bool ( clear)

Clear all strings from the list box.


wxListBox get-selection

long ( get-selection)

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


wxListBox get-string-selection

string ( get-string-selection)

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


wxListBox set-selection

bool ( set-selection long item-pos bool flag=TRUE)

Set a selection by item position.

If flag is TRUE, the item will be selected, otherwise it will be deselected (multiple-selection listboxes only).


wxListBox set-string-selection

bool ( set-string-selection string item)

Set a selection by string.


wxListBox number

long ( number)

Return the number of items in the list box.


wxListBox delete-item

bool ( delete-item long item-pos)

Delete an item in the list box.


wxListBox get-string

string ( get-string long item-pos)

Return the string at the given position.


wxListBox get-first-selection

long ( get-first-selection)

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


wxListBox get-next-selection

long ( get-next-selection)

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