1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxBitmapButton class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_BMPBUTTN_H_
13 #define _WX_BMPBUTTN_H_
16 #pragma interface "bmpbuttn.h"
19 #include "wx/button.h"
20 #include "wx/bitmap.h"
22 #define wxDEFAULT_BUTTON_MARGIN 4
24 class WXDLLEXPORT wxBitmapButton
: public wxBitmapButtonBase
28 { m_marginX
= m_marginY
= wxDEFAULT_BUTTON_MARGIN
; }
29 wxBitmapButton(wxWindow
*parent
,
31 const wxBitmap
& bitmap
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 long style
= wxBU_AUTODRAW
,
35 const wxValidator
& validator
= wxDefaultValidator
,
36 const wxString
& name
= wxButtonNameStr
)
38 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
41 bool Create(wxWindow
*parent
,
43 const wxBitmap
& bitmap
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 long style
= wxBU_AUTODRAW
,
47 const wxValidator
& validator
= wxDefaultValidator
,
48 const wxString
& name
= wxButtonNameStr
);
50 #if WXWIN_COMPATIBILITY
51 wxBitmap
*GetBitmap() const { return (wxBitmap
*) &GetBitmapLabel(); }
55 virtual void SetDefault();
56 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT
*item
);
57 virtual void DrawFace( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool sel
);
58 virtual void DrawButtonFocus( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool sel
);
59 virtual void DrawButtonDisable( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool with_marg
);
62 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)