]>
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 | ||
33 | \wxheading{See also} | |
34 | ||
35 | \helpref{wxButton}{wxbutton} | |
36 | ||
37 | \latexignore{\rtfignore{\wxheading{Members}}} | |
38 | ||
39 | \membersection{wxBitmapButton::wxBitmapButton}\label{wxbitmapbuttonconstr} | |
40 | ||
41 | \func{}{wxBitmapButton}{\void} | |
42 | ||
43 | Default constructor. | |
44 | ||
45 | \func{}{wxBitmapButton}{\param{wxWindow* }{parent}, \param{const wxWindowID}{ id}, \param{const wxBitmap\& }{bitmap},\rtfsp | |
46 | \param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp | |
47 | \param{const long}{ style = wxBU\_AUTODRAW}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}} | |
48 | ||
49 | Constructor, creating and showing a button. | |
50 | ||
51 | \wxheading{Parameters} | |
52 | ||
53 | \docparam{parent}{Parent window. Must not be NULL.} | |
54 | ||
55 | \docparam{id}{Button identifier. A value of -1 indicates a default value.} | |
56 | ||
57 | \docparam{bitmap}{Bitmap to be displayed.} | |
58 | ||
59 | \docparam{pos}{Button position.} | |
60 | ||
61 | \docparam{size}{Button size. If the default size (-1, -1) is specified then the button is sized | |
62 | appropriately for the bitmap.} | |
63 | ||
64 | \docparam{style}{Window style. See \helpref{wxBitmapButton}{wxbitmapbutton}.} | |
65 | ||
66 | \docparam{validator}{Window validator.} | |
67 | ||
68 | \docparam{name}{Window name.} | |
69 | ||
70 | \wxheading{Remarks} | |
71 | ||
72 | The {\it bitmap} parameter is normally the only bitmap you need to provide, and wxWindows will | |
73 | draw the button correctly in its different states. If you want more control, call | |
74 | any of the functions \helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp | |
75 | \helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus},\rtfsp | |
76 | \helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled}. | |
77 | ||
78 | Note that the bitmap passed is smaller than the actual button created. | |
79 | ||
80 | \wxheading{See also} | |
81 | ||
82 | \helpref{wxBitmapButton::Create}{wxbitmapbuttoncreate}, \helpref{wxValidator}{wxvalidator} | |
83 | ||
84 | \membersection{wxBitmapButton::\destruct{wxBitmapButton}} | |
85 | ||
86 | \func{}{\destruct{wxBitmapButton}}{\void} | |
87 | ||
88 | Destructor, destroying the button. | |
89 | ||
90 | \membersection{wxBitmapButton::Create}\label{wxbitmapbuttoncreate} | |
91 | ||
92 | \func{bool}{Create}{\param{wxWindow* }{parent}, \param{const wxWindowID}{ id}, \param{const wxBitmap\& }{bitmap},\rtfsp | |
93 | \param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp | |
94 | \param{const long}{ style = 0}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}} | |
95 | ||
96 | Button creation function for two-step creation. For more details, see \helpref{wxBitmapButton::wxBitmapButton}{wxbitmapbuttonconstr}. | |
97 | ||
98 | \membersection{wxBitmapButton::GetBitmapDisabled}\label{wxbitmapbuttongetbitmapdisabled} | |
99 | ||
100 | \constfunc{wxBitmap\&}{GetBitmapLabel}{\void} | |
101 | ||
102 | Returns the bitmap for the disabled state. | |
103 | ||
104 | \wxheading{Return value} | |
105 | ||
106 | A reference to the disabled state bitmap. | |
107 | ||
108 | \wxheading{See also} | |
109 | ||
110 | \helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled} | |
111 | ||
112 | \membersection{wxBitmapButton::GetBitmapFocus}\label{wxbitmapbuttongetbitmapfocus} | |
113 | ||
114 | \constfunc{wxBitmap\&}{GetBitmapFocus}{\void} | |
115 | ||
116 | Returns the bitmap for the focussed state. | |
117 | ||
118 | \wxheading{Return value} | |
119 | ||
120 | A reference to the focussed state bitmap. | |
121 | ||
122 | \wxheading{See also} | |
123 | ||
124 | \helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus} | |
125 | ||
126 | \membersection{wxBitmapButton::GetBitmapLabel}\label{wxbitmapbuttongetbitmaplabel} | |
127 | ||
128 | \constfunc{wxBitmap\&}{GetBitmapLabel}{\void} | |
129 | ||
130 | Returns the label bitmap (the one passed to the constructor). | |
131 | ||
132 | \wxheading{Return value} | |
133 | ||
134 | A reference to the button's label bitmap. | |
135 | ||
136 | \wxheading{See also} | |
137 | ||
138 | \helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel} | |
139 | ||
140 | \membersection{wxBitmapButton::GetBitmapSelected}\label{wxbitmapbuttongetbitmapselected} | |
141 | ||
142 | \constfunc{wxBitmap\&}{GetBitmapSelected}{\void} | |
143 | ||
144 | Returns the bitmap for the selected state. | |
145 | ||
146 | \wxheading{Return value} | |
147 | ||
148 | A reference to the selected state bitmap. | |
149 | ||
150 | \wxheading{See also} | |
151 | ||
152 | \helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected} | |
153 | ||
154 | \membersection{wxBitmapButton::SetBitmapDisabled}\label{wxbitmapbuttonsetbitmapdisabled} | |
155 | ||
156 | \func{void}{SetBitmapDisabled}{\param{const wxBitmap\& }{bitmap}} | |
157 | ||
158 | Sets the bitmap for the disabled button appearance. | |
159 | ||
160 | \wxheading{Parameters} | |
161 | ||
162 | \docparam{bitmap}{The bitmap to set.} | |
163 | ||
164 | \wxheading{See also} | |
165 | ||
166 | \helpref{wxBitmapButton::GetBitmapDisabled}{wxbitmapbuttongetbitmapdisabled},\rtfsp | |
167 | \helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp | |
168 | \helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp | |
169 | \helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus} | |
170 | ||
171 | \membersection{wxBitmapButton::SetBitmapFocus}\label{wxbitmapbuttonsetbitmapfocus} | |
172 | ||
173 | \func{void}{SetBitmapFocus}{\param{const wxBitmap\& }{bitmap}} | |
174 | ||
175 | Sets the bitmap for the button appearance when it has the keyboard focus. | |
176 | ||
177 | \wxheading{Parameters} | |
178 | ||
179 | \docparam{bitmap}{The bitmap to set.} | |
180 | ||
181 | \wxheading{See also} | |
182 | ||
183 | \helpref{wxBitmapButton::GetBitmapFocus}{wxbitmapbuttongetbitmapfocus},\rtfsp | |
184 | \helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp | |
185 | \helpref{wxBitmapButton::SetBitmapSelected}{wxbitmapbuttonsetbitmapselected},\rtfsp | |
186 | \helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled} | |
187 | ||
188 | \membersection{wxBitmapButton::SetBitmapLabel}\label{wxbitmapbuttonsetbitmaplabel} | |
189 | ||
190 | \func{void}{SetBitmapLabel}{\param{const wxBitmap\& }{bitmap}} | |
191 | ||
192 | Sets the bitmap label for the button. | |
193 | ||
194 | \wxheading{Parameters} | |
195 | ||
196 | \docparam{bitmap}{The bitmap label to set.} | |
197 | ||
198 | \wxheading{Remarks} | |
199 | ||
200 | This is the bitmap used for the unselected state, and for all other states | |
201 | if no other bitmaps are provided. | |
202 | ||
203 | \wxheading{See also} | |
204 | ||
205 | \helpref{wxBitmapButton::GetBitmapLabel}{wxbitmapbuttongetbitmaplabel} | |
206 | ||
207 | \membersection{wxBitmapButton::SetBitmapSelected}\label{wxbitmapbuttonsetbitmapselected} | |
208 | ||
209 | \func{void}{SetBitmapSelected}{\param{const wxBitmap\& }{bitmap}} | |
210 | ||
211 | Sets the bitmap for the selected (depressed) button appearance. | |
212 | ||
213 | \wxheading{Parameters} | |
214 | ||
215 | \docparam{bitmap}{The bitmap to set.} | |
216 | ||
217 | \wxheading{See also} | |
218 | ||
219 | \helpref{wxBitmapButton::GetBitmapSelected}{wxbitmapbuttongetbitmapselected},\rtfsp | |
220 | \helpref{wxBitmapButton::SetBitmapLabel}{wxbitmapbuttonsetbitmaplabel},\rtfsp | |
221 | \helpref{wxBitmapButton::SetBitmapFocus}{wxbitmapbuttonsetbitmapfocus},\rtfsp | |
222 | \helpref{wxBitmapButton::SetBitmapDisabled}{wxbitmapbuttonsetbitmapdisabled} | |
223 |