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 wxCheckBoxBase
24 inline wxCheckBox() { }
25 inline wxCheckBox(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
, long style
= 0,
29 const wxValidator
& validator
= wxDefaultValidator
,
31 const wxString
& name
= wxCheckBoxNameStr
)
33 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
36 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
, long style
= 0,
40 const wxValidator
& validator
= wxDefaultValidator
,
42 const wxString
& name
= wxCheckBoxNameStr
);
44 virtual void SetValue(bool);
45 virtual bool GetValue() const ;
47 virtual bool OS2Command(WXUINT param
, WXWORD id
);
48 virtual void SetLabel(const wxString
& label
);
49 virtual void Command(wxCommandEvent
& event
);
50 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
51 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
54 virtual wxSize
DoGetBestSize() const;
56 DECLARE_DYNAMIC_CLASS(wxCheckBox
)
59 class WXDLLEXPORT wxBitmapCheckBox
: public wxCheckBox
61 DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox
)
67 inline wxBitmapCheckBox() { checkWidth
= -1; checkHeight
= -1; }
68 inline wxBitmapCheckBox(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*label
,
69 const wxPoint
& pos
= wxDefaultPosition
,
70 const wxSize
& size
= wxDefaultSize
, long style
= 0,
72 const wxValidator
& validator
= wxDefaultValidator
,
74 const wxString
& name
= wxCheckBoxNameStr
)
76 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
79 bool Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*bitmap
,
80 const wxPoint
& pos
= wxDefaultPosition
,
81 const wxSize
& size
= wxDefaultSize
, long style
= 0,
83 const wxValidator
& validator
= wxDefaultValidator
,
85 const wxString
& name
= wxCheckBoxNameStr
);
87 virtual void SetLabel(const wxBitmap
& bitmap
);
89 virtual void SetLabel(const wxString
& string
)
90 { wxCheckBox::SetLabel(string
); };