]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/bbutton.tex
a bit more docs
[wxWidgets.git] / docs / latex / wx / bbutton.tex
CommitLineData
a660d684
KB
1\section{\class{wxBitmapButton}}\label{wxbitmapbutton}
2
3A bitmap button is a control that contains a bitmap.
4It may be placed on a \helpref{dialog box}{wxdialog} or \helpref{panel}{wxpanel}, or indeed
5almost any other window.
6
7\wxheading{Derived from}
8
9\helpref{wxButton}{wxbutton}\\
10\helpref{wxControl}{wxcontrol}\\
11\helpref{wxWindow}{wxwindow}\\
12\helpref{wxEvtHandler}{wxevthandler}\\
13\helpref{wxObject}{wxobject}
14
15\wxheading{Remarks}
16
17A bitmap button can be supplied with a single bitmap, and wxWindows will draw
18all button states using this bitmap. If the application needs more control, additional bitmaps for
19the selected state, unpressed focussed state, and greyed-out state may be supplied.
20
21\wxheading{Window styles}
22
23\twocolwidtha{5cm}
24\begin{twocollist}\itemsep=0pt
25\twocolitem{\windowstyle{wxBU\_AUTODRAW}}{If
26this is specified, the button will be drawn automatically using the label bitmap only, providing
27a 3D-look border. If this style is not specified, the button will be drawn without borders and using all
28provided bitmaps.}
29\end{twocollist}
30
31See also \helpref{window styles overview}{windowstyles}.
32
5de76427
JS
33\wxheading{Event handling}
34
35\twocolwidtha{7cm}
36\begin{twocollist}\itemsep=0pt
37\twocolitem{{\bf EVT\_BUTTON(id, func)}}{Process a wxEVT\_COMMAND\_BUTTON\_CLICKED event,
38when the button is clicked.}
39\end{twocollist}
40
a660d684
KB
41\wxheading{See also}
42
43\helpref{wxButton}{wxbutton}
44
45\latexignore{\rtfignore{\wxheading{Members}}}
46
47\membersection{wxBitmapButton::wxBitmapButton}\label{wxbitmapbuttonconstr}
48
49\func{}{wxBitmapButton}{\void}
50
51Default constructor.
52
eaaa6a06 53\func{}{wxBitmapButton}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id}, \param{const wxBitmap\& }{bitmap},\rtfsp
a660d684 54\param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
eaaa6a06 55\param{long}{ style = wxBU\_AUTODRAW}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}}
a660d684
KB
56
57Constructor, creating and showing a button.
58
59\wxheading{Parameters}
60
61\docparam{parent}{Parent window. Must not be NULL.}
62
63\docparam{id}{Button identifier. A value of -1 indicates a default value.}
64
65\docparam{bitmap}{Bitmap to be displayed.}
66
67\docparam{pos}{Button position.}
68
69\docparam{size}{Button size. If the default size (-1, -1) is specified then the button is sized
70appropriately for the bitmap.}
71
72\docparam{style}{Window style. See \helpref{wxBitmapButton}{wxbitmapbutton}.}
73
74\docparam{validator}{Window validator.}
75
76\docparam{name}{Window name.}
77
78\wxheading{Remarks}
79
80The {\it bitmap} parameter is normally the only bitmap you need to provide, and wxWindows will
81draw the button correctly in its different states. If you want more control, call
82any of the functions \helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp
83\helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus},\rtfsp
84\helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}.
85
86Note that the bitmap passed is smaller than the actual button created.
87
88\wxheading{See also}
89
90\helpref{wxBitmapButton::Create}{wxbitmapbuttoncreate}, \helpref{wxValidator}{wxvalidator}
91
92\membersection{wxBitmapButton::\destruct{wxBitmapButton}}
93
94\func{}{\destruct{wxBitmapButton}}{\void}
95
96Destructor, destroying the button.
97
98\membersection{wxBitmapButton::Create}\label{wxbitmapbuttoncreate}
99
eaaa6a06 100\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id}, \param{const wxBitmap\& }{bitmap},\rtfsp
a660d684 101\param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
eaaa6a06 102\param{long}{ style = 0}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}}
a660d684
KB
103
104Button creation function for two-step creation. For more details, see \helpref{wxBitmapButton::wxBitmapButton}{wxbitmapbuttonconstr}.
105
106\membersection{wxBitmapButton::GetBitmapDisabled}\label{wxbitmapbuttongetbitmapdisabled}
107
108\constfunc{wxBitmap\&}{GetBitmapLabel}{\void}
109
110Returns the bitmap for the disabled state.
111
112\wxheading{Return value}
113
114A reference to the disabled state bitmap.
115
116\wxheading{See also}
117
118\helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}
119
120\membersection{wxBitmapButton::GetBitmapFocus}\label{wxbitmapbuttongetbitmapfocus}
121
122\constfunc{wxBitmap\&}{GetBitmapFocus}{\void}
123
124Returns the bitmap for the focussed state.
125
126\wxheading{Return value}
127
128A reference to the focussed state bitmap.
129
130\wxheading{See also}
131
132\helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus}
133
134\membersection{wxBitmapButton::GetBitmapLabel}\label{wxbitmapbuttongetbitmaplabel}
135
136\constfunc{wxBitmap\&}{GetBitmapLabel}{\void}
137
138Returns the label bitmap (the one passed to the constructor).
139
140\wxheading{Return value}
141
142A reference to the button's label bitmap.
143
144\wxheading{See also}
145
146\helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel}
147
148\membersection{wxBitmapButton::GetBitmapSelected}\label{wxbitmapbuttongetbitmapselected}
149
150\constfunc{wxBitmap\&}{GetBitmapSelected}{\void}
151
152Returns the bitmap for the selected state.
153
154\wxheading{Return value}
155
156A reference to the selected state bitmap.
157
158\wxheading{See also}
159
160\helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected}
161
162\membersection{wxBitmapButton::SetBitmapDisabled}\label{wxbitmapbuttonsetbitmapdisabled}
163
164\func{void}{SetBitmapDisabled}{\param{const wxBitmap\& }{bitmap}}
165
166Sets the bitmap for the disabled button appearance.
167
168\wxheading{Parameters}
169
170\docparam{bitmap}{The bitmap to set.}
171
172\wxheading{See also}
173
174\helpref{wxBitmapButton::GetBitmapDisabled}{wxbitmapbuttongetbitmapdisabled},\rtfsp
175\helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp
176\helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp
177\helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus}
178
179\membersection{wxBitmapButton::SetBitmapFocus}\label{wxbitmapbuttonsetbitmapfocus}
180
181\func{void}{SetBitmapFocus}{\param{const wxBitmap\& }{bitmap}}
182
183Sets the bitmap for the button appearance when it has the keyboard focus.
184
185\wxheading{Parameters}
186
187\docparam{bitmap}{The bitmap to set.}
188
189\wxheading{See also}
190
191\helpref{wxBitmapButton::GetBitmapFocus}{wxbitmapbuttongetbitmapfocus},\rtfsp
192\helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp
193\helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp
194\helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}
195
196\membersection{wxBitmapButton::SetBitmapLabel}\label{wxbitmapbuttonsetbitmaplabel}
197
198\func{void}{SetBitmapLabel}{\param{const wxBitmap\& }{bitmap}}
199
200Sets the bitmap label for the button.
201
202\wxheading{Parameters}
203
204\docparam{bitmap}{The bitmap label to set.}
205
206\wxheading{Remarks}
207
208This is the bitmap used for the unselected state, and for all other states
209if no other bitmaps are provided.
210
211\wxheading{See also}
212
213\helpref{wxBitmapButton::GetBitmapLabel}{wxbitmapbuttongetbitmaplabel}
214
215\membersection{wxBitmapButton::SetBitmapSelected}\label{wxbitmapbuttonsetbitmapselected}
216
217\func{void}{SetBitmapSelected}{\param{const wxBitmap\& }{bitmap}}
218
219Sets the bitmap for the selected (depressed) button appearance.
220
221\wxheading{Parameters}
222
223\docparam{bitmap}{The bitmap to set.}
224
225\wxheading{See also}
226
227\helpref{wxBitmapButton::GetBitmapSelected}{wxbitmapbuttongetbitmapselected},\rtfsp
228\helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp
229\helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus},\rtfsp
230\helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}
231