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