]>
Commit | Line | Data |
---|---|---|
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 |
14 | wxToggleButton is a button that stays pressed when clicked by the user. In |
15 | other words, it is similar to \helpref{wxCheckBox}{wxcheckbox} in | |
ecdba0d1 VZ |
16 | functionality but looks like a \helpref{wxButton}{wxbutton}. |
17 | ||
0a87ef19 | 18 | You 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 | ||
32 | \wxheading{Window styles} | |
33 | ||
34 | There are no special styles for wxToggleButton. | |
35 | ||
36 | See also \helpref{window styles overview}{windowstyles}. | |
37 | ||
38 | \wxheading{Event handling} | |
39 | ||
40 | \twocolwidtha{7cm} | |
41 | \begin{twocollist}\itemsep=0pt | |
20f82e13 | 42 | \twocolitem{{\bf EVT\_TOGGLEBUTTON(id, func)}}{Handles a toggle button click event.} |
ecdba0d1 VZ |
43 | \end{twocollist} |
44 | ||
45 | \wxheading{See also} | |
46 | ||
47 | \helpref{wxCheckBox}{wxcheckbox}, \helpref{wxButton}{wxbutton} | |
48 | ||
49 | \latexignore{\rtfignore{\wxheading{Members}}} | |
50 | ||
51 | \membersection{wxToggleButton::wxToggleButton}\label{wxtogglebuttonconstr} | |
52 | ||
53 | \func{}{wxToggleButton}{\void} | |
54 | ||
55 | Default constructor. | |
56 | ||
57 | \func{}{wxToggleButton}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp | |
58 | \param{const wxString\& }{label}, \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp | |
59 | \param{const wxSize\& }{size = wxDefaultSize}, \param{long}{ style = 0},\rtfsp | |
60 | \param{const wxValidator\& }{val}, \param{const wxString\& }{name = ``checkBox"}} | |
61 | ||
62 | Constructor, creating and showing a toggle button. | |
63 | ||
64 | \wxheading{Parameters} | |
65 | ||
66 | \docparam{parent}{Parent window. Must not be {\tt NULL}.} | |
67 | ||
68 | \docparam{id}{Toggle button identifier. A value of $-1$ indicates a default value.} | |
69 | ||
70 | \docparam{label}{Text to be displayed next to the toggle button.} | |
71 | ||
72 | \docparam{pos}{Toggle button position. If the position $(-1, -1)$ is specified then a default position is chosen.} | |
73 | ||
74 | \docparam{size}{Toggle button size. If the default size $(-1, -1)$ is specified then a default size is chosen.} | |
75 | ||
76 | \docparam{style}{Window style. See \helpref{wxToggleButton}{wxtogglebutton}.} | |
77 | ||
78 | \docparam{validator}{Window validator.} | |
79 | ||
80 | \docparam{name}{Window name.} | |
81 | ||
82 | \wxheading{See also} | |
83 | ||
84 | \helpref{wxToggleButton::Create}{wxtogglebuttoncreate}, \helpref{wxValidator}{wxvalidator} | |
85 | ||
6d06e061 | 86 | \membersection{wxToggleButton::\destruct{wxToggleButton}}\label{wxtogglebuttondtor} |
ecdba0d1 VZ |
87 | |
88 | \func{}{\destruct{wxToggleButton}}{\void} | |
89 | ||
90 | Destructor, destroying the toggle button. | |
91 | ||
92 | \membersection{wxToggleButton::Create}\label{wxtogglebuttoncreate} | |
93 | ||
94 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp | |
95 | \param{const wxString\& }{label}, \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp | |
96 | \param{const wxSize\& }{size = wxDefaultSize}, \param{long}{ style = 0},\rtfsp | |
97 | \param{const wxValidator\& }{val}, \param{const wxString\& }{name = ``checkBox"}} | |
98 | ||
99 | Creates the toggle button for two-step construction. See \helpref{wxToggleButton::wxToggleButton}{wxtogglebuttonconstr}\rtfsp | |
100 | for details. | |
101 | ||
102 | \membersection{wxToggleButton::GetValue}\label{wxtogglebuttongetvalue} | |
103 | ||
104 | \constfunc{bool}{GetValue}{\void} | |
105 | ||
106 | Gets the state of the toggle button. | |
107 | ||
108 | \wxheading{Return value} | |
109 | ||
cc81d32f | 110 | Returns {\tt true} if it is pressed, {\tt false} otherwise. |
ecdba0d1 VZ |
111 | |
112 | \membersection{wxToggleButton::SetValue}\label{wxtogglebuttonsetvalue} | |
113 | ||
114 | \func{void}{SetValue}{\param{const bool}{ state}} | |
115 | ||
0a87ef19 | 116 | Sets the toggle button to the given state. This does not cause a |
8b283bb8 | 117 | {\tt EVT\_TOGGLEBUTTON} event to be emitted. |
ecdba0d1 VZ |
118 | |
119 | \wxheading{Parameters} | |
120 | ||
cc81d32f | 121 | \docparam{state}{If {\tt true}, the button is pressed.} |