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"
16 #include "wx/dcclient.h"
18 WXDLLEXPORT_DATA(extern const wxChar
) wxButtonNameStr
[];
20 #define wxDEFAULT_BUTTON_MARGIN 4
22 class WXDLLEXPORT wxBitmapButton
: public wxBitmapButtonBase
25 inline wxBitmapButton()
27 m_marginX
= wxDEFAULT_BUTTON_MARGIN
;
28 m_marginY
= wxDEFAULT_BUTTON_MARGIN
;
30 inline wxBitmapButton( wxWindow
* pParent
32 ,const wxBitmap
& rBitmap
33 ,const wxPoint
& rPos
= wxDefaultPosition
34 ,const wxSize
& rSize
= wxDefaultSize
35 ,long lStyle
= wxBU_AUTODRAW
36 ,const wxValidator
& rValidator
= wxDefaultValidator
37 ,const wxString
& rsName
= wxButtonNameStr
51 bool Create( wxWindow
* pParent
53 ,const wxBitmap
& rBitmap
54 ,const wxPoint
& rPos
= wxDefaultPosition
55 ,const wxSize
& rSize
= wxDefaultSize
56 ,long lStyle
= wxBU_AUTODRAW
57 ,const wxValidator
& rValidator
= wxDefaultValidator
58 ,const wxString
& rsName
= wxButtonNameStr
61 virtual void SetLabel(const wxBitmap
& rBitmap
)
63 SetBitmapLabel(rBitmap
);
69 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT
* pItem
);
73 virtual void DrawFace( wxClientDC
& rDC
76 virtual void DrawButtonFocus(wxClientDC
& rDC
);
77 virtual void DrawButtonDisable( wxClientDC
& rDC
80 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
82 virtual void SetLabel(const wxString
& rsString
)
84 wxButton::SetLabel(rsString
);
86 }; // end of CLASS wxBitmapButton
88 #endif // _WX_BMPBUTTN_H_