.\" This is a wxWidgets manpage page generated from the XML docs .TH wxListBox 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxListBox \- A list of strings for single or multiple selection .SH DESCRIPTION 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. Their number is limited in some platforms (e.g. ca. 2000 on GTK). A listbox callback gets an event wxEVT_COMMAND_LISTBOX_SELECT for single clicks, and wxEVT_COMMAND_LISTBOX_DOUBLE_CLICKED for double clicks. .SH "PARENTS" wxControlWithItems wxControl wxWindow wxEvtHandler wxObject .SH "INCLUDE FILES" wx/listbox.h .SH MEMBERS .SS wxListBox () Default constructor. .SS wxListBox (wxWindow* parentwxWindowID idconst wxPoint& pos = wxDefaultPositionconst wxSize& size = wxDefaultSizeint nconst wxString choices[] = NULLlong style = 0const wxValidator& validator = wxDefaultValidatorconst wxString& name = ``listBox") .SS wxListBox (wxWindow* parentwxWindowID idconst wxPoint& posconst wxSize& sizeconst wxArrayString& choiceslong style = 0const wxValidator& validator = wxDefaultValidatorconst wxString& name = ``listBox") .SS void ~wxListBox () Destructor, destroying the list box. .SS bool Create (wxWindow* parentwxWindowID idconst wxPoint& pos = wxDefaultPositionconst wxSize& size = wxDefaultSizeint nconst wxString choices[] = NULLlong style = 0const wxValidator& validator = wxDefaultValidatorconst wxString& name = ``listBox") .SS bool Create (wxWindow* parentwxWindowID idconst wxPoint& posconst wxSize& sizeconst wxArrayString& choiceslong style = 0const wxValidator& validator = wxDefaultValidatorconst wxString& name = ``listBox") Creates the listbox for two-step construction. See wxListBox::wxListBox for further details. .SS void Deselect (int n) Deselects an item in the list box. .SS int GetSelections (wxArrayInt& selections) Fill an array of ints with the positions of the currently selected items. .SS void InsertItems (int nItemsconst wxString *itemsint pos) .SS void InsertItems (const wxArrayString& nItemsint pos) Insert the given number of strings before the specified position. .SS bool IsSelected (int n) Determines whether an item is selected. .SS void Set (int nconst wxString* choicesvoid **clientData = NULL) .SS void Set (const wxArrayString& choicesvoid **clientData = NULL) Clears the list box and adds the given strings to it. .SS void SetFirstItem (int n) .SS void SetFirstItem (const wxString& string) Set the specified item to be the first visible item. Windows only. .SH "WINDOW STYLES" .SS wxLB_SINGLE Single-selection list. .SS wxLB_MULTIPLE wxLB_MULTIPLE .SS wxLB_EXTENDED wxLB_EXTENDED .SS wxLB_HSCROLL Create horizontal scrollbar if contents are too wide (Windows only). .SS wxLB_ALWAYS_SB Always show a vertical scrollbar. .SS wxLB_NEEDED_SB Only create a vertical scrollbar if needed. .SS wxLB_SORT The listbox contents are sorted in alphabetical order. .SH EVENTS .SS EVT_LISTBOX(id, func) Process a wxEVT_COMMAND_LISTBOX_SELECTED event, when an item on the list is selected. .SS EVT_LISTBOX_DCLICK(id, func) Process a wxEVT_COMMAND_LISTBOX_DOUBLECLICKED event, when the listbox is double-clicked. .SH "SEE ALSO" wxControlWithItems wxControl wxWindow wxEvtHandler wxObject wxChoice wxComboBox wxListCtrl , wxCommandEvent .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.