]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/bmpbuttn.h
Applied patch [ 649590 ] fixes bug 611264: wxFileDialog entry
[wxWidgets.git] / include / wx / os2 / bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: bmpbuttn.h
3 // Purpose: wxBitmapButton class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/13/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_BMPBUTTN_H_
13 #define _WX_BMPBUTTN_H_
14
15 #include "wx/button.h"
16
17 WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
18
19 #define wxDEFAULT_BUTTON_MARGIN 4
20
21 class WXDLLEXPORT 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 #if wxUSE_VALIDATORS
36 ,const wxValidator& rValidator = wxDefaultValidator
37 #endif
38 ,const wxString& rsName = wxButtonNameStr
39 )
40 {
41 Create( pParent
42 ,vId
43 ,rBitmap
44 ,rPos
45 ,rSize
46 ,lStyle
47 #if wxUSE_VALIDATORS
48 ,rValidator
49 #endif
50 ,rsName
51 );
52 }
53
54 bool Create( wxWindow* pParent
55 ,wxWindowID vId
56 ,const wxBitmap& rBitmap
57 ,const wxPoint& rPos = wxDefaultPosition
58 ,const wxSize& rSize = wxDefaultSize
59 ,long lStyle = wxBU_AUTODRAW
60 #if wxUSE_VALIDATORS
61 ,const wxValidator& rValidator = wxDefaultValidator
62 #endif
63 ,const wxString& rsName = wxButtonNameStr
64 );
65
66 virtual void SetLabel(const wxBitmap& rBitmap)
67 {
68 SetBitmapLabel(rBitmap);
69 }
70
71 #if WXWIN_COMPATIBILITY
72 wxBitmap* GetBitmap(void) const
73 {
74 return (wxBitmap *)&m_buttonBitmap;
75 }
76 #endif
77
78 //
79 // Implementation
80 //
81 virtual void SetDefault();
82 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* pItem);
83
84 private:
85
86 virtual void DrawFace( wxClientDC& rDC
87 ,bool bSel
88 );
89 virtual void DrawButtonFocus(wxClientDC& rDC);
90 virtual void DrawButtonDisable( wxClientDC& rDC
91 ,wxBitmap& rBmp
92 );
93 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
94
95 virtual void SetLabel(const wxString& rsString)
96 {
97 wxButton::SetLabel(rsString);
98 }
99 }; // end of CLASS wxBitmapButton
100
101 #endif // _WX_BMPBUTTN_H_
102