]> git.saurik.com Git - wxWidgets.git/blob - include/wx/univ/bmpbuttn.h
Added MSWPositionForWxMenu() method which is used to translate wxWindows
[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 // RCS-ID: $Id$
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_UNIV_BMPBUTTN_H_
13 #define _WX_UNIV_BMPBUTTN_H_
14
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "univbmpbuttn.h"
17 #endif
18
19 class WXDLLEXPORT wxBitmapButton : public wxBitmapButtonBase
20 {
21 public:
22 wxBitmapButton();
23
24 wxBitmapButton(wxWindow *parent,
25 wxWindowID id,
26 const wxBitmap& bitmap,
27 const wxPoint& pos = wxDefaultPosition,
28 const wxSize& size = wxDefaultSize,
29 long style = 0,
30 const wxValidator& validator = wxDefaultValidator,
31 const wxString& name = wxButtonNameStr);
32
33 bool Create(wxWindow *parent,
34 wxWindowID id,
35 const wxBitmap& bitmap,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
38 long style = 0,
39 const wxValidator& validator = wxDefaultValidator,
40 const wxString& name = wxButtonNameStr);
41
42 virtual void SetMargins(int x, int y)
43 {
44 SetImageMargins(x, y);
45
46 wxBitmapButtonBase::SetMargins(x, y);
47 }
48
49 virtual bool Enable(bool enable = TRUE);
50
51 virtual bool SetCurrent(bool doit = TRUE);
52
53 virtual void Press();
54 virtual void Release();
55
56 protected:
57 void OnSetFocus(wxFocusEvent& event);
58 void OnKillFocus(wxFocusEvent& event);
59
60 // called when one of the bitmap is changed by user
61 virtual void OnSetBitmap();
62
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);
66
67 private:
68 DECLARE_EVENT_TABLE()
69 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
70 };
71
72 #endif // _WX_UNIV_BMPBUTTN_H_
73