]>
git.saurik.com Git - wxWidgets.git/blob - interface/bmpbuttn.h
d62458b54aaeb3e31e145d9c206710dd4915e210
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.
56 Button identifier. The value wxID_ANY indicates a default value.
58 Bitmap to be displayed.
62 Button size. If wxDefaultSize is specified then the button is
64 appropriately for the bitmap.
66 Window style. See wxBitmapButton.
72 @remarks The bitmap parameter is normally the only bitmap you need to
73 provide, and wxWidgets will draw the button correctly
74 in its different states. If you want more control, call
75 any of the functions SetBitmapSelected(),
79 @see Create(), wxValidator
82 wxBitmapButton(wxWindow
* parent
, wxWindowID id
,
83 const wxBitmap
& bitmap
,
84 const wxPoint
& pos
= wxDefaultPosition
,
85 const wxSize
& size
= wxDefaultSize
,
86 long style
= wxBU_AUTODRAW
,
87 const wxValidator
& validator
= wxDefaultValidator
,
88 const wxString
& name
= "button");
92 Destructor, destroying the button.
97 Button creation function for two-step creation. For more details, see
100 bool Create(wxWindow
* parent
, wxWindowID id
,
101 const wxBitmap
& bitmap
,
103 const wxSize
& size
= wxDefaultSize
,
105 const wxValidator
& validator
,
106 const wxString
& name
= "button");
110 Returns the bitmap for the disabled state, may be invalid.
112 @returns A reference to the disabled state bitmap.
114 @see SetBitmapDisabled()
116 const wxBitmap
GetBitmapDisabled();
117 const wxBitmap
& GetBitmapDisabled();
122 Returns the bitmap for the focused state, may be invalid.
124 @returns A reference to the focused state bitmap.
126 @see SetBitmapFocus()
128 const wxBitmap
GetBitmapFocus();
129 const wxBitmap
& GetBitmapFocus();
134 Returns the bitmap used when the mouse is over the button, may be invalid.
136 @see SetBitmapHover()
138 const wxBitmap
GetBitmapHover();
139 const wxBitmap
& GetBitmapHover();
144 Returns the label bitmap (the one passed to the constructor), always valid.
146 @returns A reference to the button's label bitmap.
148 @see SetBitmapLabel()
150 const wxBitmap
GetBitmapLabel();
151 const wxBitmap
& GetBitmapLabel();
155 Returns the bitmap for the selected state.
157 @returns A reference to the selected state bitmap.
159 @see SetBitmapSelected()
161 wxBitmap
GetBitmapSelected() const;
164 Sets the bitmap for the disabled button appearance.
169 @see GetBitmapDisabled(), SetBitmapLabel(),
170 SetBitmapSelected(), SetBitmapFocus()
172 void SetBitmapDisabled(const wxBitmap
& bitmap
);
175 Sets the bitmap for the button appearance when it has the keyboard focus.
180 @see GetBitmapFocus(), SetBitmapLabel(),
181 SetBitmapSelected(), SetBitmapDisabled()
183 void SetBitmapFocus(const wxBitmap
& bitmap
);
186 Sets the bitmap to be shown when the mouse is over the button.
187 This function is new since wxWidgets version 2.7.0 and the hover bitmap is
188 currently only supported in wxMSW.
190 @see GetBitmapHover()
192 void SetBitmapHover(const wxBitmap
& bitmap
);
195 Sets the bitmap label for the button.
198 The bitmap label to set.
200 @remarks This is the bitmap used for the unselected state, and for all
201 other states if no other bitmaps are provided.
203 @see GetBitmapLabel()
205 void SetBitmapLabel(const wxBitmap
& bitmap
);
208 Sets the bitmap for the selected (depressed) button appearance.
213 void SetBitmapSelected(const wxBitmap
& bitmap
);