]>
Commit | Line | Data |
---|---|---|
feb72429 VZ |
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 | ||
dceb1c09 | 13 | This control allows the user to select a date. Unlike |
feb72429 | 14 | \helpref{wxCalendarCtrl}{wxcalendarctrl}, which is a relatively big control, |
dceb1c09 JS |
15 | wxDatePickerCtrl is implemented as a small window showing the currently selected date. |
16 | The control can be edited using the keyboard, and can also display a popup | |
feb72429 VZ |
17 | window for more user-friendly date selection, depending on the styles used and |
18 | the platform. | |
19 | ||
dceb1c09 JS |
20 | It is only available if \texttt{wxUSE\_DATEPICKCTRL} is set to $1$. |
21 | ||
feb72429 VZ |
22 | \wxheading{Derived from} |
23 | ||
24 | \helpref{wxControl}{wxcontrol}\\ | |
25 | \helpref{wxWindow}{wxwindow}\\ | |
26 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
27 | \helpref{wxObject}{wxobject} | |
28 | ||
29 | \wxheading{Include files} | |
30 | ||
bf25eaeb VZ |
31 | <wx/datectrl.h> |
32 | ||
33 | (only available if \texttt{wxUSE\_DATEPICKCTRL} is set to $1$) | |
feb72429 | 34 | |
29c86948 VZ |
35 | \wxheading{Window styles} |
36 | ||
37 | \twocolwidtha{5cm}% | |
38 | \begin{twocollist}\itemsep=0pt | |
39 | \twocolitem{\windowstyle{wxDP\_SPIN}}{Creates a control without month calendar | |
40 | drop down but with spin control-like arrows to change individual date | |
41 | components. This style is not supported by the generic version.} | |
42 | \twocolitem{\windowstyle{wxDP\_DROPDOWN}}{Creates a control with a month | |
43 | calendar drop down part from which the user can select a date.} | |
44 | \twocolitem{\windowstyle{wxDP\_DEFAULT}}{Creates a control with default style | |
5385747e VZ |
45 | which is the best supported for the current platform (currently wxDP\_SPIN |
46 | under Windows and wxDP\_DROPDOWN elsewhere).} | |
2cfbeac8 VZ |
47 | \twocolitem{\windowstyle{wxDP\_SHOWCENTURY}}{Forces display of the century in |
48 | the default date format. Without this flas the century could be displayed or | |
49 | not depending on the default date representation in the system.} | |
29c86948 VZ |
50 | \end{twocollist} |
51 | ||
feb72429 VZ |
52 | \wxheading{Event handling} |
53 | ||
54 | \twocolwidtha{7cm}% | |
55 | \begin{twocollist}\itemsep=0pt | |
56 | \twocolitem{{\bf EVT\_DATE\_CHANGED(id, func)}}{This event fires when the user | |
57 | changes the current selection in the control.} | |
58 | \end{twocollist} | |
59 | ||
60 | \wxheading{See also} | |
61 | ||
62 | \helpref{wxCalendarCtrl}{wxcalendarctrl},\\ | |
63 | \helpref{wxDateEvent}{wxdateevent} | |
64 | ||
65 | ||
66 | \latexignore{\rtfignore{\wxheading{Members}}} | |
67 | ||
68 | \membersection{wxDatePickerCtrl::wxDatePickerCtrl}\label{wxdatepickerctrlctor} | |
69 | ||
70 | \func{}{wxDatePickerCtrl}{\param{wxWindow *}{parent},\rtfsp | |
71 | \param{wxWindowID}{ id},\rtfsp | |
72 | \param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp | |
73 | \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp | |
74 | \param{const wxSize\& }{size = wxDefaultSize},\rtfsp | |
2cfbeac8 | 75 | \param{long}{ style = wxDP\_DEFAULT | wxDP\_SHOWCENTURY},\rtfsp |
feb72429 VZ |
76 | \param{const wxValidator\& }{validator = wxDefaultValidator}, |
77 | \param{const wxString\& }{name = ``datectrl"}} | |
78 | ||
23bec39a | 79 | Initializes the object and calls \helpref{Create}{wxdatepickerctrlcreate} with |
feb72429 VZ |
80 | all the parameters. |
81 | ||
82 | ||
83 | \membersection{wxDatePickerCtrl::Create}\label{wxdatepickerctrlcreate} | |
84 | ||
85 | \func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp | |
86 | \param{wxWindowID}{ id},\rtfsp | |
87 | \param{const wxDateTime\& }{dt = wxDefaultDateTime},\rtfsp | |
88 | \param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp | |
89 | \param{const wxSize\& }{size = wxDefaultSize},\rtfsp | |
2cfbeac8 | 90 | \param{long}{ style = wxDP\_DEFAULT | wxDP\_SHOWCENTURY},\rtfsp |
feb72429 VZ |
91 | \param{const wxValidator\& }{validator = wxDefaultValidator}, |
92 | \param{const wxString\& }{name = ``datectrl"}} | |
93 | ||
94 | \wxheading{Parameters} | |
95 | ||
96 | \docparam{parent}{Parent window, must not be non-\texttt{NULL}.} | |
97 | ||
98 | \docparam{id}{The identifier for the control.} | |
99 | ||
100 | \docparam{dt}{The initial value of the control, if an invalid date (such as the | |
101 | default value) is used, the control is set to today.} | |
102 | ||
103 | \docparam{pos}{Initial position.} | |
104 | ||
105 | \docparam{size}{Initial size. If left at default value, the control chooses its | |
106 | own best size by using the height approximately equal to a text control and | |
107 | width large enough to show the date string fully.} | |
108 | ||
109 | \docparam{style}{The window style, should be left at $0$ as there are no | |
110 | special styles for this control in this version.} | |
111 | ||
112 | \docparam{validator}{Validator which can be used for additional date checks.} | |
113 | ||
114 | \docparam{name}{Control name.} | |
115 | ||
116 | \wxheading{Return value} | |
117 | ||
118 | \true if the control was successfully created or \false if creation failed. | |
119 | ||
120 | ||
121 | \membersection{wxDatePickerCtrl::GetRange}\label{wxdatepickerctrlgetrange} | |
122 | ||
123 | \constfunc{bool}{GetRange}{\param{wxDateTime *}{dt1}, \param{wxDateTime }{*dt2}} | |
124 | ||
125 | If the control had been previously limited to a range of dates using | |
126 | \helpref{SetRange()}{wxdatepickerctrlsetrange}, returns the lower and upper | |
127 | bounds of this range. If no range is set (or only one of the bounds is set), | |
128 | the \arg{dt1} and/or \arg{dt2} are set to be invalid. | |
129 | ||
130 | \wxheading{Parameters} | |
131 | ||
132 | \docparam{dt1}{Pointer to the object which receives the lower range limit or | |
133 | becomes invalid if it is not set. May be \texttt{NULLL} if the caller is not | |
134 | interested in lower limit} | |
135 | ||
136 | \docparam{dt2}{Same as above but for the upper limit} | |
137 | ||
138 | \wxheading{Return value} | |
139 | ||
140 | \false if no range limits are currently set, \true if at least one bound is | |
141 | set. | |
142 | ||
143 | ||
144 | \membersection{wxDatePickerCtrl::GetValue}\label{wxdatepickerctrlgetvalue} | |
145 | ||
146 | \constfunc{wxDateTime}{GetValue}{\void} | |
147 | ||
148 | Returns the currently selected. If there is no selection or the selection is | |
149 | outside of the current range, an invalid object is returned. | |
150 | ||
151 | ||
152 | \membersection{wxDatePickerCtrl::SetRange}\label{wxdatepickerctrlsetrange} | |
153 | ||
154 | \func{void}{SetRange}{\param{const wxDateTime\&}{ dt1}, \param{const wxDateTime\&}{ dt2}} | |
155 | ||
156 | Sets the valid range for the date selection. If \arg{dt1} is valid, it becomes | |
157 | the earliest date (inclusive) accepted by the control. If \arg{dt2} is valid, | |
158 | it becomes the latest possible date. | |
159 | ||
160 | \wxheading{Remarks} | |
161 | ||
162 | If the current value of the control is outside of the newly set range bounds, | |
163 | the behaviour is undefined. | |
164 | ||
165 | ||
166 | \membersection{wxDatePickerCtrl::SetValue}\label{wxdatepickerctrlsetvalue} | |
167 | ||
168 | \func{void}{SetValue}{\param{const wxDateTime\&}{ dt}} | |
169 | ||
170 | Changes the current value of the control. The date should be valid and included | |
171 | in the currently selected range, if any. | |
172 | ||
173 | Calling this method does not result in a date change event. | |
174 |