1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCheckBox class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CHECKBOX_H_
13 #define _WX_CHECKBOX_H_
15 #include "wx/control.h"
17 WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr
;
19 // Checkbox item (single checkbox)
20 class WXDLLEXPORT wxBitmap
;
21 class WXDLLEXPORT wxCheckBox
: public wxControl
23 DECLARE_DYNAMIC_CLASS(wxCheckBox
)
26 inline wxCheckBox() { }
27 inline wxCheckBox(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
28 const wxPoint
& pos
= wxDefaultPosition
,
29 const wxSize
& size
= wxDefaultSize
, long style
= 0,
31 # if defined(__VISAGECPP__)
32 const wxValidator
* validator
= wxDefaultValidator
,
34 const wxValidator
& validator
= wxDefaultValidator
,
37 const wxString
& name
= wxCheckBoxNameStr
)
39 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
42 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
, long style
= 0,
46 # if defined(__VISAGECPP__)
47 const wxValidator
* validator
= wxDefaultValidator
,
49 const wxValidator
& validator
= wxDefaultValidator
,
52 const wxString
& name
= wxCheckBoxNameStr
);
54 virtual void SetValue(bool);
55 virtual bool GetValue() const ;
57 virtual bool OS2Command(WXUINT param
, WXWORD id
);
58 virtual void SetLabel(const wxString
& label
);
59 virtual void Command(wxCommandEvent
& event
);
60 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
61 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
64 virtual wxSize
DoGetBestSize();
67 class WXDLLEXPORT wxBitmapCheckBox
: public wxCheckBox
69 DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox
)
75 inline wxBitmapCheckBox() { checkWidth
= -1; checkHeight
= -1; }
76 inline wxBitmapCheckBox(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*label
,
77 const wxPoint
& pos
= wxDefaultPosition
,
78 const wxSize
& size
= wxDefaultSize
, long style
= 0,
80 # if defined(__VISAGECPP__)
81 const wxValidator
* validator
= wxDefaultValidator
,
83 const wxValidator
& validator
= wxDefaultValidator
,
86 const wxString
& name
= wxCheckBoxNameStr
)
88 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
91 bool Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*bitmap
,
92 const wxPoint
& pos
= wxDefaultPosition
,
93 const wxSize
& size
= wxDefaultSize
, long style
= 0,
95 # if defined(__VISAGECPP__)
96 const wxValidator
* validator
= wxDefaultValidator
,
98 const wxValidator
& validator
= wxDefaultValidator
,
101 const wxString
& name
= wxCheckBoxNameStr
);
103 virtual void SetLabel(const wxBitmap
& bitmap
);
105 virtual void SetLabel(const wxString
& string
)
106 { wxCheckBox::SetLabel(string
); };