1
/////////////////////////////////////////////////////////////////////////////
3
// Purpose: SWIG interface defs for wxDatePickerCtrl
7
// Created: 15-Feb-2005
8
// RCS-ID: $Id: _datectrl.i 70172 2011-12-29 21:07:42Z RD $
9
// Copyright: (c) 2005 by Total Control Software
10
// Licence: wxWindows license
11
/////////////////////////////////////////////////////////////////////////////
16
//---------------------------------------------------------------------------
18
MAKE_CONST_WXSTRING(DatePickerCtrlNameStr);
20
//---------------------------------------------------------------------------
23
DocStr(wxDatePickerCtrl,
24
"This control allows the user to select a date. Unlike
25
`wx.calendar.CalendarCtrl`, which is a relatively big control,
26
`wx.DatePickerCtrl` is implemented as a small window showing the
27
currently selected date. The control can be edited using the keyboard,
28
and can also display a popup window for more user-friendly date
29
selection, depending on the styles used and the platform.", "
33
================= ======================================================
34
wx.DP_SPIN Creates a control without month calendar drop down but
35
with spin control-like arrows to change individual
36
date components. This style is not supported by the
39
wx.DP_DROPDOWN Creates a control with a month calendar drop down
40
part from which the user can select a date.
42
wx.DP_DEFAULT Creates a control with default style which is the
43
best supported for the current platform
44
(currently wx.DP_SPIN under Windows and
45
wx.DP_DROPDOWN elsewhere).
47
wx.DP_ALLOWNONE With this style, the control allows the user to not
48
enter any valid date at all. Without it -- which
49
is by default -- the control always has some
52
wx.DP_SHOWCENTURY Forces display of the century in the default
53
date format. Without this flag the century
54
could be displayed or not depending on the
55
default date representation in the system.
56
================= ======================================================
61
================= ======================================================
62
EVT_DATE_CHANGED This event fires when the user changes the current
63
selection in the control.
64
================= ======================================================
66
:see: `wx.calendar.CalendarCtrl`, `wx.DateEvent`
82
MustHaveApp(wxDatePickerCtrl);
84
class wxDatePickerCtrlBase : public wxControl
90
virtual void , SetValue(const wxDateTime& dt),
91
"Changes the current value of the control. The date should be valid and
92
included in the currently selected range, if any.
94
Calling this method does not result in a date change event.", "");
97
virtual wxDateTime , GetValue() const,
98
"Returns the currently selected date. If there is no selection or the
99
selection is outside of the current range, an invalid `wx.DateTime`
100
object is returned.", "");
104
virtual void , SetRange(const wxDateTime& dt1, const wxDateTime& dt2),
105
"Sets the valid range for the date selection. If dt1 is valid, it
106
becomes the earliest date (inclusive) accepted by the control. If dt2
107
is valid, it becomes the latest possible date.
109
If the current value of the control is outside of the newly set range
110
bounds, the behaviour is undefined.", "");
112
// virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
117
"Get the lower limit of the valid range for the date selection, if any.
118
If there is no range or there is no lower limit, then the
119
`wx.DateTime` value returned will be invalid.", "");
120
wxDateTime GetLowerLimit() {
122
self->GetRange(&rv, NULL);
129
"Get the upper limit of the valid range for the date selection, if any.
130
If there is no range or there is no upper limit, then the
131
`wx.DateTime` value returned will be invalid.", "");
132
wxDateTime GetUpperLimit() {
134
self->GetRange(NULL, &rv);
139
%property(LowerLimit, GetLowerLimit, doc="See `GetLowerLimit`");
140
%property(UpperLimit, GetUpperLimit, doc="See `GetUpperLimit`");
141
%property(Value, GetValue, SetValue, doc="See `GetValue` and `SetValue`");
145
class wxDatePickerCtrl : public wxDatePickerCtrlBase
148
%pythonAppend wxDatePickerCtrl "self._setOORInfo(self)";
149
%pythonAppend wxDatePickerCtrl() "";
152
wxDatePickerCtrl(wxWindow *parent,
154
const wxDateTime& dt = wxDefaultDateTime,
155
const wxPoint& pos = wxDefaultPosition,
156
const wxSize& size = wxDefaultSize,
157
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
158
const wxValidator& validator = wxDefaultValidator,
159
const wxString& name = wxPyDatePickerCtrlNameStr),
160
"Create a new DatePickerCtrl.", "");
165
"Precreate a DatePickerCtrl for use in 2-phase creation.", "",
170
bool , Create(wxWindow *parent,
172
const wxDateTime& dt = wxDefaultDateTime,
173
const wxPoint& pos = wxDefaultPosition,
174
const wxSize& size = wxDefaultSize,
175
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
176
const wxValidator& validator = wxDefaultValidator,
177
const wxString& name = wxPyDatePickerCtrlNameStr),
178
"Create the GUI parts of the DatePickerCtrl, for use in 2-phase
185
MustHaveApp(wxDatePickerCtrlGeneric);
187
%rename(GenericDatePickerCtrl) wxDatePickerCtrlGeneric;
189
class wxDatePickerCtrlGeneric : public wxDatePickerCtrlBase
192
%pythonAppend wxDatePickerCtrlGeneric "self._setOORInfo(self)";
193
%pythonAppend wxDatePickerCtrlGeneric() "";
196
wxDatePickerCtrlGeneric(wxWindow *parent,
198
const wxDateTime& dt = wxDefaultDateTime,
199
const wxPoint& pos = wxDefaultPosition,
200
const wxSize& size = wxDefaultSize,
201
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
202
const wxValidator& validator = wxDefaultValidator,
203
const wxString& name = wxPyDatePickerCtrlNameStr),
204
"Create a new GenericDatePickerCtrl.", "");
208
wxDatePickerCtrlGeneric(),
209
"Precreate a GenericDatePickerCtrl for use in 2-phase creation.", "",
210
PreGenericDatePickerCtrl);
214
bool , Create(wxWindow *parent,
216
const wxDateTime& dt = wxDefaultDateTime,
217
const wxPoint& pos = wxDefaultPosition,
218
const wxSize& size = wxDefaultSize,
219
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
220
const wxValidator& validator = wxDefaultValidator,
221
const wxString& name = wxPyDatePickerCtrlNameStr),
222
"Create the GUI parts of the GenericDatePickerCtrl, for use in 2-phase
227
//---------------------------------------------------------------------------