]>
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 | RefDoc(wxCheckBox, ""); // turn it off for the ctors | |
77 | ||
78 | DocCtorStr( | |
79 | wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label, | |
80 | const wxPoint& pos = wxDefaultPosition, | |
81 | const wxSize& size = wxDefaultSize, | |
82 | long style = 0, | |
83 | const wxValidator& validator = wxDefaultValidator, | |
84 | const wxString& name = wxPyCheckBoxNameStr), | |
85 | "Creates and shows a CheckBox control"); | |
86 | ||
87 | DocCtorStrName( | |
88 | wxCheckBox(), | |
89 | "Precreate a CheckBox for 2-phase creation.", | |
90 | PreCheckBox); | |
91 | ||
92 | ||
93 | DocDeclStr( | |
94 | bool, Create(wxWindow* parent, wxWindowID id, const wxString& label, | |
95 | const wxPoint& pos = wxDefaultPosition, | |
96 | const wxSize& size = wxDefaultSize, | |
97 | long style = 0, | |
98 | const wxValidator& validator = wxDefaultValidator, | |
99 | const wxString& name = wxPyCheckBoxNameStr), | |
100 | "Actually create the GUI CheckBox for 2-phase creation."); | |
101 | ||
102 | ||
103 | DocDeclStr( | |
104 | bool, GetValue(), | |
105 | "Gets the state of a 2-state CheckBox. Returns True if it is checked,\n" | |
106 | "False otherwise."); | |
107 | ||
108 | DocDeclStr( | |
109 | bool, IsChecked(), | |
110 | "Similar to GetValue, but raises an exception if it is not a 2-state CheckBox."); | |
111 | ||
112 | DocDeclStr( | |
113 | void, SetValue(const bool state), | |
114 | "Set the state of a 2-state CheckBox. Pass True for checked,\n" | |
115 | "False for unchecked."); | |
116 | ||
117 | DocDeclStr( | |
118 | wxCheckBoxState, Get3StateValue() const, | |
119 | "Returns wx.CHK_UNCHECKED when the CheckBox is unchecked, wx.CHK_CHECKED when\n" | |
120 | "it is checked and wx.CHK_UNDETERMINED when it's in the undetermined state.\n" | |
121 | "Raises an exceptiion when the function is used with a 2-state CheckBox."); | |
122 | ||
123 | DocDeclStr( | |
124 | void, Set3StateValue(wxCheckBoxState state), | |
125 | "Sets the CheckBox to the given state. The state parameter can be\n" | |
126 | "one of the following: wx.CHK_UNCHECKED (Check is off), wx.CHK_CHECKED\n" | |
127 | "(Check is on) or wx.CHK_UNDETERMINED (Check is mixed). Raises an\n" | |
128 | "exception when the CheckBox is a 2-state checkbox and setting the state\n" | |
129 | "to wx.CHK_UNDETERMINED."); | |
130 | ||
131 | DocDeclStr( | |
132 | bool, Is3State() const, | |
133 | "Returns whether or not the CheckBox is a 3-state CheckBox."); | |
134 | ||
135 | DocDeclStr( | |
136 | bool, Is3rdStateAllowedForUser() const, | |
137 | "Returns whether or not the user can set the CheckBox to the third state."); | |
138 | ||
139 | }; | |
140 | ||
141 | //--------------------------------------------------------------------------- | |
142 | //--------------------------------------------------------------------------- |