]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/bmpbuttn.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[wxWidgets.git] / include / wx / os2 / bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/bmpbuttn.h
3 // Purpose: wxBitmapButton class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/13/99
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_BMPBUTTN_H_
12 #define _WX_BMPBUTTN_H_
13
14 #include "wx/button.h"
15 #include "wx/dcclient.h"
16
17 WXDLLIMPEXP_DATA_CORE(extern const char) wxButtonNameStr[];
18
19 #define wxDEFAULT_BUTTON_MARGIN 4
20
21 class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
22 {
23 public:
24 inline wxBitmapButton()
25 {
26 m_marginX = wxDEFAULT_BUTTON_MARGIN;
27 m_marginY = wxDEFAULT_BUTTON_MARGIN;
28 }
29 inline wxBitmapButton( wxWindow* pParent
30 ,wxWindowID vId
31 ,const wxBitmap& rBitmap
32 ,const wxPoint& rPos = wxDefaultPosition
33 ,const wxSize& rSize = wxDefaultSize
34 ,long lStyle = wxBU_AUTODRAW
35 ,const wxValidator& rValidator = wxDefaultValidator
36 ,const wxString& rsName = wxButtonNameStr
37 )
38 {
39 Create( pParent
40 ,vId
41 ,rBitmap
42 ,rPos
43 ,rSize
44 ,lStyle
45 ,rValidator
46 ,rsName
47 );
48 }
49
50 bool Create( wxWindow* pParent
51 ,wxWindowID vId
52 ,const wxBitmap& rBitmap
53 ,const wxPoint& rPos = wxDefaultPosition
54 ,const wxSize& rSize = wxDefaultSize
55 ,long lStyle = wxBU_AUTODRAW
56 ,const wxValidator& rValidator = wxDefaultValidator
57 ,const wxString& rsName = wxButtonNameStr
58 );
59
60 virtual void SetLabel(const wxBitmap& rBitmap)
61 {
62 SetBitmapLabel(rBitmap);
63 }
64
65 //
66 // Implementation
67 //
68 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* pItem);
69
70 private:
71
72 virtual void DrawFace( wxClientDC& rDC
73 ,bool bSel
74 );
75 virtual void DrawButtonFocus(wxClientDC& rDC);
76 virtual void DrawButtonDisable( wxClientDC& rDC
77 ,wxBitmap& rBmp
78 );
79 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
80
81 virtual void SetLabel(const wxString& rsString)
82 {
83 wxButton::SetLabel(rsString);
84 }
85 }; // end of CLASS wxBitmapButton
86
87 #endif // _WX_BMPBUTTN_H_
88