A listbox is used to select one or more of a list of strings.
The strings are displayed in a scrolling box, with the selected string(s) marked in reverse video. A listbox can be single selection (if an item is selected, the previous selection is removed) or multiple selection (clicking an item toggles the item on or off independently of other selections).
List box elements are numbered from zero and while the maximal number of elements is unlimited, it is usually better to use a virtual control, not requiring to add all the items to it at once, such as wxDataViewCtrl (not implemented in wx) or wxListCtrl with wxLC_VIRTUAL style, once more than a few hundreds items need to be displayed because this control is not optimized, neither from performance nor from user interface point of view, for large number of items.
Notice that the list box doesn't support control characters other than TAB.
This class supports the following styles:
wxWidgets docs: wxListBox
new() -> wxListBox()
new(Parent, Id) -> wxListBox()
new(Parent, Id, Options :: [Option]) -> wxListBox()
Constructor, creating and showing a list box.
See the other new/3 constructor; the only difference is that this overload takes a wxArrayString (not implemented in wx) instead of a pointer to an array of wxString (not implemented in wx).
destroy(This :: wxListBox()) -> ok
Destructor, destroying the list box.
create(This, Parent, Id, Pos, Size, Choices) -> boolean()
create(This, Parent, Id, Pos, Size, Choices, Options :: [Option]) ->
deselect(This, N) -> ok
Deselects an item in the list box.
Remark: This applies to multiple selection listboxes only.
getSelections(This) -> Result
insertItems(This, Items, Pos) -> ok
Insert the given number of strings before the specified position.
isSelected(This, N) -> boolean()
Determines whether an item is selected.
Return: true if the given item is selected, false otherwise.
set(This, Items) -> ok
Replaces the current control contents with the given items.
Notice that calling this method is usually much faster than appending them one by one if you need to add a lot of items.
hitTest(This, Point) -> integer()
Returns the item located at point, or wxNOT_FOUND if there is no item located at point.
It is currently implemented for wxMSW, wxMac and wxGTK2 ports.
Return: Item located at point, or wxNOT_FOUND if unimplemented or the item does not exist.
hitTest(This, X, Y) -> integer()
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
setFirstItem(This, N) -> ok
setFirstItem(This, String) -> ok
Set the specified item to be the first visible item.