]> git.saurik.com Git - wxWidgets.git/blob - include/wx/univ/bmpbuttn.h
Add wxDEPRECATED_MSG() and use it in a couple of places.
[wxWidgets.git] / include / wx / univ / bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/bmpbuttn.h
3 // Purpose: wxBitmapButton class for wxUniversal
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 25.08.00
7 // Copyright: (c) Vadim Zeitlin
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_UNIV_BMPBUTTN_H_
12 #define _WX_UNIV_BMPBUTTN_H_
13
14 class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
15 {
16 public:
17 wxBitmapButton() { }
18
19 wxBitmapButton(wxWindow *parent,
20 wxWindowID id,
21 const wxBitmap& bitmap,
22 const wxPoint& pos = wxDefaultPosition,
23 const wxSize& size = wxDefaultSize,
24 long style = 0,
25 const wxValidator& validator = wxDefaultValidator,
26 const wxString& name = wxButtonNameStr)
27 {
28 Create(parent, id, bitmap, pos, size, style, validator, name);
29 }
30
31 bool Create(wxWindow *parent,
32 wxWindowID id,
33 const wxBitmap& bitmap,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = 0,
37 const wxValidator& validator = wxDefaultValidator,
38 const wxString& name = wxButtonNameStr);
39
40 virtual void SetMargins(int x, int y)
41 {
42 SetBitmapMargins(x, y);
43
44 wxBitmapButtonBase::SetMargins(x, y);
45 }
46
47 virtual bool Enable(bool enable = true);
48
49 virtual bool SetCurrent(bool doit = true);
50
51 virtual void Press();
52 virtual void Release();
53
54 protected:
55 void OnSetFocus(wxFocusEvent& event);
56 void OnKillFocus(wxFocusEvent& event);
57
58 // called when one of the bitmap is changed by user
59 virtual void OnSetBitmap();
60
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);
64
65 private:
66 DECLARE_EVENT_TABLE()
67 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
68 };
69
70 #endif // _WX_UNIV_BMPBUTTN_H_
71