1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/osx/checkbox.h
3 // Purpose:     wxCheckBox class
4 // Author:      Stefan Csomor
5 // Modified by:
6 // Created:     1998-01-01
7 // Copyright:   (c) Stefan Csomor
8 // Licence:     wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 
11 #ifndef _WX_CHECKBOX_H_
12 #define _WX_CHECKBOX_H_
13 
14 // Checkbox item (single checkbox)
15 class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
16 {
17 public:
wxCheckBox()18     wxCheckBox() { }
19     wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
20             const wxPoint& pos = wxDefaultPosition,
21             const wxSize& size = wxDefaultSize, long style = 0,
22             const wxValidator& validator = wxDefaultValidator,
23             const wxString& name = wxCheckBoxNameStr)
24     {
25         Create(parent, id, label, pos, size, style, validator, name);
26     }
27 
28     bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
29             const wxPoint& pos = wxDefaultPosition,
30             const wxSize& size = wxDefaultSize, long style = 0,
31             const wxValidator& validator = wxDefaultValidator,
32             const wxString& name = wxCheckBoxNameStr);
33     virtual void SetValue(bool);
34     virtual bool GetValue() const;
35 
36     virtual void Command(wxCommandEvent& event);
37 
38     // osx specific event handling common for all osx-ports
39 
40     virtual bool        OSXHandleClicked( double timestampsec );
41 protected:
42     void DoSet3StateValue(wxCheckBoxState val);
43     virtual wxCheckBoxState DoGet3StateValue() const;
44 
45     DECLARE_DYNAMIC_CLASS(wxCheckBox)
46 };
47 
48 class WXDLLIMPEXP_FWD_CORE wxBitmap;
49 class WXDLLIMPEXP_CORE wxBitmapCheckBox: public wxCheckBox
50 {
51 public:
52     int checkWidth;
53     int checkHeight;
54 
wxBitmapCheckBox()55     wxBitmapCheckBox()
56         : checkWidth(-1), checkHeight(-1)
57         { }
58 
59     wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
60             const wxPoint& pos = wxDefaultPosition,
61             const wxSize& size = wxDefaultSize, long style = 0,
62             const wxValidator& validator = wxDefaultValidator,
63             const wxString& name = wxCheckBoxNameStr)
64     {
65         Create(parent, id, label, pos, size, style, validator, name);
66     }
67 
68     bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
69             const wxPoint& pos = wxDefaultPosition,
70             const wxSize& size = wxDefaultSize, long style = 0,
71             const wxValidator& validator = wxDefaultValidator,
72             const wxString& name = wxCheckBoxNameStr);
73     virtual void SetValue(bool);
74     virtual bool GetValue() const;
75     virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
76     virtual void SetLabel(const wxBitmap *bitmap);
SetLabel(const wxString & WXUNUSED (name))77     virtual void SetLabel( const wxString & WXUNUSED(name) ) {}
78 
79     DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
80 };
81 #endif
82     // _WX_CHECKBOX_H_
83