]>
Commit | Line | Data |
---|---|---|
0e320a79 DW |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: checkbox.h | |
3 | // Purpose: wxCheckBox class | |
37f214d5 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
37f214d5 | 6 | // Created: 10/13/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
37f214d5 DW |
8 | // Copyright: (c) David Webster |
9 | // Licence: wxWindows licence | |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_CHECKBOX_H_ | |
13 | #define _WX_CHECKBOX_H_ | |
14 | ||
0e320a79 DW |
15 | #include "wx/control.h" |
16 | ||
17 | WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr; | |
18 | ||
19 | // Checkbox item (single checkbox) | |
20 | class WXDLLEXPORT wxBitmap; | |
21 | class WXDLLEXPORT wxCheckBox: public wxControl | |
22 | { | |
23 | DECLARE_DYNAMIC_CLASS(wxCheckBox) | |
24 | ||
25 | public: | |
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, | |
57c4d796 DW |
30 | #if wxUSE_VALIDATORS |
31 | # if defined(__VISAGECPP__) | |
32 | const wxValidator* validator = wxDefaultValidator, | |
33 | # else | |
0e320a79 | 34 | const wxValidator& validator = wxDefaultValidator, |
57c4d796 DW |
35 | # endif |
36 | #endif | |
0e320a79 DW |
37 | const wxString& name = wxCheckBoxNameStr) |
38 | { | |
39 | Create(parent, id, label, pos, size, style, validator, name); | |
40 | } | |
41 | ||
42 | bool Create(wxWindow *parent, wxWindowID id, const wxString& label, | |
43 | const wxPoint& pos = wxDefaultPosition, | |
44 | const wxSize& size = wxDefaultSize, long style = 0, | |
57c4d796 DW |
45 | #if wxUSE_VALIDATORS |
46 | # if defined(__VISAGECPP__) | |
47 | const wxValidator* validator = wxDefaultValidator, | |
48 | # else | |
0e320a79 | 49 | const wxValidator& validator = wxDefaultValidator, |
57c4d796 DW |
50 | # endif |
51 | #endif | |
0e320a79 | 52 | const wxString& name = wxCheckBoxNameStr); |
37f214d5 | 53 | |
0e320a79 DW |
54 | virtual void SetValue(bool); |
55 | virtual bool GetValue() const ; | |
37f214d5 DW |
56 | |
57 | virtual bool OS2Command(WXUINT param, WXWORD id); | |
0e320a79 DW |
58 | virtual void SetLabel(const wxString& label); |
59 | virtual void Command(wxCommandEvent& event); | |
37f214d5 DW |
60 | virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, |
61 | WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
62 | ||
63 | protected: | |
64 | virtual wxSize DoGetBestSize(); | |
0e320a79 DW |
65 | }; |
66 | ||
67 | class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox | |
68 | { | |
69 | DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox) | |
70 | ||
71 | public: | |
72 | int checkWidth ; | |
73 | int checkHeight ; | |
74 | ||
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, | |
57c4d796 DW |
79 | #if wxUSE_VALIDATORS |
80 | # if defined(__VISAGECPP__) | |
81 | const wxValidator* validator = wxDefaultValidator, | |
82 | # else | |
0e320a79 | 83 | const wxValidator& validator = wxDefaultValidator, |
57c4d796 DW |
84 | # endif |
85 | #endif | |
0e320a79 DW |
86 | const wxString& name = wxCheckBoxNameStr) |
87 | { | |
88 | Create(parent, id, label, pos, size, style, validator, name); | |
89 | } | |
90 | ||
91 | bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap, | |
92 | const wxPoint& pos = wxDefaultPosition, | |
93 | const wxSize& size = wxDefaultSize, long style = 0, | |
57c4d796 DW |
94 | #if wxUSE_VALIDATORS |
95 | # if defined(__VISAGECPP__) | |
96 | const wxValidator* validator = wxDefaultValidator, | |
97 | # else | |
0e320a79 | 98 | const wxValidator& validator = wxDefaultValidator, |
57c4d796 DW |
99 | # endif |
100 | #endif | |
0e320a79 | 101 | const wxString& name = wxCheckBoxNameStr); |
37f214d5 | 102 | |
0e320a79 DW |
103 | virtual void SetLabel(const wxBitmap& bitmap); |
104 | private: | |
54da4255 DW |
105 | virtual void SetLabel(const wxString& string) |
106 | { wxCheckBox::SetLabel(string); }; | |
0e320a79 DW |
107 | }; |
108 | #endif | |
109 | // _WX_CHECKBOX_H_ |