]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
1e6feb95 | 2 | // Name: wx/msw/checkbox.h |
2bda0e17 KB |
3 | // Purpose: wxCheckBox class |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
bbcdf8bc | 7 | // Copyright: (c) Julian Smart |
65571936 | 8 | // Licence: wxWindows licence |
2bda0e17 KB |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
bbcdf8bc JS |
11 | #ifndef _WX_CHECKBOX_H_ |
12 | #define _WX_CHECKBOX_H_ | |
2bda0e17 | 13 | |
2bda0e17 | 14 | // Checkbox item (single checkbox) |
53a2db12 | 15 | class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase |
2bda0e17 | 16 | { |
bfc6fde4 VZ |
17 | public: |
18 | wxCheckBox() { } | |
2b5f62a0 VZ |
19 | wxCheckBox(wxWindow *parent, |
20 | wxWindowID id, | |
21 | const wxString& label, | |
22 | const wxPoint& pos = wxDefaultPosition, | |
23 | const wxSize& size = wxDefaultSize, | |
24 | long style = 0, | |
25 | const wxValidator& validator = wxDefaultValidator, | |
26 | const wxString& name = wxCheckBoxNameStr) | |
bfc6fde4 VZ |
27 | { |
28 | Create(parent, id, label, pos, size, style, validator, name); | |
29 | } | |
30 | ||
2b5f62a0 VZ |
31 | bool Create(wxWindow *parent, |
32 | wxWindowID id, | |
33 | const wxString& label, | |
34 | const wxPoint& pos = wxDefaultPosition, | |
35 | const wxSize& size = wxDefaultSize, | |
36 | long style = 0, | |
37 | const wxValidator& validator = wxDefaultValidator, | |
38 | const wxString& name = wxCheckBoxNameStr); | |
bfc6fde4 | 39 | |
0da52ad1 | 40 | virtual void SetValue(bool value); |
2b5f62a0 | 41 | virtual bool GetValue() const; |
bfc6fde4 | 42 | |
2f259810 | 43 | // override some base class virtuals |
533171c2 VZ |
44 | virtual void SetLabel(const wxString& label); |
45 | ||
2b5f62a0 | 46 | virtual bool MSWCommand(WXUINT param, WXWORD id); |
bfc6fde4 | 47 | virtual void Command(wxCommandEvent& event); |
2f259810 | 48 | virtual bool SetForegroundColour(const wxColour& colour); |
6f02a879 | 49 | virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item); |
bfc6fde4 | 50 | |
a047aff2 JS |
51 | // returns true if the platform should explicitly apply a theme border |
52 | virtual bool CanApplyThemeBorder() const { return false; } | |
53 | ||
9b9a7c33 VZ |
54 | // make the checkbox owner drawn or reset it to normal style |
55 | void MSWMakeOwnerDrawn(bool ownerDrawn); | |
56 | ||
687823a1 VZ |
57 | // implementation only from now on |
58 | virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const; | |
59 | ||
bfc6fde4 | 60 | protected: |
e380ca3c | 61 | virtual wxSize DoGetBestClientSize() const; |
1e6feb95 | 62 | |
8941fa88 | 63 | virtual void DoSet3StateValue(wxCheckBoxState value); |
8941fa88 VZ |
64 | virtual wxCheckBoxState DoGet3StateValue() const; |
65 | ||
2f259810 VZ |
66 | // return true if this checkbox is owner drawn |
67 | bool IsOwnerDrawn() const; | |
68 | ||
1e6feb95 | 69 | private: |
2f259810 VZ |
70 | // common part of all ctors |
71 | void Init(); | |
72 | ||
73 | // event handlers used by owner-drawn checkbox | |
74 | void OnMouseEnterOrLeave(wxMouseEvent& event); | |
75 | void OnMouseLeft(wxMouseEvent& event); | |
76 | void OnFocus(wxFocusEvent& event); | |
77 | ||
78 | ||
79 | // current state of the checkbox | |
80 | wxCheckBoxState m_state; | |
81 | ||
82 | // true if the checkbox is currently pressed | |
83 | bool m_isPressed; | |
84 | ||
85 | // true if mouse is currently over the control | |
86 | bool m_isHot; | |
87 | ||
88 | ||
fc7a2a60 | 89 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxCheckBox) |
2bda0e17 KB |
90 | }; |
91 | ||
2bda0e17 | 92 | #endif |
bbcdf8bc | 93 | // _WX_CHECKBOX_H_ |