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 class WXDLLIMPEXP_CORE wxBitmapButton
: public wxBitmapButtonBase
20 wxBitmapButton(wxWindow
*parent
,
22 const wxBitmap
& bitmap
,
23 const wxPoint
& pos
= wxDefaultPosition
,
24 const wxSize
& size
= wxDefaultSize
,
26 const wxValidator
& validator
= wxDefaultValidator
,
27 const wxString
& name
= wxButtonNameStr
)
29 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
32 bool Create(wxWindow
*parent
,
34 const wxBitmap
& bitmap
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
38 const wxValidator
& validator
= wxDefaultValidator
,
39 const wxString
& name
= wxButtonNameStr
);
41 virtual void SetMargins(int x
, int y
)
43 SetBitmapMargins(x
, y
);
45 wxBitmapButtonBase::SetMargins(x
, y
);
48 virtual bool Enable(bool enable
= true);
50 virtual bool SetCurrent(bool doit
= true);
53 virtual void Release();
56 void OnSetFocus(wxFocusEvent
& event
);
57 void OnKillFocus(wxFocusEvent
& event
);
59 // called when one of the bitmap is changed by user
60 virtual void OnSetBitmap();
62 // set bitmap to the given one if it's ok or to the normal bitmap and
63 // return true if the bitmap really changed
64 bool ChangeBitmap(const wxBitmap
& bmp
);
68 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
71 #endif // _WX_UNIV_BMPBUTTN_H_