]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/bmpbuttn.h
added wxConvFileName which is a variable, not define as wxConvFile; added comments...
[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 #include "wx/dcclient.h"
17
18 WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
19
20 #define wxDEFAULT_BUTTON_MARGIN 4
21
22 class WXDLLEXPORT wxBitmapButton: public wxBitmapButtonBase
23 {
24 public:
25 inline wxBitmapButton()
26 {
27 m_marginX = wxDEFAULT_BUTTON_MARGIN;
28 m_marginY = wxDEFAULT_BUTTON_MARGIN;
29 }
30 inline wxBitmapButton( wxWindow* pParent
31 ,wxWindowID vId
32 ,const wxBitmap& rBitmap
33 ,const wxPoint& rPos = wxDefaultPosition
34 ,const wxSize& rSize = wxDefaultSize
35 ,long lStyle = wxBU_AUTODRAW
36 ,const wxValidator& rValidator = wxDefaultValidator
37 ,const wxString& rsName = wxButtonNameStr
38 )
39 {
40 Create( pParent
41 ,vId
42 ,rBitmap
43 ,rPos
44 ,rSize
45 ,lStyle
46 ,rValidator
47 ,rsName
48 );
49 }
50
51 bool Create( wxWindow* pParent
52 ,wxWindowID vId
53 ,const wxBitmap& rBitmap
54 ,const wxPoint& rPos = wxDefaultPosition
55 ,const wxSize& rSize = wxDefaultSize
56 ,long lStyle = wxBU_AUTODRAW
57 ,const wxValidator& rValidator = wxDefaultValidator
58 ,const wxString& rsName = wxButtonNameStr
59 );
60
61 virtual void SetLabel(const wxBitmap& rBitmap)
62 {
63 SetBitmapLabel(rBitmap);
64 }
65
66 //
67 // Implementation
68 //
69 virtual void SetDefault();
70 virtual bool OS2OnDraw(WXDRAWITEMSTRUCT* pItem);
71
72 private:
73
74 virtual void DrawFace( wxClientDC& rDC
75 ,bool bSel
76 );
77 virtual void DrawButtonFocus(wxClientDC& rDC);
78 virtual void DrawButtonDisable( wxClientDC& rDC
79 ,wxBitmap& rBmp
80 );
81 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
82
83 virtual void SetLabel(const wxString& rsString)
84 {
85 wxButton::SetLabel(rsString);
86 }
87 }; // end of CLASS wxBitmapButton
88
89 #endif // _WX_BMPBUTTN_H_
90