1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCheckBox class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CHECKBOX_H_
13 #define _WX_CHECKBOX_H_
16 #pragma interface "checkbox.h"
19 #include "wx/control.h"
21 WXDLLEXPORT_DATA(extern const wxChar
*) wxCheckBoxNameStr
;
23 // Checkbox item (single checkbox)
24 class WXDLLEXPORT wxBitmap
;
25 class WXDLLEXPORT wxCheckBox
: public wxControl
27 DECLARE_DYNAMIC_CLASS(wxCheckBox
)
31 wxCheckBox(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
, long style
= 0,
34 const wxValidator
& validator
= wxDefaultValidator
,
35 const wxString
& name
= wxCheckBoxNameStr
)
37 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
40 bool Create(wxWindow
*parent
, wxWindowID id
, const wxString
& label
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 const wxSize
& size
= wxDefaultSize
, long style
= 0,
43 const wxValidator
& validator
= wxDefaultValidator
,
44 const wxString
& name
= wxCheckBoxNameStr
);
46 virtual void SetValue(bool value
);
47 virtual bool GetValue() const ;
49 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
50 virtual void SetLabel(const wxString
& label
);
51 virtual void Command(wxCommandEvent
& event
);
52 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
53 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
56 virtual void DoSetSize(int x
, int y
,
57 int width
, int height
,
58 int sizeFlags
= wxSIZE_AUTO
);
61 class WXDLLEXPORT wxBitmapCheckBox
: public wxCheckBox
63 DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox
)
69 wxBitmapCheckBox() { checkWidth
= -1; checkHeight
= -1; }
70 wxBitmapCheckBox(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*label
,
71 const wxPoint
& pos
= wxDefaultPosition
,
72 const wxSize
& size
= wxDefaultSize
, long style
= 0,
73 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,
82 const wxValidator
& validator
= wxDefaultValidator
,
83 const wxString
& name
= wxCheckBoxNameStr
);
85 virtual void SetValue(bool value
);
86 virtual bool GetValue() const ;
88 virtual void SetLabel(const wxBitmap
& bitmap
);
91 virtual void DoSetSize(int x
, int y
,
92 int width
, int height
,
93 int sizeFlags
= wxSIZE_AUTO
);