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_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "bmpbuttn.h"
19 #include "wx/button.h"
20 #include "wx/bitmap.h"
23 #define wxDEFAULT_BUTTON_MARGIN 4
25 class WXDLLEXPORT wxBitmapButton
: public wxBitmapButtonBase
29 { m_marginX
= m_marginY
= wxDEFAULT_BUTTON_MARGIN
; }
30 wxBitmapButton(wxWindow
*parent
,
32 const wxBitmap
& bitmap
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 long style
= wxBU_AUTODRAW
,
36 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxButtonNameStr
)
39 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
42 bool Create(wxWindow
*parent
,
44 const wxBitmap
& bitmap
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 long style
= wxBU_AUTODRAW
,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
& name
= wxButtonNameStr
);
52 virtual bool SetBackgroundColour(const wxColour
& colour
);
53 virtual void SetDefault();
54 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT
*item
);
55 virtual void DrawFace( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool sel
);
56 virtual void DrawButtonFocus( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool sel
);
57 virtual void DrawButtonDisable( WXHDC dc
, int left
, int top
, int right
, int bottom
, bool with_marg
);
60 virtual wxSize
DoGetBestSize() const;
62 wxBrush m_brushDisabled
;
64 DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapButton
)