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/motif/bmpmotif.h"
21 #define wxDEFAULT_BUTTON_MARGIN 4
23 class WXDLLEXPORT wxBitmapButton
: public wxBitmapButtonBase
25 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
29 wxBitmapButton(wxWindow
*parent
, wxWindowID id
, const wxBitmap
& bitmap
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
, 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
, wxWindowID id
, const wxBitmap
& bitmap
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
, long style
= wxBU_AUTODRAW
,
41 const wxValidator
& validator
= wxDefaultValidator
,
42 const wxString
& name
= wxButtonNameStr
);
44 virtual void SetLabel(const wxBitmap
& bitmap
)
46 SetBitmapLabel(bitmap
);
48 virtual void SetLabel(const wxString
& label
)
50 wxControl::SetLabel(label
);
53 virtual void SetBitmapLabel(const wxBitmap
& bitmap
);
55 void SetBitmapSelected(const wxBitmap
& sel
);
56 void SetBitmapFocus(const wxBitmap
& focus
);
57 void SetBitmapDisabled(const wxBitmap
& disabled
);
61 virtual void ChangeBackgroundColour();
62 virtual wxSize
DoGetBestSize() const;
65 wxBitmap m_bmpNormalOriginal
; // May be different from m_buttonBitmap
66 // if m_buttonBitmap has been changed
67 // to reflect button background colour
68 wxBitmap m_bmpSelectedOriginal
;
69 wxBitmap m_bmpDisabledOriginal
;
71 wxBitmapCache m_bitmapCache
;
73 WXPixmap m_insensPixmap
;