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 WXDLLIMPEXP_CORE wxBitmapButton
: public wxBitmapButtonBase
23 virtual ~wxBitmapButton();
24 wxBitmapButton(wxWindow
*parent
, wxWindowID id
, const wxBitmap
& bitmap
,
25 const wxPoint
& pos
= wxDefaultPosition
,
26 const wxSize
& size
= wxDefaultSize
, long style
= wxBU_AUTODRAW
,
27 const wxValidator
& validator
= wxDefaultValidator
,
28 const wxString
& name
= wxButtonNameStr
)
30 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
33 bool Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
& bitmap
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
, long style
= wxBU_AUTODRAW
,
36 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxButtonNameStr
);
40 virtual void ChangeBackgroundColour();
43 virtual wxSize
DoGetBestSize() const;
45 virtual void DoSetBitmap(const wxBitmap
& bitmap
, State which
);
46 virtual void OnSetBitmap();
48 // original bitmaps may be different from the ones we were initialized with
49 // if they were changed to reflect button background colour
50 wxBitmap m_bitmapsOriginal
[State_Max
];
52 wxBitmapCache m_bitmapCache
;
54 WXPixmap m_insensPixmap
;
56 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
59 #endif // _WX_BMPBUTTN_H_