1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxwxDatePickerCtrl
7 // Created: 15-Feb-2005
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 flas 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 wxDatePickerCtrl : public wxControl
87 %pythonAppend wxDatePickerCtrl "self._setOORInfo(self)";
88 %pythonAppend wxDatePickerCtrl() "";
91 wxDatePickerCtrl(wxWindow *parent,
93 const wxDateTime& dt = wxDefaultDateTime,
94 const wxPoint& pos = wxDefaultPosition,
95 const wxSize& size = wxDefaultSize,
96 long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
97 const wxValidator& validator = wxDefaultValidator,
98 const wxString& name = wxPyDatePickerCtrlNameStr),
99 "Create a new DatePickerCtrl.", "");
104 "Precreate a DatePickerCtrl for use in 2-phase creation.", "",
109 bool , Create(wxWindow *parent,
111 const wxDateTime& dt = wxDefaultDateTime,
112 const wxPoint& pos = wxDefaultPosition,
113 const wxSize& size = wxDefaultSize,
114 long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
115 const wxValidator& validator = wxDefaultValidator,
116 const wxString& name = wxPyDatePickerCtrlNameStr),
117 "Create the GUI parts of the DatePickerCtrl, for use in 2-phase
123 virtual void , SetValue(const wxDateTime& dt),
124 "Changes the current value of the control. The date should be valid and
125 included in the currently selected range, if any.
127 Calling this method does not result in a date change event.", "");
130 virtual wxDateTime , GetValue() const,
131 "Returns the currently selected date. If there is no selection or the
132 selection is outside of the current range, an invalid `wx.DateTime`
133 object is returned.", "");
137 virtual void , SetRange(const wxDateTime& dt1, const wxDateTime& dt2),
138 "Sets the valid range for the date selection. If dt1 is valid, it
139 becomes the earliest date (inclusive) accepted by the control. If dt2
140 is valid, it becomes the latest possible date.
142 If the current value of the control is outside of the newly set range
143 bounds, the behaviour is undefined.", "");
145 // virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
150 "Get the lower limit of the valid range for the date selection, if any.
151 If there is no range or there is no lower limit, then the
152 `wx.DateTime` value returned will be invalid.", "");
153 wxDateTime GetLowerLimit() {
155 self->GetRange(&rv, NULL);
162 "Get the upper limit of the valid range for the date selection, if any.
163 If there is no range or there is no upper limit, then the
164 `wx.DateTime` value returned will be invalid.", "");
165 wxDateTime GetUpperLimit() {
167 self->GetRange(NULL, &rv);
172 %property(LowerLimit, GetLowerLimit, doc="See `GetLowerLimit`");
173 %property(UpperLimit, GetUpperLimit, doc="See `GetUpperLimit`");
174 %property(Value, GetValue, SetValue, doc="See `GetValue` and `SetValue`");
180 //---------------------------------------------------------------------------