wxWidgets/docs/latex/wx/checkbox.tex

117 lines
3.4 KiB
TeX
Raw Normal View History

\section{\class{wxCheckBox}}\label{wxcheckbox}
A checkbox is a labelled box which is either on (checkmark is visible)
or off (no checkmark).
\wxheading{Derived from}
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/checkbox.h>
\wxheading{Window styles}
There are no special styles for wxCheckBox.
See also \helpref{window styles overview}{windowstyles}.
\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}
\wxheading{See also}
\helpref{wxRadioButton}{wxradiobutton}, \helpref{wxCommandEvent}{wxcommandevent}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxCheckBox::wxCheckBox}\label{wxcheckboxconstr}
\func{}{wxCheckBox}{\void}
Default constructor.
\func{}{wxCheckBox}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
\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}
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
\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}
Gets the state of the checkbox.
\wxheading{Return value}
Returns {\tt true} if it is checked, {\tt false} otherwise.
\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
{\tt true} if the checkbox is checked and {\tt false} otherwise.
\membersection{wxCheckBox::SetValue}\label{wxcheckboxsetvalue}
\func{void}{SetValue}{\param{const bool}{ state}}
Sets the checkbox to the given state. This does not cause a
wxEVT\_COMMAND\_CHECKBOX\_CLICKED event to get emitted.
\wxheading{Parameters}
\docparam{state}{If {\tt true}, the check is on, otherwise it is off.}