]> git.saurik.com Git - wxWidgets.git/blame - include/wx/univ/bmpbuttn.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[wxWidgets.git] / include / wx / univ / bmpbuttn.h
CommitLineData
1e6feb95
VZ
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
1e6feb95 7// Copyright: (c) Vadim Zeitlin
65571936 8// Licence: wxWindows licence
1e6feb95
VZ
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_UNIV_BMPBUTTN_H_
12#define _WX_UNIV_BMPBUTTN_H_
13
53a2db12 14class WXDLLIMPEXP_CORE wxBitmapButton : public wxBitmapButtonBase
1e6feb95
VZ
15{
16public:
6463b9f5 17 wxBitmapButton() { }
1e6feb95
VZ
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,
6463b9f5
JS
26 const wxString& name = wxButtonNameStr)
27 {
28 Create(parent, id, bitmap, pos, size, style, validator, name);
29 }
1e6feb95
VZ
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 {
be9ba6e5 42 SetBitmapMargins(x, y);
1e6feb95
VZ
43
44 wxBitmapButtonBase::SetMargins(x, y);
45 }
46
a290fa5a 47 virtual bool Enable(bool enable = true);
1e6feb95 48
a290fa5a 49 virtual bool SetCurrent(bool doit = true);
1e6feb95
VZ
50
51 virtual void Press();
52 virtual void Release();
53
54protected:
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
2352862a
VZ
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
1e6feb95
VZ
63 bool ChangeBitmap(const wxBitmap& bmp);
64
65private:
66 DECLARE_EVENT_TABLE()
67 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
68};
69
70#endif // _WX_UNIV_BMPBUTTN_H_
71