]>
git.saurik.com Git - wxWidgets.git/blob - interface/bmpbuttn.h
783cb848deca6b327a1aaca16d44a349a238296c
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxBitmapButton class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 A bitmap button is a control that contains a bitmap.
14 It may be placed on a @ref overview_wxdialog "dialog box" or panel, or indeed
15 almost any other window.
18 @style{wxBU_AUTODRAW}:
19 If this is specified, the button will be drawn automatically using
20 the label bitmap only, providing a 3D-look border. If this style is
21 not specified, the button will be drawn without borders and using
22 all provided bitmaps. WIN32 only.
24 Left-justifies the bitmap label. WIN32 only.
26 Aligns the bitmap label to the top of the button. WIN32 only.
28 Right-justifies the bitmap label. WIN32 only.
30 Aligns the bitmap label to the bottom of the button. WIN32 only.
34 @event{EVT_BUTTON(id\, func)}:
35 Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is
41 @appearance{bitmapbutton.png}
46 class wxBitmapButton
: public wxButton
51 Constructor, creating and showing a button.
54 Parent window. Must not be @NULL.
57 Button identifier. The value wxID_ANY indicates a default value.
60 Bitmap to be displayed.
66 Button size. If wxDefaultSize is specified then the button is sized
67 appropriately for the bitmap.
70 Window style. See wxBitmapButton.
78 @remarks The bitmap parameter is normally the only bitmap you need to
79 provide, and wxWidgets will draw the button correctly
80 in its different states. If you want more control,
81 call any of the functions
86 @sa Create(), wxValidator
89 wxBitmapButton(wxWindow
* parent
, wxWindowID id
,
90 const wxBitmap
& bitmap
,
91 const wxPoint
& pos
= wxDefaultPosition
,
92 const wxSize
& size
= wxDefaultSize
,
93 long style
= wxBU_AUTODRAW
,
94 const wxValidator
& validator
= wxDefaultValidator
,
95 const wxString
& name
= "button");
99 Destructor, destroying the button.
104 Button creation function for two-step creation. For more details, see
107 bool Create(wxWindow
* parent
, wxWindowID id
,
108 const wxBitmap
& bitmap
,
110 const wxSize
& size
= wxDefaultSize
,
112 const wxValidator
& validator
,
113 const wxString
& name
= "button");
117 Returns the bitmap for the disabled state, may be invalid.
119 @returns A reference to the disabled state bitmap.
121 @sa SetBitmapDisabled()
123 const wxBitmap
GetBitmapDisabled();
124 wxBitmap
GetBitmapDisabled();
129 Returns the bitmap for the focused state, may be invalid.
131 @returns A reference to the focused state bitmap.
135 const wxBitmap
GetBitmapFocus();
136 wxBitmap
GetBitmapFocus();
141 Returns the bitmap used when the mouse is over the button, may be invalid.
145 const wxBitmap
GetBitmapHover();
146 wxBitmap
GetBitmapHover();
151 Returns the label bitmap (the one passed to the constructor), always valid.
153 @returns A reference to the button's label bitmap.
157 const wxBitmap
GetBitmapLabel();
158 wxBitmap
GetBitmapLabel();
162 Returns the bitmap for the selected state.
164 @returns A reference to the selected state bitmap.
166 @sa SetBitmapSelected()
168 wxBitmap
GetBitmapSelected();
171 Sets the bitmap for the disabled button appearance.
176 @sa GetBitmapDisabled(), SetBitmapLabel(),
177 SetBitmapSelected(), SetBitmapFocus()
179 void SetBitmapDisabled(const wxBitmap
& bitmap
);
182 Sets the bitmap for the button appearance when it has the keyboard focus.
187 @sa GetBitmapFocus(), SetBitmapLabel(),
188 SetBitmapSelected(), SetBitmapDisabled()
190 void SetBitmapFocus(const wxBitmap
& bitmap
);
193 Sets the bitmap to be shown when the mouse is over the button.
195 This function is new since wxWidgets version 2.7.0 and the hover bitmap is
196 currently only supported in wxMSW.
200 void SetBitmapHover(const wxBitmap
& bitmap
);
203 Sets the bitmap label for the button.
206 The bitmap label to set.
208 @remarks This is the bitmap used for the unselected state, and for all
209 other states if no other bitmaps are provided.
213 void SetBitmapLabel(const wxBitmap
& bitmap
);
216 Sets the bitmap for the selected (depressed) button appearance.
221 void SetBitmapSelected(const wxBitmap
& bitmap
);