]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/src/_checkbox.i
Added some info panels that show size and colour attributes about the widget
[wxWidgets.git] / wxPython / src / _checkbox.i
... / ...
CommitLineData
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
19MAKE_CONST_WXSTRING(CheckBoxNameStr);
20
21
22enum {
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
37enum wxCheckBoxState
38{
39 wxCHK_UNCHECKED,
40 wxCHK_CHECKED,
41 wxCHK_UNDETERMINED /* 3-state checkbox only */
42};
43
44
45//---------------------------------------------------------------------------
46
47DocStr(wxCheckBox,
48"A checkbox is a labelled box which by default is either on (the
49checkmark is visible) or off (no checkmark). Optionally (When the
50wx.CHK_3STATE style flag is set) it can have a third state, called the
51mixed or undetermined state. Often this is used as a \"Does Not
52Apply\" state.
53
54Window Styles
55-------------
56 ================================= ===============================
57 wx.CHK_2STATE Create a 2-state checkbox.
58 This is the default.
59 wx.CHK_3STATE Create a 3-state checkbox.
60 wx.CHK_ALLOW_3RD_STATE_FOR_USER By default a user can't set a
61 3-state checkbox to the
62 third state. It can only be
63 done from code. Using this
64 flags allows the user to set
65 the checkbox to the third
66 state by clicking.
67 wx.ALIGN_RIGHT Makes the
68 text appear on the left of
69 the checkbox.
70 ================================= ===============================
71
72Events
73------
74 =============================== ===============================
75 EVT_CHECKBOX Sent when checkbox is clicked.
76 =============================== ===============================
77");
78
79
80
81class wxCheckBox : public wxControl
82{
83public:
84 %pythonAppend wxCheckBox "self._setOORInfo(self)"
85 %pythonAppend wxCheckBox() ""
86
87 RefDoc(wxCheckBox, ""); // turn it off for the ctors
88
89 DocCtorStr(
90 wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label,
91 const wxPoint& pos = wxDefaultPosition,
92 const wxSize& size = wxDefaultSize,
93 long style = 0,
94 const wxValidator& validator = wxDefaultValidator,
95 const wxString& name = wxPyCheckBoxNameStr),
96 "Creates and shows a CheckBox control");
97
98 DocCtorStrName(
99 wxCheckBox(),
100 "Precreate a CheckBox for 2-phase creation.",
101 PreCheckBox);
102
103
104 DocDeclStr(
105 bool, Create(wxWindow* parent, wxWindowID id, const wxString& label,
106 const wxPoint& pos = wxDefaultPosition,
107 const wxSize& size = wxDefaultSize,
108 long style = 0,
109 const wxValidator& validator = wxDefaultValidator,
110 const wxString& name = wxPyCheckBoxNameStr),
111 "Actually create the GUI CheckBox for 2-phase creation.");
112
113
114 DocDeclStr(
115 bool, GetValue(),
116 "Gets the state of a 2-state CheckBox. Returns True if it is checked,
117False otherwise.");
118
119 DocDeclStr(
120 bool, IsChecked(),
121 "Similar to GetValue, but raises an exception if it is not a 2-state
122CheckBox.");
123
124 DocDeclStr(
125 void, SetValue(const bool state),
126 "Set the state of a 2-state CheckBox. Pass True for checked, False for
127unchecked.");
128
129 DocDeclStr(
130 wxCheckBoxState, Get3StateValue() const,
131 "Returns wx.CHK_UNCHECKED when the CheckBox is unchecked,
132wx.CHK_CHECKED when it is checked and wx.CHK_UNDETERMINED when it's in
133the undetermined state. Raises an exceptiion when the function is
134used with a 2-state CheckBox.");
135
136 DocDeclStr(
137 void, Set3StateValue(wxCheckBoxState state),
138 "Sets the CheckBox to the given state. The state parameter can be one
139of the following: wx.CHK_UNCHECKED (Check is off), wx.CHK_CHECKED (the
140Check is on) or wx.CHK_UNDETERMINED (Check is mixed). Raises an
141exception when the CheckBox is a 2-state checkbox and setting the
142state to wx.CHK_UNDETERMINED.");
143
144 DocDeclStr(
145 bool, Is3State() const,
146 "Returns whether or not the CheckBox is a 3-state CheckBox.");
147
148 DocDeclStr(
149 bool, Is3rdStateAllowedForUser() const,
150 "Returns whether or not the user can set the CheckBox to the third
151state.");
152
153};
154
155//---------------------------------------------------------------------------
156//---------------------------------------------------------------------------