]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/tglbtn.tex
Added periods
[wxWidgets.git] / docs / latex / wx / tglbtn.tex
CommitLineData
ecdba0d1
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: tglbtn.tex
3%% Purpose: wxToggleButton documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 20.11.01
7%% RCS-ID: $Id$
8%% Copyright: (c) 2001 Vadim Zeitlin
8795498c 9%% License: wxWindows license
ecdba0d1
VZ
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxToggleButton}}\label{wxtogglebutton}
13
8b283bb8
JS
14wxToggleButton is a button that stays pressed when clicked by the user. In
15other words, it is similar to \helpref{wxCheckBox}{wxcheckbox} in
ecdba0d1
VZ
16functionality but looks like a \helpref{wxButton}{wxbutton}.
17
0a87ef19 18You can see wxToggleButton in action in the sixth page of the
ecdba0d1
VZ
19\helpref{controls}{samplecontrols} sample.
20
ecdba0d1
VZ
21\wxheading{Derived from}
22
23\helpref{wxControl}{wxcontrol}\\
24\helpref{wxWindow}{wxwindow}\\
25\helpref{wxEvtHandler}{wxevthandler}\\
26\helpref{wxObject}{wxobject}
27
28\wxheading{Include files}
29
30<wx/tglbtn.h>
31
a7af285d
VZ
32\wxheading{Library}
33
34\helpref{wxCore}{librarieslist}
35
ecdba0d1
VZ
36\wxheading{Window styles}
37
38There are no special styles for wxToggleButton.
39
40See also \helpref{window styles overview}{windowstyles}.
41
42\wxheading{Event handling}
43
44\twocolwidtha{7cm}
45\begin{twocollist}\itemsep=0pt
20f82e13 46\twocolitem{{\bf EVT\_TOGGLEBUTTON(id, func)}}{Handles a toggle button click event.}
ecdba0d1
VZ
47\end{twocollist}
48
49\wxheading{See also}
50
51\helpref{wxCheckBox}{wxcheckbox}, \helpref{wxButton}{wxbutton}
52
53\latexignore{\rtfignore{\wxheading{Members}}}
54
55\membersection{wxToggleButton::wxToggleButton}\label{wxtogglebuttonconstr}
56
57\func{}{wxToggleButton}{\void}
58
59Default constructor.
60
61\func{}{wxToggleButton}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
62\param{const wxString\& }{label}, \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
63\param{const wxSize\& }{size = wxDefaultSize}, \param{long}{ style = 0},\rtfsp
64\param{const wxValidator\& }{val}, \param{const wxString\& }{name = ``checkBox"}}
65
66Constructor, creating and showing a toggle button.
67
68\wxheading{Parameters}
69
70\docparam{parent}{Parent window. Must not be {\tt NULL}.}
71
72\docparam{id}{Toggle button identifier. A value of $-1$ indicates a default value.}
73
74\docparam{label}{Text to be displayed next to the toggle button.}
75
76\docparam{pos}{Toggle button position. If the position $(-1, -1)$ is specified then a default position is chosen.}
77
78\docparam{size}{Toggle button size. If the default size $(-1, -1)$ is specified then a default size is chosen.}
79
80\docparam{style}{Window style. See \helpref{wxToggleButton}{wxtogglebutton}.}
81
82\docparam{validator}{Window validator.}
83
84\docparam{name}{Window name.}
85
86\wxheading{See also}
87
88\helpref{wxToggleButton::Create}{wxtogglebuttoncreate}, \helpref{wxValidator}{wxvalidator}
89
6d06e061 90\membersection{wxToggleButton::\destruct{wxToggleButton}}\label{wxtogglebuttondtor}
ecdba0d1
VZ
91
92\func{}{\destruct{wxToggleButton}}{\void}
93
94Destructor, destroying the toggle button.
95
96\membersection{wxToggleButton::Create}\label{wxtogglebuttoncreate}
97
98\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
99\param{const wxString\& }{label}, \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
100\param{const wxSize\& }{size = wxDefaultSize}, \param{long}{ style = 0},\rtfsp
101\param{const wxValidator\& }{val}, \param{const wxString\& }{name = ``checkBox"}}
102
103Creates the toggle button for two-step construction. See \helpref{wxToggleButton::wxToggleButton}{wxtogglebuttonconstr}\rtfsp
104for details.
105
106\membersection{wxToggleButton::GetValue}\label{wxtogglebuttongetvalue}
107
108\constfunc{bool}{GetValue}{\void}
109
110Gets the state of the toggle button.
111
112\wxheading{Return value}
113
cc81d32f 114Returns {\tt true} if it is pressed, {\tt false} otherwise.
ecdba0d1
VZ
115
116\membersection{wxToggleButton::SetValue}\label{wxtogglebuttonsetvalue}
117
e31f4da5 118\func{void}{SetValue}{\param{bool}{ state}}
ecdba0d1 119
0a87ef19 120Sets the toggle button to the given state. This does not cause a
8b283bb8 121{\tt EVT\_TOGGLEBUTTON} event to be emitted.
ecdba0d1
VZ
122
123\wxheading{Parameters}
124
cc81d32f 125\docparam{state}{If {\tt true}, the button is pressed.}