]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/datectrl.tex
d3ae311f3703ffe77e5167615c7253d6ba1c3174
[wxWidgets.git] / docs / latex / wx / datectrl.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: datectrl.tex
3 %% Purpose: wxDatePickerCtrl documentation
4 %% Author: Vadim Zeitlin
5 %% Created: 2005-01-15
6 %% RCS-ID: $Id$
7 %% Copyright: (c) 2005 Vadim Zeitlin
8 %% License: wxWidgets license
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11 \section{\class{wxDatePickerCtrl}}\label{wxdatepickerctrl}
12
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
18 the platform.
19
20 \wxheading{Derived from}
21
22 \helpref{wxControl}{wxcontrol}\\
23 \helpref{wxWindow}{wxwindow}\\
24 \helpref{wxEvtHandler}{wxevthandler}\\
25 \helpref{wxObject}{wxobject}
26
27 \wxheading{Include files}
28
29 <wx/dateevt.h>
30
31 \wxheading{Event handling}
32
33 \twocolwidtha{7cm}%
34 \begin{twocollist}\itemsep=0pt
35 \twocolitem{{\bf EVT\_DATE\_CHANGED(id, func)}}{This event fires when the user
36 changes the current selection in the control.}
37 \end{twocollist}
38
39 \wxheading{See also}
40
41 \helpref{wxCalendarCtrl}{wxcalendarctrl},\\
42 \helpref{wxDateEvent}{wxdateevent}
43
44
45 \latexignore{\rtfignore{\wxheading{Members}}}
46
47 \membersection{wxDatePickerCtrl::wxDatePickerCtrl}\label{wxdatepickerctrlctor}
48
49 \func{}{wxDatePickerCtrl}{\param{wxWindow *}{parent},\rtfsp
50 \param{wxWindowID}{ id},\rtfsp
51 \param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp
52 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
53 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
54 \param{long}{ style = 0},\rtfsp
55 \param{const wxValidator\& }{validator = wxDefaultValidator},
56 \param{const wxString\& }{name = ``datectrl"}}
57
58 Initializes the object and calls \helpref{Create}{wxdatepickerctrlcreate} with
59 all the parameters.
60
61
62 \membersection{wxDatePickerCtrl::Create}\label{wxdatepickerctrlcreate}
63
64 \func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
65 \param{wxWindowID}{ id},\rtfsp
66 \param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp
67 \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
68 \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
69 \param{long}{ style = 0},\rtfsp
70 \param{const wxValidator\& }{validator = wxDefaultValidator},
71 \param{const wxString\& }{name = ``datectrl"}}
72
73 \wxheading{Parameters}
74
75 \docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
76
77 \docparam{id}{The identifier for the control.}
78
79 \docparam{dt}{The initial value of the control, if an invalid date (such as the
80 default value) is used, the control is set to today.}
81
82 \docparam{pos}{Initial position.}
83
84 \docparam{size}{Initial size. If left at default value, the control chooses its
85 own best size by using the height approximately equal to a text control and
86 width large enough to show the date string fully.}
87
88 \docparam{style}{The window style, should be left at $0$ as there are no
89 special styles for this control in this version.}
90
91 \docparam{validator}{Validator which can be used for additional date checks.}
92
93 \docparam{name}{Control name.}
94
95 \wxheading{Return value}
96
97 \true if the control was successfully created or \false if creation failed.
98
99
100 \membersection{wxDatePickerCtrl::GetRange}\label{wxdatepickerctrlgetrange}
101
102 \constfunc{bool}{GetRange}{\param{wxDateTime *}{dt1}, \param{wxDateTime }{*dt2}}
103
104 If the control had been previously limited to a range of dates using
105 \helpref{SetRange()}{wxdatepickerctrlsetrange}, returns the lower and upper
106 bounds of this range. If no range is set (or only one of the bounds is set),
107 the \arg{dt1} and/or \arg{dt2} are set to be invalid.
108
109 \wxheading{Parameters}
110
111 \docparam{dt1}{Pointer to the object which receives the lower range limit or
112 becomes invalid if it is not set. May be \texttt{NULLL} if the caller is not
113 interested in lower limit}
114
115 \docparam{dt2}{Same as above but for the upper limit}
116
117 \wxheading{Return value}
118
119 \false if no range limits are currently set, \true if at least one bound is
120 set.
121
122
123 \membersection{wxDatePickerCtrl::GetValue}\label{wxdatepickerctrlgetvalue}
124
125 \constfunc{wxDateTime}{GetValue}{\void}
126
127 Returns the currently selected. If there is no selection or the selection is
128 outside of the current range, an invalid object is returned.
129
130
131 \membersection{wxDatePickerCtrl::SetRange}\label{wxdatepickerctrlsetrange}
132
133 \func{void}{SetRange}{\param{const wxDateTime\&}{ dt1}, \param{const wxDateTime\&}{ dt2}}
134
135 Sets the valid range for the date selection. If \arg{dt1} is valid, it becomes
136 the earliest date (inclusive) accepted by the control. If \arg{dt2} is valid,
137 it becomes the latest possible date.
138
139 \wxheading{Remarks}
140
141 If the current value of the control is outside of the newly set range bounds,
142 the behaviour is undefined.
143
144
145 \membersection{wxDatePickerCtrl::SetValue}\label{wxdatepickerctrlsetvalue}
146
147 \func{void}{SetValue}{\param{const wxDateTime\&}{ dt}}
148
149 Changes the current value of the control. The date should be valid and included
150 in the currently selected range, if any.
151
152 Calling this method does not result in a date change event.
153
154