1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxDatePickerCtrl documentation
4 %% Author: Vadim Zeitlin
7 %% Copyright: (c) 2005 Vadim Zeitlin
8 %% License: wxWidgets license
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{\class{wxDatePickerCtrl
}}\label{wxdatepickerctrl
}
13 This control allows the user to select a date. Unlike
14 \helpref{wxCalendarCtrl
}{wxcalendarctrl
}, which is a relatively big control,
15 it is implemented as a small window showing the currently selected date and
16 allowing to edit it directly using the keyboard and may also display a popup
17 window for more user-friendly date selection, depending on the styles used and
20 \wxheading{Derived from
}
22 \helpref{wxControl
}{wxcontrol
}\\
23 \helpref{wxWindow
}{wxwindow
}\\
24 \helpref{wxEvtHandler
}{wxevthandler
}\\
25 \helpref{wxObject
}{wxobject
}
27 \wxheading{Include files
}
31 (only available if
\texttt{wxUSE
\_DATEPICKCTRL} is set to $
1$)
33 \wxheading{Event handling
}
36 \begin{twocollist
}\itemsep=
0pt
37 \twocolitem{{\bf EVT
\_DATE\_CHANGED(id, func)
}}{This event fires when the user
38 changes the current selection in the control.
}
43 \helpref{wxCalendarCtrl
}{wxcalendarctrl
},\\
44 \helpref{wxDateEvent
}{wxdateevent
}
47 \latexignore{\rtfignore{\wxheading{Members
}}}
49 \membersection{wxDatePickerCtrl::wxDatePickerCtrl
}\label{wxdatepickerctrlctor
}
51 \func{}{wxDatePickerCtrl
}{\param{wxWindow *
}{parent
},
\rtfsp
52 \param{wxWindowID
}{ id
},
\rtfsp
53 \param{const wxDateTime\&
}{dt = wxDefaultDateTime
},
\rtfsp
54 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
55 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
56 \param{long
}{ style =
0},
\rtfsp
57 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
58 \param{const wxString\&
}{name = ``datectrl"
}}
60 Initializes the object and calls
\helpref{Create
}{wxdatepickerctrlcreate
} with
64 \membersection{wxDatePickerCtrl::Create
}\label{wxdatepickerctrlcreate
}
66 \func{bool
}{Create
}{\param{wxWindow *
}{parent
},
\rtfsp
67 \param{wxWindowID
}{ id
},
\rtfsp
68 \param{const wxDateTime\&
}{dt = wxDefaultDateTime
},
\rtfsp
69 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
70 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
71 \param{long
}{ style =
0},
\rtfsp
72 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
73 \param{const wxString\&
}{name = ``datectrl"
}}
75 \wxheading{Parameters
}
77 \docparam{parent
}{Parent window, must not be non-
\texttt{NULL
}.
}
79 \docparam{id
}{The identifier for the control.
}
81 \docparam{dt
}{The initial value of the control, if an invalid date (such as the
82 default value) is used, the control is set to today.
}
84 \docparam{pos
}{Initial position.
}
86 \docparam{size
}{Initial size. If left at default value, the control chooses its
87 own best size by using the height approximately equal to a text control and
88 width large enough to show the date string fully.
}
90 \docparam{style
}{The window style, should be left at $
0$ as there are no
91 special styles for this control in this version.
}
93 \docparam{validator
}{Validator which can be used for additional date checks.
}
95 \docparam{name
}{Control name.
}
97 \wxheading{Return value
}
99 \true if the control was successfully created or
\false if creation failed.
102 \membersection{wxDatePickerCtrl::GetRange
}\label{wxdatepickerctrlgetrange
}
104 \constfunc{bool
}{GetRange
}{\param{wxDateTime *
}{dt1
},
\param{wxDateTime
}{*dt2
}}
106 If the control had been previously limited to a range of dates using
107 \helpref{SetRange()
}{wxdatepickerctrlsetrange
}, returns the lower and upper
108 bounds of this range. If no range is set (or only one of the bounds is set),
109 the
\arg{dt1
} and/or
\arg{dt2
} are set to be invalid.
111 \wxheading{Parameters
}
113 \docparam{dt1
}{Pointer to the object which receives the lower range limit or
114 becomes invalid if it is not set. May be
\texttt{NULLL
} if the caller is not
115 interested in lower limit
}
117 \docparam{dt2
}{Same as above but for the upper limit
}
119 \wxheading{Return value
}
121 \false if no range limits are currently set,
\true if at least one bound is
125 \membersection{wxDatePickerCtrl::GetValue
}\label{wxdatepickerctrlgetvalue
}
127 \constfunc{wxDateTime
}{GetValue
}{\void}
129 Returns the currently selected. If there is no selection or the selection is
130 outside of the current range, an invalid object is returned.
133 \membersection{wxDatePickerCtrl::SetRange
}\label{wxdatepickerctrlsetrange
}
135 \func{void
}{SetRange
}{\param{const wxDateTime\&
}{ dt1
},
\param{const wxDateTime\&
}{ dt2
}}
137 Sets the valid range for the date selection. If
\arg{dt1
} is valid, it becomes
138 the earliest date (inclusive) accepted by the control. If
\arg{dt2
} is valid,
139 it becomes the latest possible date.
143 If the current value of the control is outside of the newly set range bounds,
144 the behaviour is undefined.
147 \membersection{wxDatePickerCtrl::SetValue
}\label{wxdatepickerctrlsetvalue
}
149 \func{void
}{SetValue
}{\param{const wxDateTime\&
}{ dt
}}
151 Changes the current value of the control. The date should be valid and included
152 in the currently selected range, if any.
154 Calling this method does not result in a date change event.