]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/timespan.tex
Added EVT_MOVE_START, EVT_MOVE_END (wxMSW only for now)
[wxWidgets.git] / docs / latex / wx / timespan.tex
CommitLineData
22f22798 1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f6bcfd97
BP
2%% Name: datespan.tex
3%% Purpose: wxDateSpan documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 04.04.00
7%% RCS-ID: $Id$
8%% Copyright: (c) Vadim Zeitlin
8795498c 9%% License: wxWindows license
f6bcfd97
BP
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxTimeSpan}}\label{wxtimespan}
13
df05cdc5
VZ
14wxTimeSpan class represents a time interval.
15
16\wxheading{Derived from}
17
18No base class
19
20\wxheading{Include files}
21
22<wx/datetime.h>
23
a7af285d
VZ
24\wxheading{Library}
25
26\helpref{wxBase}{librarieslist}
27
df05cdc5
VZ
28\wxheading{See also}
29
30\helpref{Date classes overview}{wxdatetimeoverview},\rtfsp
31\helpref{wxDateTime}{wxdatetime}
32
33\latexignore{\rtfignore{\wxheading{Function groups}}}
34
bd35ed32 35
6d06e061 36\membersection{Static functions}\label{timespanstaticfunctions}
df05cdc5 37
bd35ed32
VZ
38\helpref{Milliseconds}{wxtimespanmilliseconds}\\
39\helpref{Millisecond}{wxtimespanmillisecond}\\
22f22798
JS
40\helpref{Seconds}{wxtimespanseconds}\\
41\helpref{Second}{wxtimespansecond}\\
42\helpref{Minutes}{wxtimespanminutes}\\
43\helpref{Minute}{wxtimespanminute}\\
44\helpref{Hours}{wxtimespanhours}\\
45\helpref{Hour}{wxtimespanhour}\\
46\helpref{Days}{wxtimespandays}\\
47\helpref{Day}{wxtimespanday}\\
48\helpref{Weeks}{wxtimespanweeks}\\
49\helpref{Week}{wxtimespanweek}
50
bd35ed32 51
6d06e061 52\membersection{Constructors}\label{timespanconstructors}
df05cdc5 53
5283098e 54\helpref{wxTimeSpan}{wxtimespanctor}
df05cdc5 55
bd35ed32 56
6d06e061 57\membersection{Accessors}\label{timespanaccessors}
df05cdc5 58
22f22798
JS
59\helpref{GetSeconds}{wxtimespangetseconds}\\
60\helpref{GetMinutes}{wxtimespangetminutes}\\
61\helpref{GetHours}{wxtimespangethours}\\
62\helpref{GetDays}{wxtimespangetdays}\\
63\helpref{GetWeeks}{wxtimespangetweeks}\\
64\helpref{GetValue}{wxtimespangetvalue}
65
bd35ed32 66
6d06e061 67\membersection{Operations}\label{timespanoperations}
df05cdc5 68
22f22798 69\helpref{Add}{wxtimespanadd}\\
dbd94b75 70\helpref{Subtract}{wxtimespansubtract}\\
22f22798
JS
71\helpref{Multiply}{wxtimespanmultiply}\\
72\helpref{Negate}{wxtimespannegate}\\
73\helpref{Neg}{wxtimespanneg}\\
74\helpref{Abs}{wxtimespanabs}
75
bd35ed32 76
6d06e061 77\membersection{Tests}\label{timespantests}
df05cdc5 78
22f22798
JS
79\helpref{IsNull}{wxtimespanisnull}\\
80\helpref{IsPositive}{wxtimespanispositive}\\
81\helpref{IsNegative}{wxtimespanisnegative}\\
82\helpref{IsEqualTo}{wxtimespanisequalto}\\
83\helpref{IsLongerThan}{wxtimespanislongerthan}\\
84\helpref{IsShorterThan}{wxtimespanisshorterthan}
85
bd35ed32 86
6d06e061 87\membersection{Formatting time spans}\label{timespanformatting}
df05cdc5
VZ
88
89\helpref{Format}{wxtimespanformat}
90
91%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92% Start of member function part %
93%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
94
95\helponly{\insertatlevel{2}{
96 \wxheading{Members}
97}}
98
bd35ed32 99
22f22798
JS
100\membersection{wxTimeSpan::Abs}\label{wxtimespanabs}
101
102\constfunc{wxTimeSpan}{Abs}{\void}
103
104Returns the absolute value of the timespan: does not modify the
105object.
106
bd35ed32 107
22f22798
JS
108\membersection{wxTimeSpan::Add}\label{wxtimespanadd}
109
110\constfunc{wxTimeSpan}{Add}{\param{const wxTimeSpan\& }{diff}}
111
112\func{wxTimeSpan\&}{Add}{\param{const wxTimeSpan\& }{diff}}
113
114\func{wxTimeSpan\&}{operator$+=$}{\param{const wxTimeSpan\&}{diff}}
115
116Returns the sum of two timespans.
117
bd35ed32 118
22f22798
JS
119\membersection{wxTimeSpan::Days}\label{wxtimespandays}
120
121\func{static wxTimespan}{Days}{\param{long }{days}}
122
123Returns the timespan for the given number of days.
124
bd35ed32 125
22f22798
JS
126\membersection{wxTimeSpan::Day}\label{wxtimespanday}
127
128\func{static wxTimespan}{Day}{\void}
129
130Returns the timespan for one day.
131
bd35ed32 132
df05cdc5
VZ
133\membersection{wxTimeSpan::Format}\label{wxtimespanformat}
134
1aaf88d2 135\func{wxString}{Format}{\param{const wxChar * }{format = wxDefaultTimeSpanFormat}}
df05cdc5
VZ
136
137Returns the string containing the formatted representation of the time span.
138The following format specifiers are allowed after \%:
139
140\twocolwidtha{5cm}%
141\begin{twocollist}\itemsep=0pt
142\twocolitem{H}{number of {\bf H}ours}
143\twocolitem{M}{number of {\bf M}inutes}
144\twocolitem{S}{number of {\bf S}econds}
145\twocolitem{l}{number of mi{\bf l}liseconds}
146\twocolitem{D}{number of {\bf D}ays}
147\twocolitem{E}{number of w{\bf E}eks}
148\twocolitem{\%}{the percent character}
149\end{twocollist}
150
151Note that, for example, the number of hours in the description above is not
152well defined: it can be either the total number of hours (for example, for a
153time span of $50$ hours this would be $50$) or just the hour part of the time
154span, which would be $2$ in this case as $50$ hours is equal to $2$ days and
155$2$ hours.
156
157wxTimeSpan resolves this ambiguity in the following way: if there had been,
158indeed, the {\tt \%D} format specified preceding the {\tt \%H}, then it is
159interpreted as $2$. Otherwise, it is $50$.
160
161The same applies to all other format specifiers: if they follow a specifier of
162larger unit, only the rest part is taken, otherwise the full value is used.
f6bcfd97 163
bd35ed32 164
22f22798
JS
165\membersection{wxTimeSpan::GetDays}\label{wxtimespangetdays}
166
167\constfunc{int}{GetDays}{\void}
168
169Returns the difference in number of days.
170
bd35ed32 171
22f22798
JS
172\membersection{wxTimeSpan::GetHours}\label{wxtimespangethours}
173
174\constfunc{int}{GetHours}{\void}
175
176Returns the difference in number of hours.
177
bd35ed32 178
22f22798
JS
179\membersection{wxTimeSpan::GetMilliseconds}\label{wxtimespangetmilliseconds}
180
181\constfunc{wxLongLong}{GetMilliseconds}{\void}
182
183Returns the difference in number of milliseconds.
184
bd35ed32 185
22f22798
JS
186\membersection{wxTimeSpan::GetMinutes}\label{wxtimespangetminutes}
187
188\constfunc{int}{GetMinutes}{\void}
189
190Returns the difference in number of minutes.
191
bd35ed32 192
22f22798
JS
193\membersection{wxTimeSpan::GetSeconds}\label{wxtimespangetseconds}
194
195\constfunc{wxLongLong}{GetSeconds}{\void}
196
197Returns the difference in number of seconds.
198
bd35ed32 199
22f22798
JS
200\membersection{wxTimeSpan::GetValue}\label{wxtimespangetvalue}
201
202\constfunc{wxLongLong}{GetValue}{\void}
203
204Returns the internal representation of timespan.
205
bd35ed32 206
22f22798
JS
207\membersection{wxTimeSpan::GetWeeks}\label{wxtimespangetweeks}
208
209\constfunc{int}{GetWeeks}{\void}
210
211Returns the difference in number of weeks.
212
bd35ed32 213
22f22798
JS
214\membersection{wxTimeSpan::Hours}\label{wxtimespanhours}
215
216\func{static wxTimespan}{Hours}{\param{long }{hours}}
217
218Returns the timespan for the given number of hours.
219
bd35ed32 220
22f22798
JS
221\membersection{wxTimeSpan::Hour}\label{wxtimespanhour}
222
223\func{static wxTimespan}{Hour}{\void}
224
225Returns the timespan for one hour.
226
bd35ed32 227
22f22798
JS
228\membersection{wxTimeSpan::IsEqualTo}\label{wxtimespanisequalto}
229
230\constfunc{bool}{IsEqualTo}{\param{const wxTimeSpan\& }{ts}}
231
cc81d32f 232Returns {\tt true} if two timespans are equal.
22f22798 233
bd35ed32 234
22f22798
JS
235\membersection{wxTimeSpan::IsLongerThan}\label{wxtimespanislongerthan}
236
237\constfunc{bool}{IsLongerThan}{\param{const wxTimeSpan\& }{ts}}
238
239Compares two timespans: works with the absolute values, i.e. -2
cc81d32f 240hours is longer than 1 hour. Also, it will return {\tt false} if
22f22798
JS
241the timespans are equal in absolute value.
242
bd35ed32 243
22f22798
JS
244\membersection{wxTimeSpan::IsNegative}\label{wxtimespanisnegative}
245
246\constfunc{bool}{IsNegative}{\void}
247
cc81d32f 248Returns {\tt true} if the timespan is negative.
22f22798 249
bd35ed32 250
22f22798
JS
251\membersection{wxTimeSpan::IsNull}\label{wxtimespanisnull}
252
253\constfunc{bool}{IsNull}{\void}
254
cc81d32f 255Returns {\tt true} if the timespan is empty.
22f22798 256
bd35ed32 257
22f22798
JS
258\membersection{wxTimeSpan::IsPositive}\label{wxtimespanispositive}
259
260\constfunc{bool}{IsPositive}{\void}
261
cc81d32f 262Returns {\tt true} if the timespan is positive.
22f22798 263
bd35ed32 264
22f22798
JS
265\membersection{wxTimeSpan::IsShorterThan}\label{wxtimespanisshorterthan}
266
267\constfunc{bool}{IsShorterThan}{\param{const wxTimeSpan\& }{ts}}
268
269Compares two timespans: works with the absolute values, i.e. 1
cc81d32f 270hour is shorter than -2 hours. Also, it will return {\tt false} if
22f22798
JS
271the timespans are equal in absolute value.
272
bd35ed32 273
22f22798
JS
274\membersection{wxTimeSpan::Minutes}\label{wxtimespanminutes}
275
276\func{static wxTimespan}{Minutes}{\param{long }{min}}
277
278Returns the timespan for the given number of minutes.
279
bd35ed32 280
22f22798
JS
281\membersection{wxTimeSpan::Minute}\label{wxtimespanminute}
282
283\func{static wxTimespan}{Minute}{\void}
284
285Returns the timespan for one minute.
286
bd35ed32 287
22f22798
JS
288\membersection{wxTimeSpan::Multiply}\label{wxtimespanmultiply}
289
290\constfunc{wxTimeSpan}{Multiply}{\param{int }{n}}
291
292\func{wxTimeSpan\&}{Multiply}{\param{int }{n}}
293
294\func{wxTimeSpan\&}{operator$*=$}{\param{int }{n}}
295
296Multiplies timespan by a scalar.
297
bd35ed32 298
22f22798
JS
299\membersection{wxTimeSpan::Negate}\label{wxtimespannegate}
300
301\constfunc{wxTimeSpan}{Negate}{\void}
302
dbd94b75 303Returns timespan with inverted sign.
22f22798 304
bd35ed32 305
22f22798
JS
306\membersection{wxTimeSpan::Neg}\label{wxtimespanneg}
307
308\func{wxTimeSpan\&}{Neg}{\void}
309
310\func{wxTimeSpan\&}{operator$-$}{\void}
311
312Negate the value of the timespan.
313
bd35ed32
VZ
314
315\membersection{wxTimeSpan::Milliseconds}\label{wxtimespanmilliseconds}
316
317\func{static wxTimespan}{Milliseconds}{\param{long }{ms}}
318
319Returns the timespan for the given number of milliseconds.
320
321
322\membersection{wxTimeSpan::Millisecond}\label{wxtimespanmillisecond}
323
324\func{static wxTimespan}{Millisecond}{\void}
325
326Returns the timespan for one millisecond.
327
328
22f22798
JS
329\membersection{wxTimeSpan::Seconds}\label{wxtimespanseconds}
330
331\func{static wxTimespan}{Seconds}{\param{long }{sec}}
332
333Returns the timespan for the given number of seconds.
334
bd35ed32 335
22f22798
JS
336\membersection{wxTimeSpan::Second}\label{wxtimespansecond}
337
338\func{static wxTimespan}{Second}{\void}
339
340Returns the timespan for one second.
341
bd35ed32 342
dbd94b75 343\membersection{wxTimeSpan::Subtract}\label{wxtimespansubtract}
22f22798 344
dbd94b75 345\constfunc{wxTimeSpan}{Subtract}{\param{const wxTimeSpan\&}{diff}}
22f22798 346
dbd94b75 347\func{wxTimeSpan\&}{Subtract}{\param{const wxTimeSpan\& }{diff}}
22f22798
JS
348
349\func{wxTimeSpan\&}{operator$-=$}{\param{const wxTimeSpan\&}{diff}}
350
351Returns the difference of two timespans.
352
bd35ed32 353
22f22798
JS
354\membersection{wxTimeSpan::Weeks}\label{wxtimespanweeks}
355
356\func{static wxTimespan}{Weeks}{\param{long }{weeks}}
357
358Returns the timespan for the given number of weeks.
359
bd35ed32 360
22f22798
JS
361\membersection{wxTimeSpan::Week}\label{wxtimespanweek}
362
363\func{static wxTimespan}{Week}{\void}
364
365Returns the timespan for one week.
366
bd35ed32 367
5283098e 368\membersection{wxTimeSpan::wxTimeSpan}\label{wxtimespanctor}
22f22798
JS
369
370\func{}{wxTimeSpan}{\void}
371
372Default constructor, constructs a zero timespan.
373
374\func{}{wxTimeSpan}{\param{long }{hours}, \param{long }{min}, \param{long }{sec}, \param{long }{msec}}
375
376Constructs timespan from separate values for each component, with the date
377set to 0. Hours are not restricted to 0..24 range, neither are
378minutes, seconds or milliseconds.
379