X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c913512a4c9f36e11e07ea707002fab1608d324..f99af6c05204b93eca9b0f21bc803f98e1a9c6bb:/interface/timer.h diff --git a/interface/timer.h b/interface/timer.h index a29aa8efae..49de74c8ef 100644 --- a/interface/timer.h +++ b/interface/timer.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: timer.h -// Purpose: documentation for wxTimer class +// Purpose: interface of wxTimer // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -32,13 +32,12 @@ after constructing it before it actually starts sending notifications. It can be stopped later with wxTimer::Stop. - @b Note: A timer can only be used from the main thread. + @note A timer can only be used from the main thread. @library{wxbase} @category{misc} - @seealso - wxStopWatch + @see wxStopWatch */ class wxTimer : public wxEvtHandler { @@ -49,7 +48,7 @@ public: SetOwner() for the description of parameters. */ wxTimer(); - wxTimer(wxEvtHandler * owner, int id = -1); + wxTimer(wxEvtHandler* owner, int id = -1); //@} /** @@ -60,71 +59,66 @@ public: /** Returns the ID of the events generated by this timer. */ - int GetId(); + int GetId() const; /** Returns the current interval for the timer (in milliseconds). */ - int GetInterval(); + int GetInterval() const; /** Returns the current @e owner of the timer. If non-@NULL this is the event handler which will receive the @ref overview_wxtimerevent "timer events" when the timer is running. */ - wxEvtHandler GetOwner(); + wxEvtHandler GetOwner() const; /** Returns @true if the timer is one shot, i.e. if it will stop after firing the first notification automatically. */ - bool IsOneShot(); + bool IsOneShot() const; /** Returns @true if the timer is running, @false if it is stopped. */ - bool IsRunning(); + bool IsRunning() const; /** This member should be overridden by the user if the default constructor was used and SetOwner() wasn't called. - Perform whatever action which is to be taken periodically here. */ void Notify(); /** - Associates the timer with the given @e owner object. When the timer is + Associates the timer with the given @a owner object. When the timer is running, the owner will receive @ref overview_wxtimerevent "timer events" with - id equal to @e id specified here. + id equal to @a id specified here. */ - void SetOwner(wxEvtHandler * owner, int id = -1); + void SetOwner(wxEvtHandler* owner, int id = -1); /** - (Re)starts the timer. If @e milliseconds parameter is -1 (value by default), + (Re)starts the timer. If @a milliseconds parameter is -1 (value by default), the previous value is used. Returns @false if the timer could not be started, @true otherwise (in MS Windows timers are a limited resource). - - If @e oneShot is @false (the default), the Notify() + If @a oneShot is @false (the default), the Notify() function will be called repeatedly until the timer is stopped. If @true, it will be called only once and the timer will stop automatically. To make your code more readable you may also use the following symbolic constants: - - + wxTIMER_CONTINUOUS - - + Start a normal, continuously running, timer - + wxTIMER_ONE_SHOT - - + Start a one shot timer - + If the timer was already running, it will be stopped by this method before restarting it. */ - bool Start(int milliseconds = -1, bool oneShot = @false); + bool Start(int milliseconds = -1, bool oneShot = false); /** Stops the timer. @@ -133,6 +127,7 @@ public: }; + /** @class wxTimerEvent @wxheader{timer.h} @@ -171,8 +166,7 @@ public: @library{wxbase} @category{events} - @seealso - wxTimer + @see wxTimer */ class wxTimerEvent : public wxEvent { @@ -180,10 +174,11 @@ public: /** Returns the interval of the timer which generated this event. */ - int GetInterval(); + int GetInterval() const; /** Returns the timer object which generated this event. */ - wxTimer GetTimer(); + wxTimer GetTimer() const; }; +