]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/choice.tex
Fixed wxToolBar for WinCE so normal bitmaps can be used;
[wxWidgets.git] / docs / latex / wx / choice.tex
CommitLineData
a660d684
KB
1\section{\class{wxChoice}}\label{wxchoice}
2
3A choice item is used to select one of a list of strings. Unlike a
4listbox, only the selection is visible until the user pulls down the
5menu of choices.
6
7\wxheading{Derived from}
8
bed5584e 9\helpref{wxControlWithItems}{wxcontrolwithitems}\\
a660d684
KB
10\helpref{wxControl}{wxcontrol}\\
11\helpref{wxWindow}{wxwindow}\\
12\helpref{wxEvtHandler}{wxevthandler}\\
13\helpref{wxObject}{wxobject}
14
954b8ae6
JS
15\wxheading{Include files}
16
17<wx/choice.h>
18
a660d684
KB
19\wxheading{Window styles}
20
21There are no special styles for wxChoice.
22
23See also \helpref{window styles overview}{windowstyles}.
24
5de76427
JS
25\wxheading{Event handling}
26
27\twocolwidtha{7cm}
28\begin{twocollist}\itemsep=0pt
29\twocolitem{{\bf EVT\_CHOICE(id, func)}}{Process a wxEVT\_COMMAND\_CHOICE\_SELECTED event,
30when an item on the list is selected.}
31\end{twocollist}
32
a660d684
KB
33\wxheading{See also}
34
5de76427
JS
35\helpref{wxListBox}{wxlistbox}, \helpref{wxComboBox}{wxcombobox},
36\rtfsp\helpref{wxCommandEvent}{wxcommandevent}
a660d684
KB
37
38\latexignore{\rtfignore{\wxheading{Members}}}
39
f510b7b2 40\membersection{wxChoice::wxChoice}\label{wxchoicector}
a660d684
KB
41
42\func{}{wxChoice}{\void}
43
44Default constructor.
45
eaaa6a06 46\func{}{wxChoice}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},\rtfsp
a660d684 47\param{const wxPoint\& }{pos}, \param{const wxSize\&}{ size},\rtfsp
eaaa6a06
JS
48\param{int}{ n}, \param{const wxString }{choices[]},\rtfsp
49\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``choice"}}
a660d684 50
56b88f12
MB
51\func{}{wxChoice}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},\rtfsp
52\param{const wxPoint\& }{pos}, \param{const wxSize\&}{ size},\rtfsp
53\param{const wxArrayString\& }{choices},\rtfsp
54\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``choice"}}
55
a660d684
KB
56Constructor, creating and showing a choice.
57
58\wxheading{Parameters}
59
60\docparam{parent}{Parent window. Must not be NULL.}
61
62\docparam{id}{Window identifier. A value of -1 indicates a default value.}
63
64\docparam{pos}{Window position.}
65
66\docparam{size}{Window size. If the default size (-1, -1) is specified then the choice is sized
67appropriately.}
68
69\docparam{n}{Number of strings with which to initialise the choice control.}
70
71\docparam{choices}{An array of strings with which to initialise the choice control.}
72
73\docparam{style}{Window style. See \helpref{wxChoice}{wxchoice}.}
74
75\docparam{validator}{Window validator.}
76
77\docparam{name}{Window name.}
78
79\wxheading{See also}
80
81\helpref{wxChoice::Create}{wxchoicecreate}, \helpref{wxValidator}{wxvalidator}
82
c9110876
VS
83\pythonnote{The wxChoice constructor in wxPython reduces the {\tt n}
84and {\tt choices} arguments are to a single argument, which is
06d20283
RD
85a list of strings.}
86
5873607e
VZ
87\perlnote{In wxPerl there is just an array reference in place of {\tt n}
88and {\tt choices}.}
89
f510b7b2 90\membersection{wxChoice::\destruct{wxChoice}}\label{wxchoicedtor}
a660d684
KB
91
92\func{}{\destruct{wxChoice}}{\void}
93
94Destructor, destroying the choice item.
95
a660d684
KB
96\membersection{wxChoice::Create}\label{wxchoicecreate}
97
eaaa6a06 98\func{bool}{Create}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},\rtfsp
a660d684 99\param{const wxPoint\& }{pos}, \param{const wxSize\&}{ size},\rtfsp
eaaa6a06 100\param{int}{ n}, \param{const wxString }{choices[]},\rtfsp
f6e9a818
RN
101\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
102\param{const wxString\& }{name = ``choice"}}
a660d684 103
56b88f12
MB
104\func{bool}{Create}{\param{wxWindow *}{parent}, \param{wxWindowID}{ id},\rtfsp
105\param{const wxPoint\& }{pos}, \param{const wxSize\&}{ size},\rtfsp
106\param{const wxArrayString\& }{choices},\rtfsp
f6e9a818
RN
107\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
108\param{const wxString\& }{name = ``choice"}}
56b88f12 109
f510b7b2 110Creates the choice for two-step construction. See \helpref{wxChoice::wxChoice}{wxchoicector}.
a660d684 111
645420d8
VZ
112\membersection{wxChoice::Delete}\label{wxchoicedelete}
113
114\func{void}{Delete}{\param{int }{n}}
115
116Deletes the item with the given index from the control.
117
118\wxheading{Parameters}
119
120\docparam{n}{The item to delete.}
121
a660d684
KB
122\membersection{wxChoice::GetColumns}\label{wxchoicegetcolumns}
123
124\constfunc{int}{GetColumns}{\void}
125
126Gets the number of columns in this choice item.
127
128\wxheading{Remarks}
129
bed5584e
VZ
130This is implemented for Motif only and always returns $1$ for the other
131platforms.
9c884972 132
a660d684
KB
133\membersection{wxChoice::SetColumns}\label{wxchoicesetcolumns}
134
eaaa6a06 135\func{void}{SetColumns}{\param{int}{ n = 1}}
a660d684
KB
136
137Sets the number of columns in this choice item.
138
139\wxheading{Parameters}
140
141\docparam{n}{Number of columns.}
142
143\wxheading{Remarks}
144
bed5584e
VZ
145This is implemented for Motif only and doesn't do anything under other
146platforms.
a660d684 147