]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
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{Remarks} | |
16 | ||
17 | A bitmap button can be supplied with a single bitmap, and wxWindows will draw | |
18 | all button states using this bitmap. If the application needs more control, additional bitmaps for | |
19 | the 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 | |
26 | this is specified, the button will be drawn automatically using the label bitmap only, providing | |
27 | a 3D-look border. If this style is not specified, the button will be drawn without borders and using all | |
28 | provided bitmaps.} | |
29 | \end{twocollist} | |
30 | ||
31 | See 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, | |
38 | when 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 | ||
51 | Default 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 | |
57 | Constructor, 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 | |
70 | appropriately 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 | ||
80 | The {\it bitmap} parameter is normally the only bitmap you need to provide, and wxWindows will | |
81 | draw the button correctly in its different states. If you want more control, call | |
82 | any of the functions \helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp | |
83 | \helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus},\rtfsp | |
84 | \helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}. | |
85 | ||
86 | Note 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 | ||
96 | Destructor, 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 | |
104 | Button 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 | ||
110 | Returns the bitmap for the disabled state. | |
111 | ||
112 | \wxheading{Return value} | |
113 | ||
114 | A 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 | ||
124 | Returns the bitmap for the focussed state. | |
125 | ||
126 | \wxheading{Return value} | |
127 | ||
128 | A 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 | ||
138 | Returns the label bitmap (the one passed to the constructor). | |
139 | ||
140 | \wxheading{Return value} | |
141 | ||
142 | A 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 | ||
152 | Returns the bitmap for the selected state. | |
153 | ||
154 | \wxheading{Return value} | |
155 | ||
156 | A 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 | ||
166 | Sets 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 | ||
183 | Sets 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 | ||
200 | Sets the bitmap label for the button. | |
201 | ||
202 | \wxheading{Parameters} | |
203 | ||
204 | \docparam{bitmap}{The bitmap label to set.} | |
205 | ||
206 | \wxheading{Remarks} | |
207 | ||
208 | This is the bitmap used for the unselected state, and for all other states | |
209 | if 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 | ||
219 | Sets 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 |