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 char*) wxCheckBoxNameStr
;
23 // Checkbox item (single checkbox)
24 class WXDLLEXPORT wxBitmap
;
25 class WXDLLEXPORT wxCheckBox
: public wxControl
27 DECLARE_DYNAMIC_CLASS(wxCheckBox
)
30 inline wxCheckBox(void) { }
31 inline 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
);
45 virtual void SetValue(bool);
46 virtual bool GetValue(void) const ;
47 virtual void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
48 void SetSize(const wxRect
& rect
, int sizeFlags
= wxSIZE_AUTO
)
49 { wxWindow::SetSize(rect
, sizeFlags
); }
50 void SetSize(const wxSize
& size
) { wxWindow::SetSize(size
); }
52 virtual bool MSWCommand(WXUINT param
, WXWORD id
);
53 virtual void SetLabel(const wxString
& label
);
54 virtual void Command(wxCommandEvent
& event
);
55 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
56 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
59 class WXDLLEXPORT wxBitmapCheckBox
: public wxCheckBox
61 DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox
)
67 inline wxBitmapCheckBox(void) { 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,
71 const wxValidator
& validator
= wxDefaultValidator
,
72 const wxString
& name
= wxCheckBoxNameStr
)
74 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
77 bool Create(wxWindow
*parent
, wxWindowID id
, const wxBitmap
*bitmap
,
78 const wxPoint
& pos
= wxDefaultPosition
,
79 const wxSize
& size
= wxDefaultSize
, long style
= 0,
80 const wxValidator
& validator
= wxDefaultValidator
,
81 const wxString
& name
= wxCheckBoxNameStr
);
82 virtual void SetValue(bool);
83 virtual bool GetValue(void) const ;
84 virtual void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
85 void SetSize(const wxRect
& rect
, int sizeFlags
= wxSIZE_AUTO
)
86 { wxWindow::SetSize(rect
, sizeFlags
); }
87 void SetSize(const wxSize
& size
) { wxWindow::SetSize(size
); }
89 virtual void SetLabel(const wxBitmap
*bitmap
);