X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2c2afc91be4bdb6e036516785f334ddb54afa0c..81c882b613b5d99ddb1e5ab69fcd7ebccc287025:/docs/latex/wx/timer.tex?ds=sidebyside diff --git a/docs/latex/wx/timer.tex b/docs/latex/wx/timer.tex index fc15f167a7..dc7ba28b18 100644 --- a/docs/latex/wx/timer.tex +++ b/docs/latex/wx/timer.tex @@ -4,13 +4,13 @@ The wxTimer class allows you to execute code at specified intervals. Its precision is platform-dependent, but in general will not be better than 1ms nor worse than 1s. -There are two different ways to use this class: +There are three different ways to use this class: \begin{enumerate} \item You may derive a new class from wxTimer and override the \helpref{Notify}{wxtimernotify} member to perform the required action. \item Or you may redirect the notifications to any -\helpref{wxEvtHandler}{wxevthandler} derived object by using the non default +\helpref{wxEvtHandler}{wxevthandler} derived object by using the non-default constructor or \helpref{SetOwner}{wxtimersetowner}. Then use the {\tt EVT\_TIMER} macro to connect it to the event handler which will receive \helpref{wxTimerEvent}{wxtimerevent} notifications. @@ -24,11 +24,12 @@ In any case, you must start the timer with \helpref{Start}{wxtimerstart} after constructing it before it actually starts sending notifications. It can be stopped later with \helpref{Stop}{wxtimerstop}. -{\bf NB:} note that timer can only be used from the main thread currently. +{\bf Note:} A timer can only be used from the main thread. \wxheading{Derived from} \helpref{wxEvtHandler}{wxevthandler} +\helpref{wxObject}{wxobject} \wxheading{Include files} @@ -36,7 +37,7 @@ be stopped later with \helpref{Stop}{wxtimerstop}. \wxheading{See also} -\helpref{::wxStartTimer}{wxstarttimer}, \helpref{::wxGetElapsedTime}{wxgetelapsedtime}, \helpref{wxStopWatch}{wxstopwatch} +\helpref{wxStopWatch}{wxstopwatch} \latexignore{\rtfignore{\wxheading{Members}}} @@ -53,7 +54,7 @@ Default constructor. If you use it to construct the object and don't call Creates a timer and associates it with {\it owner}. Please see \helpref{SetOwner}{wxtimersetowner} for the description of parameters. -\membersection{wxTimer::\destruct{wxTimer}} +\membersection{wxTimer::\destruct{wxTimer}}\label{wxtimerdtor} \func{}{\destruct{wxTimer}}{\void} @@ -65,6 +66,20 @@ Destructor. Stops the timer if it is running. Returns the current interval for the timer (in milliseconds). +\membersection{wxTimer::GetOwner}\label{wxtimergetowner} + +\constfunc{wxEvtHandler}{GetOwner}{\void} + +Returns the current {\it owner} of the timer. +If non-\NULL this is the event handler which will receive the +\helpref{timer events}{wxtimerevent} when the timer is running. + +\membersection{wxTimer::GetId}\label{wxtimergetid} + +\constfunc{int}{GetId}{\void} + +Returns the ID of the events generated by this timer. + \membersection{wxTimer::IsOneShot}\label{wxtimerisoneshot} \constfunc{bool}{IsOneShot}{\void} @@ -97,7 +112,7 @@ id equal to {\it id}\/ specified here. \membersection{wxTimer::Start}\label{wxtimerstart} -\func{bool}{Start}{\param{int}{milliseconds = -1}, \param{bool }{oneShot = {\tt false}}} +\func{bool}{Start}{\param{int }{milliseconds = -1}, \param{bool }{oneShot = {\tt false}}} (Re)starts the timer. If {\it milliseconds}\/ parameter is -1 (value by default), the previous value is used. Returns {\tt false} if the timer could not be started, @@ -123,6 +138,13 @@ restarting it. Stops the timer. + + + + +%% wxTimerEvent + + \section{\class{wxTimerEvent}}\label{wxtimerevent} wxTimerEvent object is passed to the event handler of timer events. @@ -157,6 +179,10 @@ void MyFrame::OnTimer(wxTimerEvent& event) \end{verbatim} +\wxheading{Derived from} + +\helpref{wxEvent}{wxevent} + \wxheading{Include files} @@ -173,3 +199,10 @@ void MyFrame::OnTimer(wxTimerEvent& event) Returns the interval of the timer which generated this event. + +\membersection{wxTimerEvent::GetTimer}\label{wxtimereventgettimer} + +\constfunc{wxTimer\&}{GetTimer}{\void} + +Returns the timer object which generated this event. +