1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxBitmapButton class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_BMPBUTTN_H_
13 #define _WX_BMPBUTTN_H_
15 #include "wx/button.h"
17 WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr
;
19 #define wxDEFAULT_BUTTON_MARGIN 4
21 class WXDLLEXPORT wxBitmapButton
: public wxBitmapButtonBase
24 inline wxBitmapButton()
26 m_marginX
= wxDEFAULT_BUTTON_MARGIN
;
27 m_marginY
= wxDEFAULT_BUTTON_MARGIN
;
29 inline wxBitmapButton( wxWindow
* pParent
31 ,const wxBitmap
& rBitmap
32 ,const wxPoint
& rPos
= wxDefaultPosition
33 ,const wxSize
& rSize
= wxDefaultSize
34 ,long lStyle
= wxBU_AUTODRAW
36 ,const wxValidator
& rValidator
= wxDefaultValidator
38 ,const wxString
& rsName
= wxButtonNameStr
54 bool Create( wxWindow
* pParent
56 ,const wxBitmap
& rBitmap
57 ,const wxPoint
& rPos
= wxDefaultPosition
58 ,const wxSize
& rSize
= wxDefaultSize
59 ,long lStyle
= wxBU_AUTODRAW
61 ,const wxValidator
& rValidator
= wxDefaultValidator
63 ,const wxString
& rsName
= wxButtonNameStr
66 virtual void SetLabel(const wxBitmap
& rBitmap
)
68 SetBitmapLabel(rBitmap
);
71 #if WXWIN_COMPATIBILITY
72 wxBitmap
* GetBitmap(void) const
74 return (wxBitmap
*)&m_buttonBitmap
;
81 virtual void SetDefault();
82 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT
* pItem
);
86 virtual void DrawFace( wxClientDC
& rDC
89 virtual void DrawButtonFocus(wxClientDC
& rDC
);
90 virtual void DrawButtonDisable( wxClientDC
& rDC
93 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
95 virtual void SetLabel(const wxString
& rsString
)
97 wxButton::SetLabel(rsString
);
99 }; // end of CLASS wxBitmapButton
101 #endif // _WX_BMPBUTTN_H_