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 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
36 bool Create(wxWindow
*parent
,
38 const wxBitmap
& bitmap
,
39 const wxPoint
& pos
= wxDefaultPosition
,
40 const wxSize
& size
= wxDefaultSize
,
42 const wxValidator
& validator
= wxDefaultValidator
,
43 const wxString
& name
= wxButtonNameStr
);
45 virtual void SetMargins(int x
, int y
)
47 SetImageMargins(x
, y
);
49 wxBitmapButtonBase::SetMargins(x
, y
);
52 virtual bool Enable(bool enable
= TRUE
);
54 virtual bool SetCurrent(bool doit
= TRUE
);
57 virtual void Release();
60 void OnSetFocus(wxFocusEvent
& event
);
61 void OnKillFocus(wxFocusEvent
& event
);
63 // called when one of the bitmap is changed by user
64 virtual void OnSetBitmap();
66 // set bitmap to the given one if it's ok or to m_bmpNormal and return
67 // TRUE if the bitmap really changed
68 bool ChangeBitmap(const wxBitmap
& bmp
);
72 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
75 #endif // _WX_UNIV_BMPBUTTN_H_