1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxCheckBox}}\label{wxcheckbox}
|
|
|
|
|
2004-01-26 05:40:53 -05:00
|
|
|
A checkbox is a labelled box which by default is either on (checkmark is
|
|
|
|
visible) or off (no checkmark). Optionally (When the wxCHK\_3STATE style flag
|
|
|
|
is set) it can have a third state, called the mixed or undetermined state.
|
|
|
|
Often this is used as a "Does Not Apply" state.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxControl}{wxcontrol}\\
|
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/checkbox.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{Window styles}
|
|
|
|
|
2003-09-27 20:23:08 -04:00
|
|
|
\twocolwidtha{7cm}
|
2003-09-11 12:54:01 -04:00
|
|
|
\begin{twocollist}\itemsep=0pt
|
2003-09-27 20:23:08 -04:00
|
|
|
\twocolitem{\windowstyle{wxCHK\_2STATE}}{Create a 2-state checkbox (This is the default).}
|
|
|
|
\twocolitem{\windowstyle{wxCHK\_3STATE}}{Create a 3-state checkbox.}
|
|
|
|
\twocolitem{\windowstyle{wxCHK\_ALLOW\_3RD\_STATE\_FOR\_USER}}{By default a user can't set a 3-state checkbox
|
|
|
|
to the third state. It can only be done from code. Using this flags allows the user to set the checkbox to the third state by clicking. }
|
2003-09-11 12:54:01 -04:00
|
|
|
\twocolitem{\windowstyle{wxALIGN\_RIGHT}}{Makes the text appear on the left of the checkbox.}
|
|
|
|
\end{twocollist}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
See also \helpref{window styles overview}{windowstyles}.
|
|
|
|
|
1998-08-06 15:42:06 -04:00
|
|
|
\wxheading{Event handling}
|
|
|
|
|
|
|
|
\twocolwidtha{7cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{{\bf EVT\_CHECKBOX(id, func)}}{Process a wxEVT\_COMMAND\_CHECKBOX\_CLICKED event,
|
|
|
|
when the checkbox is clicked.}
|
|
|
|
\end{twocollist}
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
1998-08-06 15:42:06 -04:00
|
|
|
\helpref{wxRadioButton}{wxradiobutton}, \helpref{wxCommandEvent}{wxcommandevent}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
\membersection{wxCheckBox::wxCheckBox}\label{wxcheckboxconstr}
|
|
|
|
|
|
|
|
\func{}{wxCheckBox}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{}{wxCheckBox}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
|
1998-05-20 10:25:30 -04:00
|
|
|
\param{const wxString\& }{label}, \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
|
|
|
|
\param{const wxSize\& }{size = wxDefaultSize}, \param{long}{ style = 0},\rtfsp
|
|
|
|
\param{const wxValidator\& }{val}, \param{const wxString\& }{name = ``checkBox"}}
|
|
|
|
|
|
|
|
Constructor, creating and showing a checkbox.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{parent}{Parent window. Must not be NULL.}
|
|
|
|
|
|
|
|
\docparam{id}{Checkbox identifier. A value of -1 indicates a default value.}
|
|
|
|
|
|
|
|
\docparam{label}{Text to be displayed next to the checkbox.}
|
|
|
|
|
|
|
|
\docparam{pos}{Checkbox position. If the position (-1, -1) is specified then a default position is chosen.}
|
|
|
|
|
|
|
|
\docparam{size}{Checkbox size. If the default size (-1, -1) is specified then a default size is chosen.}
|
|
|
|
|
|
|
|
\docparam{style}{Window style. See \helpref{wxCheckBox}{wxcheckbox}.}
|
|
|
|
|
|
|
|
\docparam{validator}{Window validator.}
|
|
|
|
|
|
|
|
\docparam{name}{Window name.}
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxCheckBox::Create}{wxcheckboxcreate}, \helpref{wxValidator}{wxvalidator}
|
|
|
|
|
|
|
|
\membersection{wxCheckBox::\destruct{wxCheckBox}}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxCheckBox}}{\void}
|
|
|
|
|
|
|
|
Destructor, destroying the checkbox.
|
|
|
|
|
|
|
|
\membersection{wxCheckBox::Create}\label{wxcheckboxcreate}
|
|
|
|
|
1998-06-14 08:11:50 -04:00
|
|
|
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
|
1998-05-20 10:25:30 -04:00
|
|
|
\param{const wxString\& }{label}, \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
|
|
|
|
\param{const wxSize\& }{size = wxDefaultSize}, \param{long}{ style = 0},\rtfsp
|
|
|
|
\param{const wxValidator\& }{val}, \param{const wxString\& }{name = ``checkBox"}}
|
|
|
|
|
|
|
|
Creates the checkbox for two-step construction. See \helpref{wxCheckBox::wxCheckBox}{wxcheckboxconstr}\rtfsp
|
|
|
|
for details.
|
|
|
|
|
|
|
|
\membersection{wxCheckBox::GetValue}\label{wxcheckboxgetvalue}
|
|
|
|
|
|
|
|
\constfunc{bool}{GetValue}{\void}
|
|
|
|
|
2003-09-27 20:23:08 -04:00
|
|
|
Gets the state of a 2-state checkbox.
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
|
|
|
Returns \true if it is checked, \false otherwise.
|
|
|
|
|
|
|
|
\membersection{wxCheckBox::Get3StateValue}\label{wxcheckboxgetthreestatevalue}
|
|
|
|
|
|
|
|
\constfunc{wxCheckBoxState}{Get3StateValue}{\void}
|
|
|
|
|
|
|
|
Gets the state of a 3-state checkbox.
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
|
|
|
Returns wxCHK\_UNCHECKED when the checkbox is unchecked, wxCHK\_CHECKED
|
|
|
|
when it is checked and wxCHK\_UNDETERMINED when it's in the undetermined
|
|
|
|
state. Asserts when the function is used with a 2-state checkbox.
|
|
|
|
|
|
|
|
\membersection{wxCheckBox::Is3rdStateAllowedForUser}\label{wxcheckboxis3rdstateallowedforuser}
|
|
|
|
|
|
|
|
\constfunc{bool}{Is3rdStateAllowedForUser}{\void}
|
|
|
|
|
|
|
|
Returns whether or not the user can set the checkbox to the third state.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
2003-09-27 20:23:08 -04:00
|
|
|
Returns \true if the user can set the third state of this checkbox, \false if it can only be set
|
|
|
|
programmatically or if it's a 2-state checkbox.
|
|
|
|
|
|
|
|
\membersection{wxCheckBox::Is3State}\label{wxcheckboxis3state}
|
|
|
|
|
|
|
|
\constfunc{bool}{Is3State}{\void}
|
|
|
|
|
|
|
|
Returns whether or not the checkbox is a 3-state checkbox.
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
|
|
|
Returns \true if this checkbox is a 3-state checkbox, \false if it's a 2-state checkbox.
|
2002-05-06 07:40:16 -04:00
|
|
|
|
|
|
|
\membersection{wxCheckBox::IsChecked}\label{wxcheckboxischecked}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsChecked}{\void}
|
|
|
|
|
|
|
|
This is just a maybe more readable synonym for
|
|
|
|
\helpref{GetValue}{wxcheckboxgetvalue}: just as the latter, it returns
|
2003-09-27 20:23:08 -04:00
|
|
|
\true if the checkbox is checked and \false otherwise.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxCheckBox::SetValue}\label{wxcheckboxsetvalue}
|
|
|
|
|
2003-09-28 13:51:11 -04:00
|
|
|
\func{void}{SetValue}{\param{bool}{ state}}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
1999-07-22 19:28:55 -04:00
|
|
|
Sets the checkbox to the given state. This does not cause a
|
|
|
|
wxEVT\_COMMAND\_CHECKBOX\_CLICKED event to get emitted.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
2003-09-27 20:23:08 -04:00
|
|
|
\docparam{state}{If \true, the check is on, otherwise it is off.}
|
|
|
|
|
|
|
|
\membersection{wxCheckBox::Set3StateValue}\label{wxcheckboxset3statevalue}
|
|
|
|
|
|
|
|
\func{void}{Set3StateValue}{\param{const wxCheckBoxState}{ state}}
|
|
|
|
|
|
|
|
Sets the checkbox to the given state. This does not cause a
|
|
|
|
wxEVT\_COMMAND\_CHECKBOX\_CLICKED event to get emitted.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2003-09-27 20:23:08 -04:00
|
|
|
\docparam{state}{Can be one of: wxCHK\_UNCHECKED (Check is off), wxCHK\_CHECKED
|
|
|
|
(Check is on) or wxCHK\_UNDETERMINED (Check is mixed). Asserts when the checkbox
|
|
|
|
is a 2-state checkbox and setting the state to wxCHK\_UNDETERMINED.}
|