wxdatepickerctrlthis control allows the user to select a date. unlike wxcalendarctrl, which is a relatively big control, wxdatepickerctrl is implemented as a small window showing the currently selected date. the control can be edited using the keyboard, and can also display a popup window for more user-friendly date selection, depending on the styles used and the platform, except palmos where date is selected using native dialog. it is only available if wxuse_datepickctrl is set to 1. derived from
wxcontrol include files <wx/datectrl.h> (only available if wxuse_datepickctrl is set to 1) window styles
event handling
see also members
wxdatepickerctrl::wxdatepickerctrl
wxdatepickerctrl::wxdatepickerctrlwxdatepickerctrl(wxwindow *parent, wxwindowid id, const wxdatetime& dt = wxdefaultdatetime, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxdp_default | wxdp_showcentury, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "datectrl") initializes the object and calls create with all the parameters.
wxdatepickerctrl::createbool create(wxwindow *parent, wxwindowid id, const wxdatetime& dt = wxdefaultdatetime, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxdp_default | wxdp_showcentury, const wxvalidator& validator = wxdefaultvalidator, const wxstring& name = "datectrl") parameters parent
id
dt
pos
size
style
validator
name
return value true if the control was successfully created or false if creation failed.
wxdatepickerctrl::getrangebool getrange(wxdatetime *dt1, wxdatetime *dt2) const if the control had been previously limited to a range of dates using setrange(), returns the lower and upper bounds of this range. if no range is set (or only one of the bounds is set), dt1 and/or dt2 are set to be invalid. parameters dt1
dt2
return value false if no range limits are currently set, true if at least one bound is set.
wxdatepickerctrl::getvaluewxdatetime getvalue() const returns the currently selected. if there is no selection or the selection is outside of the current range, an invalid object is returned.
wxdatepickerctrl::setformatvoid setformat(const wxchar* format) please note that this function is only available in the generic version of this control. the native version always uses the current system locale. sets the display format for the date in the control. see wxdatetime for the meaning of format strings. remarks if the format parameter is invalid, the behaviour is undefined.
wxdatepickerctrl::setrangevoid setrange(const wxdatetime& dt1, const wxdatetime& dt2) sets the valid range for the date selection. if dt1 is valid, it becomes the earliest date (inclusive) accepted by the control. if dt2 is valid, it becomes the latest possible date. remarks if the current value of the control is outside of the newly set range bounds, the behaviour is undefined.
wxdatepickerctrl::setvaluevoid setvalue(const wxdatetime& dt) changes the current value of the control. the date should be valid and included in the currently selected range, if any. calling this method does not result in a date change event.
|