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