1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/os2/checkbox.h
3 // Purpose:     wxCheckBox 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_CHECKBOX_H_
12 #define _WX_CHECKBOX_H_
13 
14 #include "wx/control.h"
15 
16 // Checkbox item (single checkbox)
17 class WXDLLIMPEXP_FWD_CORE wxBitmap;
18 class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
19 {
20  public:
wxCheckBox()21     inline wxCheckBox() { }
22     inline wxCheckBox( wxWindow*          pParent
23                       ,wxWindowID         vId
24                       ,const wxString&    rsLabel
25                       ,const wxPoint&     rPos = wxDefaultPosition
26                       ,const wxSize&      rSize = wxDefaultSize
27                       ,long lStyle = 0
28                       ,const wxValidator& rValidator = wxDefaultValidator
29                       ,const wxString&    rsName = wxCheckBoxNameStr
30                      )
31     {
32         Create( pParent
33                ,vId
34                ,rsLabel
35                ,rPos
36                ,rSize
37                ,lStyle
38                ,rValidator
39                ,rsName
40               );
41     }
42 
43     bool Create( wxWindow* pParent
44                 ,wxWindowID         vId
45                 ,const wxString&    rsLabel
46                 ,const wxPoint&     rPos = wxDefaultPosition
47                 ,const wxSize&      rSize = wxDefaultSize
48                 ,long lStyle = 0
49                 ,const wxValidator& rValidator = wxDefaultValidator
50                 ,const wxString&    rsName = wxCheckBoxNameStr
51                );
52 
53   virtual void SetValue(bool bValue);
54   virtual bool GetValue(void) const ;
55 
56   virtual bool OS2Command( WXUINT uParam
57                           ,WXWORD wId
58                          );
59   virtual void SetLabel(const wxString& rsLabel);
60   virtual void Command(wxCommandEvent& rEvent);
61 
62 protected:
63   virtual wxSize DoGetBestSize(void) const;
64 private:
65   DECLARE_DYNAMIC_CLASS(wxCheckBox)
66 };
67 
68 class WXDLLIMPEXP_CORE wxBitmapCheckBox: public wxCheckBox
69 {
70  public:
71 
wxBitmapCheckBox()72     inline wxBitmapCheckBox() { m_nCheckWidth = -1; m_nCheckHeight = -1; }
73     inline wxBitmapCheckBox( wxWindow*          pParent
74                             ,wxWindowID         vId
75                             ,const wxBitmap*    pLabel
76                             ,const wxPoint&     rPos = wxDefaultPosition
77                             ,const wxSize&      rSize = wxDefaultSize
78                             ,long               lStyle = 0
79                             ,const wxValidator& rValidator = wxDefaultValidator
80                             ,const wxString&    rsName = wxCheckBoxNameStr
81                            )
82     {
83         Create( pParent
84                ,vId
85                ,pLabel
86                ,rPos
87                ,rSize
88                ,lStyle
89                ,rValidator
90                ,rsName
91               );
92     }
93 
94     bool Create( wxWindow*          pParent
95                 ,wxWindowID         vId
96                 ,const wxBitmap*    pLabel
97                 ,const wxPoint&     rPos = wxDefaultPosition
98                 ,const wxSize&      rSize = wxDefaultSize
99                 ,long               lStyle = 0
100                 ,const wxValidator& rValidator = wxDefaultValidator
101                 ,const wxString&    rsName = wxCheckBoxNameStr
102                );
103 
104     virtual void SetLabel(const wxBitmap& rBitmap);
105 
106     int                             m_nCheckWidth;
107     int                             m_nCheckHeight;
108 
109 private:
110 
SetLabel(const wxString & rsString)111     virtual void SetLabel(const wxString& rsString)
112     { wxCheckBox::SetLabel(rsString); }
113     DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
114 };
115 #endif
116     // _WX_CHECKBOX_H_
117