]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: _checkbox.i | |
3 | // Purpose: SWIG interface defs for wxCheckBox | |
4 | // | |
5 | // Author: Robin Dunn | |
6 | // | |
7 | // Created: 10-June-1998 | |
8 | // RCS-ID: $Id$ | |
9 | // Copyright: (c) 2003 by Total Control Software | |
10 | // Licence: wxWindows license | |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | // Not a %module | |
14 | ||
15 | ||
16 | //--------------------------------------------------------------------------- | |
17 | %newgroup; | |
18 | ||
19 | MAKE_CONST_WXSTRING(CheckBoxNameStr); | |
20 | ||
21 | ||
22 | enum { | |
23 | // Determine whether to use a 3-state or 2-state | |
24 | // checkbox. 3-state enables to differentiate | |
25 | // between 'unchecked', 'checked' and 'undetermined'. | |
26 | wxCHK_2STATE, | |
27 | wxCHK_3STATE, | |
28 | ||
29 | ||
30 | // If this style is set the user can set the checkbox to the | |
31 | // undetermined state. If not set the undetermined set can only | |
32 | // be set programmatically. | |
33 | // This style can only be used with 3 state checkboxes. | |
34 | wxCHK_ALLOW_3RD_STATE_FOR_USER, | |
35 | }; | |
36 | ||
37 | enum wxCheckBoxState | |
38 | { | |
39 | wxCHK_UNCHECKED, | |
40 | wxCHK_CHECKED, | |
41 | wxCHK_UNDETERMINED /* 3-state checkbox only */ | |
42 | }; | |
43 | ||
44 | ||
45 | //--------------------------------------------------------------------------- | |
46 | ||
47 | DocStr(wxCheckBox, | |
48 | "A checkbox is a labelled box which by default is either on (checkmark is | |
49 | visible) or off (no checkmark). Optionally (When the wxCHK_3STATE style flag | |
50 | is set) it can have a third state, called the mixed or undetermined | |
51 | state. Often this is used as a \"Does Not Apply\" state."); | |
52 | ||
53 | RefDoc(wxCheckBox, " | |
54 | Styles | |
55 | wx.CHK_2STATE: Create a 2-state checkbox. This is the default. | |
56 | wx.CHK_3STATE: Create a 3-state checkbox. | |
57 | wx.CHK_ALLOW_3RD_STATE_FOR_USER: By default a user can't set a 3-state | |
58 | checkbox to the third state. It can only | |
59 | be done from code. Using this flags | |
60 | allows the user to set the checkbox to | |
61 | the third state by clicking. | |
62 | wx.ALIGN_RIGHT: Makes the text appear on the left of the checkbox. | |
63 | ||
64 | Events | |
65 | EVT_CHECKBOX: Sent when checkbox is clicked. | |
66 | "); | |
67 | ||
68 | ||
69 | ||
70 | class wxCheckBox : public wxControl | |
71 | { | |
72 | public: | |
73 | %pythonAppend wxCheckBox "self._setOORInfo(self)" | |
74 | %pythonAppend wxCheckBox() "" | |
75 | ||
76 | DocCtorStr( | |
77 | wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label, | |
78 | const wxPoint& pos = wxDefaultPosition, | |
79 | const wxSize& size = wxDefaultSize, | |
80 | long style = 0, | |
81 | const wxValidator& validator = wxDefaultValidator, | |
82 | const wxString& name = wxPyCheckBoxNameStr), | |
83 | "Creates and shows a CheckBox control"); | |
84 | ||
85 | DocCtorStrName( | |
86 | wxCheckBox(), | |
87 | "Precreate a CheckBox for 2-phase creation.", | |
88 | PreCheckBox); | |
89 | ||
90 | ||
91 | DocDeclStr( | |
92 | bool, Create(wxWindow* parent, wxWindowID id, const wxString& label, | |
93 | const wxPoint& pos = wxDefaultPosition, | |
94 | const wxSize& size = wxDefaultSize, | |
95 | long style = 0, | |
96 | const wxValidator& validator = wxDefaultValidator, | |
97 | const wxString& name = wxPyCheckBoxNameStr), | |
98 | "Actually create the GUI CheckBox for 2-phase creation."); | |
99 | ||
100 | ||
101 | DocDeclStr( | |
102 | bool, GetValue(), | |
103 | "Gets the state of a 2-state CheckBox. Returns True if it is checked,\n" | |
104 | "False otherwise."); | |
105 | ||
106 | DocDeclStr( | |
107 | bool, IsChecked(), | |
108 | "Similar to GetValue, but raises an exception if it is not a 2-state CheckBox."); | |
109 | ||
110 | DocDeclStr( | |
111 | void, SetValue(const bool state), | |
112 | "Set the state of a 2-state CheckBox. Pass True for checked,\n" | |
113 | "False for unchecked."); | |
114 | ||
115 | DocDeclStr( | |
116 | wxCheckBoxState, Get3StateValue() const, | |
117 | "Returns wx.CHK_UNCHECKED when the CheckBox is unchecked, wx.CHK_CHECKED when\n" | |
118 | "it is checked and wx.CHK_UNDETERMINED when it's in the undetermined state.\n" | |
119 | "Raises an exceptiion when the function is used with a 2-state CheckBox."); | |
120 | ||
121 | DocDeclStr( | |
122 | void, Set3StateValue(wxCheckBoxState state), | |
123 | "Sets the CheckBox to the given state. The state parameter can be\n" | |
124 | "one of the following: wx.CHK_UNCHECKED (Check is off), wx.CHK_CHECKED\n" | |
125 | "(Check is on) or wx.CHK_UNDETERMINED (Check is mixed). Raises an\n" | |
126 | "exception when the CheckBox is a 2-state checkbox and setting the state\n" | |
127 | "to wx.CHK_UNDETERMINED."); | |
128 | ||
129 | DocDeclStr( | |
130 | bool, Is3State() const, | |
131 | "Returns whether or not the CheckBox is a 3-state CheckBox."); | |
132 | ||
133 | DocDeclStr( | |
134 | bool, Is3rdStateAllowedForUser() const, | |
135 | "Returns whether or not the user can set the CheckBox to the third state."); | |
136 | ||
137 | }; | |
138 | ||
139 | //--------------------------------------------------------------------------- | |
140 | //--------------------------------------------------------------------------- |