1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/bmpbuttn.h
3 // Purpose: wxBitmapButton class for wxUniversal
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_UNIV_BMPBUTTN_H_
13 #define _WX_UNIV_BMPBUTTN_H_
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "univbmpbuttn.h"
19 class WXDLLEXPORT wxBitmapButton
: public wxBitmapButtonBase
24 wxBitmapButton(wxWindow
*parent
,
26 const wxBitmap
& bitmap
,
27 const wxPoint
& pos
= wxDefaultPosition
,
28 const wxSize
& size
= wxDefaultSize
,
30 const wxValidator
& validator
= wxDefaultValidator
,
31 const wxString
& name
= wxButtonNameStr
);
33 bool Create(wxWindow
*parent
,
35 const wxBitmap
& bitmap
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
39 const wxValidator
& validator
= wxDefaultValidator
,
40 const wxString
& name
= wxButtonNameStr
);
42 virtual void SetMargins(int x
, int y
)
44 SetImageMargins(x
, y
);
46 wxBitmapButtonBase::SetMargins(x
, y
);
49 virtual bool Enable(bool enable
= TRUE
);
51 virtual bool SetCurrent(bool doit
= TRUE
);
54 virtual void Release();
57 void OnSetFocus(wxFocusEvent
& event
);
58 void OnKillFocus(wxFocusEvent
& event
);
60 // called when one of the bitmap is changed by user
61 virtual void OnSetBitmap();
63 // set bitmap to the given one if it's ok or to m_bmpNormal and return
64 // TRUE if the bitmap really changed
65 bool ChangeBitmap(const wxBitmap
& bmp
);
69 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
72 #endif // _WX_UNIV_BMPBUTTN_H_