1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/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/motif/bmpmotif.h"
17 #define wxDEFAULT_BUTTON_MARGIN 4
19 class WXDLLEXPORT wxBitmapButton
: public wxBitmapButtonBase
21 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
25 wxBitmapButton(wxWindow
*parent
, wxWindowID id
, const wxBitmap
& bitmap
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
, long style
= wxBU_AUTODRAW
,
28 const wxValidator
& validator
= wxDefaultValidator
,
29 const wxString
& name
= wxButtonNameStr
)
31 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
34 bool Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
& bitmap
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
, long style
= wxBU_AUTODRAW
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
& name
= wxButtonNameStr
);
40 virtual void SetLabel(const wxBitmap
& bitmap
)
42 SetBitmapLabel(bitmap
);
44 virtual void SetLabel(const wxString
& label
)
46 wxControl::SetLabel(label
);
49 virtual void SetBitmapLabel(const wxBitmap
& bitmap
);
51 void SetBitmapSelected(const wxBitmap
& sel
);
52 void SetBitmapFocus(const wxBitmap
& focus
);
53 void SetBitmapDisabled(const wxBitmap
& disabled
);
57 virtual void ChangeBackgroundColour();
58 virtual wxSize
DoGetBestSize() const;
61 wxBitmap m_bmpNormalOriginal
; // May be different from m_buttonBitmap
62 // if m_buttonBitmap has been changed
63 // to reflect button background colour
64 wxBitmap m_bmpSelectedOriginal
;
65 wxBitmap m_bmpDisabledOriginal
;
67 wxBitmapCache m_bitmapCache
;
69 WXPixmap m_insensPixmap
;