1 \section{\class{wxCheckBox
}}\label{wxcheckbox
}
3 A checkbox is a labelled box which is either on (checkmark is visible)
6 \wxheading{Derived from
}
8 \helpref{wxControl
}{wxcontrol
}\\
9 \helpref{wxWindow
}{wxwindow
}\\
10 \helpref{wxEvtHandler
}{wxevthandler
}\\
11 \helpref{wxObject
}{wxobject
}
13 \wxheading{Include files
}
17 \wxheading{Window styles
}
20 \begin{twocollist
}\itemsep=
0pt
21 \twocolitem{\windowstyle{wxALIGN
\_RIGHT}}{Makes the text appear on the left of the checkbox.
}
24 See also
\helpref{window styles overview
}{windowstyles
}.
26 \wxheading{Event handling
}
29 \begin{twocollist
}\itemsep=
0pt
30 \twocolitem{{\bf EVT
\_CHECKBOX(id, func)
}}{Process a wxEVT
\_COMMAND\_CHECKBOX\_CLICKED event,
31 when the checkbox is clicked.
}
36 \helpref{wxRadioButton
}{wxradiobutton
},
\helpref{wxCommandEvent
}{wxcommandevent
}
38 \latexignore{\rtfignore{\wxheading{Members
}}}
40 \membersection{wxCheckBox::wxCheckBox
}\label{wxcheckboxconstr
}
42 \func{}{wxCheckBox
}{\void}
46 \func{}{wxCheckBox
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\rtfsp
47 \param{const wxString\&
}{label
},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
48 \param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{ style =
0},
\rtfsp
49 \param{const wxValidator\&
}{val
},
\param{const wxString\&
}{name = ``checkBox"
}}
51 Constructor, creating and showing a checkbox.
53 \wxheading{Parameters
}
55 \docparam{parent
}{Parent window. Must not be NULL.
}
57 \docparam{id
}{Checkbox identifier. A value of -
1 indicates a default value.
}
59 \docparam{label
}{Text to be displayed next to the checkbox.
}
61 \docparam{pos
}{Checkbox position. If the position (-
1, -
1) is specified then a default position is chosen.
}
63 \docparam{size
}{Checkbox size. If the default size (-
1, -
1) is specified then a default size is chosen.
}
65 \docparam{style
}{Window style. See
\helpref{wxCheckBox
}{wxcheckbox
}.
}
67 \docparam{validator
}{Window validator.
}
69 \docparam{name
}{Window name.
}
73 \helpref{wxCheckBox::Create
}{wxcheckboxcreate
},
\helpref{wxValidator
}{wxvalidator
}
75 \membersection{wxCheckBox::
\destruct{wxCheckBox
}}
77 \func{}{\destruct{wxCheckBox
}}{\void}
79 Destructor, destroying the checkbox.
81 \membersection{wxCheckBox::Create
}\label{wxcheckboxcreate
}
83 \func{bool
}{Create
}{\param{wxWindow*
}{parent
},
\param{wxWindowID
}{ id
},
\rtfsp
84 \param{const wxString\&
}{label
},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
85 \param{const wxSize\&
}{size = wxDefaultSize
},
\param{long
}{ style =
0},
\rtfsp
86 \param{const wxValidator\&
}{val
},
\param{const wxString\&
}{name = ``checkBox"
}}
88 Creates the checkbox for two-step construction. See
\helpref{wxCheckBox::wxCheckBox
}{wxcheckboxconstr
}\rtfsp
91 \membersection{wxCheckBox::GetValue
}\label{wxcheckboxgetvalue
}
93 \constfunc{bool
}{GetValue
}{\void}
95 Gets the state of the checkbox.
97 \wxheading{Return value
}
99 Returns
{\tt true
} if it is checked,
{\tt false
} otherwise.
101 \membersection{wxCheckBox::IsChecked
}\label{wxcheckboxischecked
}
103 \constfunc{bool
}{IsChecked
}{\void}
105 This is just a maybe more readable synonym for
106 \helpref{GetValue
}{wxcheckboxgetvalue
}: just as the latter, it returns
107 {\tt true
} if the checkbox is checked and
{\tt false
} otherwise.
109 \membersection{wxCheckBox::SetValue
}\label{wxcheckboxsetvalue
}
111 \func{void
}{SetValue
}{\param{const bool
}{ state
}}
113 Sets the checkbox to the given state. This does not cause a
114 wxEVT
\_COMMAND\_CHECKBOX\_CLICKED event to get emitted.
116 \wxheading{Parameters
}
118 \docparam{state
}{If
{\tt true
}, the check is on, otherwise it is off.
}