]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/timer.tex
wxChoice/wxComboBox background colour change (to get back to where we were);
[wxWidgets.git] / docs / latex / wx / timer.tex
CommitLineData
a660d684
KB
1\section{\class{wxTimer}}\label{wxtimer}
2
954b8ae6 3The wxTimer class allows you to execute code at specified intervals. To
a660d684
KB
4use it, derive a new class and override the {\bf Notify} member to
5perform the required action. Start with {\bf Start}, stop with {\bf
6Stop}, it's as simple as that.
7
8\wxheading{Derived from}
9
10\helpref{wxObject}{wxobject}
11
954b8ae6
JS
12\wxheading{Include files}
13
14<wx/timer.h>
15
a660d684
KB
16\wxheading{See also}
17
5f445b31 18\helpref{::wxStartTimer}{wxstarttimer}, \helpref{::wxGetElapsedTime}{wxgetelapsedtime}, \helpref{wxStopWatch}{wxstopwatch}
a660d684
KB
19
20\latexignore{\rtfignore{\wxheading{Members}}}
21
22\membersection{wxTimer::wxTimer}
23
24\func{}{wxTimer}{\void}
25
26Constructor.
27
28\membersection{wxTimer::\destruct{wxTimer}}
29
30\func{}{\destruct{wxTimer}}{\void}
31
32Destructor. Stops the timer if activated.
33
34\membersection{wxTimer::Interval}
35
36\func{int}{Interval}{\void}
37
38Returns the current interval for the timer.
39
40\membersection{wxTimer::Notify}
41
42\func{void}{Notify}{\void}
43
44This member should be overridden by the user. It is called on timeout.
45
46\membersection{wxTimer::Start}
47
48\func{bool}{Start}{\param{int}{ milliseconds = -1}, \param{bool}{ oneShot=FALSE}}
49
50(Re)starts the timer. If {\it milliseconds}\/ is absent or -1, the
51previous value is used. Returns FALSE if the timer could not be started,
52TRUE otherwise (in MS Windows timers are a limited resource).
53
54If {\it oneShot} is FALSE (the default), the Notify function will be repeatedly
55called. If TRUE, Notify will be called only once.
56
57\membersection{wxTimer::Stop}
58
59\func{void}{Stop}{\void}
60
61Stops the timer.
62
5f445b31 63\section{\class{wxStopWatch}}\label{wxstopwatch}
a660d684 64
5f445b31
RR
65The wxStopWatch class allow you to measure time intervalls.
66
67\wxheading{Include files}
68
69<wx/timer.h>
70
71\wxheading{See also}
72
73\helpref{::wxStartTimer}{wxstarttimer}, \helpref{::wxGetElapsedTime}{wxgetelapsedtime}, \helpref{wxTimer}{wxtimer}
74
75\latexignore{\rtfignore{\wxheading{Members}}}
76
77\membersection{wxStopWatch::wxStopWatch}
78
79\func{}{wxStopWatch}{\void}
80
81Constructor. This starts the stop watch.
82
83\membersection{wxStopWatch::Pause}\label{wxstopwatchpause}
84
85\func{void}{Pause}{\void}
86
87Pauses the stop watch. Call \helpref{wxStopWatch::Resume}{wxstopwatchresume} to resume
88time measuring again.
89
90\membersection{wxStopWatch::Start}
91
92\func{void}{Start}{\param{long}{ milliseconds = 0}}
93
94(Re)starts the stop watch with a given initial value.
95
96\membersection{wxStopWatch::Resume}\label{wxstopwatchresume}
97
98\func{void}{Resume}{\void}
99
100Resumes the stop watch after having been paused with \helpref{wxStopWatch::Pause}{wxstopwatchpause}.
101
102\membersection{wxStopWatch::Time}
103
104\func{long}{Time}{\void}\label{wxstopwatchtime}
105
106Returns the time in milliseconds since the start (or restart) or the last call of
107\helpref{wxStopWatch::Pause}{wxstopwatchpause}.