1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/bmpbuttn.h
3 // Purpose: wxBitmapButton class for wxUniversal
4 // Author: Vadim Zeitlin
7 // Copyright: (c) Vadim Zeitlin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_UNIV_BMPBUTTN_H_
12 #define _WX_UNIV_BMPBUTTN_H_
14 class WXDLLIMPEXP_CORE wxBitmapButton
: public wxBitmapButtonBase
19 wxBitmapButton(wxWindow
*parent
,
21 const wxBitmap
& bitmap
,
22 const wxPoint
& pos
= wxDefaultPosition
,
23 const wxSize
& size
= wxDefaultSize
,
25 const wxValidator
& validator
= wxDefaultValidator
,
26 const wxString
& name
= wxButtonNameStr
)
28 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
31 bool Create(wxWindow
*parent
,
33 const wxBitmap
& bitmap
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
& name
= wxButtonNameStr
);
40 virtual void SetMargins(int x
, int y
)
42 SetBitmapMargins(x
, y
);
44 wxBitmapButtonBase::SetMargins(x
, y
);
47 virtual bool Enable(bool enable
= true);
49 virtual bool SetCurrent(bool doit
= true);
52 virtual void Release();
55 void OnSetFocus(wxFocusEvent
& event
);
56 void OnKillFocus(wxFocusEvent
& event
);
58 // called when one of the bitmap is changed by user
59 virtual void OnSetBitmap();
61 // set bitmap to the given one if it's ok or to the normal bitmap and
62 // return true if the bitmap really changed
63 bool ChangeBitmap(const wxBitmap
& bmp
);
67 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
70 #endif // _WX_UNIV_BMPBUTTN_H_