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