]>
git.saurik.com Git - wxWidgets.git/blob - interface/choice.h
42a813237ee1a7131f5f52bd017874400ec0123c
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxChoice class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A choice item is used to select one of a list of strings. Unlike a
14 listbox, only the selection is visible until the user pulls down the
19 Sorts the entries alphabetically.
23 @event{EVT_CHOICE(id, func)}:
24 Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the
30 @appearance{choice.png}
33 wxListBox, wxComboBox, wxCommandEvent
35 class wxChoice
: public wxControlWithItems
40 Constructor, creating and showing a choice.
43 Parent window. Must not be @NULL.
45 Window identifier. The value wxID_ANY indicates a default value.
49 Window size. If wxDefaultSize is specified then the choice is
53 Number of strings with which to initialise the choice control.
55 An array of strings with which to initialise the choice control.
57 Window style. See wxChoice.
63 @see Create(), wxValidator
66 wxChoice(wxWindow
* parent
, wxWindowID id
,
68 const wxSize
& size
, int n
,
69 const wxString choices
[],
71 const wxValidator
& validator
= wxDefaultValidator
,
72 const wxString
& name
= "choice");
73 wxChoice(wxWindow
* parent
, wxWindowID id
,
76 const wxArrayString
& choices
,
78 const wxValidator
& validator
= wxDefaultValidator
,
79 const wxString
& name
= "choice");
83 Destructor, destroying the choice item.
89 Creates the choice for two-step construction. See wxChoice().
91 bool Create(wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
,
92 const wxSize
& size
, int n
,
93 const wxString choices
[],
95 const wxValidator
& validator
= wxDefaultValidator
,
96 const wxString
& name
= "choice");
97 bool Create(wxWindow
* parent
, wxWindowID id
,
100 const wxArrayString
& choices
,
102 const wxValidator
& validator
= wxDefaultValidator
,
103 const wxString
& name
= "choice");
107 Gets the number of columns in this choice item.
109 @remarks This is implemented for Motif only and always returns 1 for the
115 Unlike wxControlWithItems::GetSelection which only
116 returns the accepted selection value, i.e. the selection in the control once
117 the user closes the dropdown list, this function returns the current selection.
118 That is, while the dropdown list is shown, it returns the currently selected
119 item in it. When it is not shown, its result is the same as for the other
121 This function is new since wxWidgets version 2.6.2 (before this version
122 wxControlWithItems::GetSelection itself behaved like
125 int GetCurrentSelection();
128 Sets the number of columns in this choice item.
133 void SetColumns(int n
= 1);