Derived from
wxButton
wxControl
wxWindow
wxEvtHandler
wxObject
Include files
<wx/bmpbuttn.h>
Remarks
A bitmap button can be supplied with a single bitmap, and wxWindows will draw all button states using this bitmap. If the application needs more control, additional bitmaps for the selected state, unpressed focused state, and greyed-out state may be supplied.
Window styles
| wxBU_AUTODRAW
| If this is specified, the button will be drawn automatically using the label bitmap only, providing a 3D-look border. If this style is not specified, the button will be drawn without borders and using all provided bitmaps. WIN32 only.
|
| wxBU_LEFT
| Left-justifies the bitmap label. WIN32 only.
|
| wxBU_TOP
| Aligns the bitmap label to the top of the button. WIN32 only.
|
| wxBU_RIGHT
| Right-justifies the bitmap label. WIN32 only.
|
| wxBU_BOTTOM
| Aligns the bitmap label to the bottom of the button. WIN32 only.
|
See also window styles overview .
Event handling
| EVT_BUTTON(id, func)
| Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.
|
See also
Public Methods | |
| wxBitmapButton () | |
| wxBitmapButton (wxWindow *parent, wxWindowID id, const wxBitmap &bitmap, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxBU_AUTODRAW, const wxValidator &validator=wxDefaultValidator, const wxString &name="button") | |
| ~wxBitmapButton () | |
| bool | Create (wxWindow *parent, wxWindowID id, const wxBitmap &bitmap, const wxPoint &pos, const wxSize &size=wxDefaultSize, long style=0, const wxValidator &validator, const wxString &name="button") |
| wxBitmap & | GetBitmapDisabled () const |
| wxBitmap & | GetBitmapFocus () const |
| wxBitmap & | GetBitmapLabel () const |
| wxBitmap & | GetBitmapSelected () const |
| void | SetBitmapDisabled (const wxBitmap &bitmap) |
| void | SetBitmapFocus (const wxBitmap &bitmap) |
| void | SetBitmapLabel (const wxBitmap &bitmap) |
| void | SetBitmapSelected (const wxBitmap &bitmap) |
|
|
Default constructor. |
|
||||||||||||||||||||||||||||||||||||
|
Constructor, creating and showing a button. Parameters
The bitmap parameter is normally the only bitmap you need to provide, and wxWindows will draw the button correctly in its different states. If you want more control, call any of the functions wxBitmapButton::SetBitmapSelected , wxBitmapButton::SetBitmapFocus , wxBitmapButton::SetBitmapDisabled . Note that the bitmap passed is smaller than the actual button created. See also |
|
|
Destructor, destroying the button. |
|
||||||||||||||||||||||||||||||||||||
|
Button creation function for two-step creation. For more details, see wxBitmapButton::wxBitmapButton . |
|
|
Returns the bitmap for the disabled state. Return value A reference to the disabled state bitmap. See also |
|
|
Returns the bitmap for the focused state. Return value A reference to the focused state bitmap. See also |
|
|
Returns the label bitmap (the one passed to the constructor). Return value A reference to the button's label bitmap. See also |
|
|
Returns the bitmap for the selected state. Return value A reference to the selected state bitmap. See also |
|
|
Sets the bitmap for the disabled button appearance. Parameters
wxBitmapButton::GetBitmapDisabled , wxBitmapButton::SetBitmapLabel , wxBitmapButton::SetBitmapSelected , wxBitmapButton::SetBitmapFocus |
|
|
Sets the bitmap for the button appearance when it has the keyboard focus. Parameters
wxBitmapButton::GetBitmapFocus , wxBitmapButton::SetBitmapLabel , wxBitmapButton::SetBitmapSelected , wxBitmapButton::SetBitmapDisabled |
|
|
Sets the bitmap label for the button. Parameters
This is the bitmap used for the unselected state, and for all other states if no other bitmaps are provided. See also |
|
|
Sets the bitmap for the selected (depressed) button appearance. Parameters
wxBitmapButton::GetBitmapSelected , wxBitmapButton::SetBitmapLabel , wxBitmapButton::SetBitmapFocus , wxBitmapButton::SetBitmapDisabled |
1.3-rc2