1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/bmpbuttn.h
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_
15 #include "wx/button.h"
16 #include "wx/bitmap.h"
19 #define wxDEFAULT_BUTTON_MARGIN 4
21 class WXDLLEXPORT wxBitmapButton
: public wxBitmapButtonBase
26 wxBitmapButton(wxWindow
*parent
,
28 const wxBitmap
& bitmap
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
31 long style
= wxBU_AUTODRAW
,
32 const wxValidator
& validator
= wxDefaultValidator
,
33 const wxString
& name
= wxButtonNameStr
)
35 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
38 bool Create(wxWindow
*parent
,
40 const wxBitmap
& bitmap
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 const wxSize
& size
= wxDefaultSize
,
43 long style
= wxBU_AUTODRAW
,
44 const wxValidator
& validator
= wxDefaultValidator
,
45 const wxString
& name
= wxButtonNameStr
);
48 virtual bool SetBackgroundColour(const wxColour
& colour
);
49 virtual void SetDefault();
50 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT
*item
);
51 virtual void DrawFace( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool sel
);
52 virtual void DrawButtonFocus( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool sel
);
53 virtual void DrawButtonDisable( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool with_marg
);
56 virtual wxSize
DoGetBestSize() const;
58 // invalidate m_brushDisabled when system colours change
59 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
62 // the brush we use to draw disabled buttons
63 wxBrush m_brushDisabled
;
67 DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton
)