]>
git.saurik.com Git - wxWidgets.git/blob - interface/bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxBitmapButton
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}
45 class wxBitmapButton
: public wxButton
50 Constructor, creating and showing a button.
53 Parent window. Must not be @NULL.
55 Button identifier. The value wxID_ANY indicates a default value.
57 Bitmap to be displayed.
61 Button size. If wxDefaultSize is specified then the button is
63 appropriately for the bitmap.
65 Window style. See wxBitmapButton.
71 @remarks The bitmap parameter is normally the only bitmap you need to
72 provide, and wxWidgets will draw the button correctly
73 in its different states. If you want more control, call
74 any of the functions SetBitmapSelected(),
78 @see Create(), wxValidator
81 wxBitmapButton(wxWindow
* parent
, wxWindowID id
,
82 const wxBitmap
& bitmap
,
83 const wxPoint
& pos
= wxDefaultPosition
,
84 const wxSize
& size
= wxDefaultSize
,
85 long style
= wxBU_AUTODRAW
,
86 const wxValidator
& validator
= wxDefaultValidator
,
87 const wxString
& name
= "button");
91 Destructor, destroying the button.
96 Button creation function for two-step creation. For more details, see
99 bool Create(wxWindow
* parent
, wxWindowID id
,
100 const wxBitmap
& bitmap
,
102 const wxSize
& size
= wxDefaultSize
,
104 const wxValidator
& validator
,
105 const wxString
& name
= "button");
109 Returns the bitmap for the disabled state, may be invalid.
111 @returns A reference to the disabled state bitmap.
113 @see SetBitmapDisabled()
115 const wxBitmap
GetBitmapDisabled();
116 const wxBitmap
& GetBitmapDisabled();
121 Returns the bitmap for the focused state, may be invalid.
123 @returns A reference to the focused state bitmap.
125 @see SetBitmapFocus()
127 const wxBitmap
GetBitmapFocus();
128 const wxBitmap
& GetBitmapFocus();
133 Returns the bitmap used when the mouse is over the button, may be invalid.
135 @see SetBitmapHover()
137 const wxBitmap
GetBitmapHover();
138 const wxBitmap
& GetBitmapHover();
143 Returns the label bitmap (the one passed to the constructor), always valid.
145 @returns A reference to the button's label bitmap.
147 @see SetBitmapLabel()
149 const wxBitmap
GetBitmapLabel();
150 const wxBitmap
& GetBitmapLabel();
154 Returns the bitmap for the selected state.
156 @returns A reference to the selected state bitmap.
158 @see SetBitmapSelected()
160 wxBitmap
GetBitmapSelected() const;
163 Sets the bitmap for the disabled button appearance.
168 @see GetBitmapDisabled(), SetBitmapLabel(),
169 SetBitmapSelected(), SetBitmapFocus()
171 void SetBitmapDisabled(const wxBitmap
& bitmap
);
174 Sets the bitmap for the button appearance when it has the keyboard focus.
179 @see GetBitmapFocus(), SetBitmapLabel(),
180 SetBitmapSelected(), SetBitmapDisabled()
182 void SetBitmapFocus(const wxBitmap
& bitmap
);
185 Sets the bitmap to be shown when the mouse is over the button.
187 @wxsince{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
);