Contents Up Previous Next

wxTimer: wxObject

The wxTimer object is an abstraction of MS Windows, XView and X toolkit timers. To use it, derive a new class and override the Notify member to perform the required action. Start with Start, stop with Stop, it's as simple as that.

See also ::wxStartTimer and ::wxGetElapsedTime for stopwatch functions.

wxTimer::wxTimer
wxTimer::~wxTimer
wxTimer::Interval
wxTimer::Notify
wxTimer::Start
wxTimer::Stop


wxTimer::wxTimer

void wxTimer(void)

Constructor.


wxTimer::~wxTimer

void ~wxTimer(void)

Destructor. Stops the timer if activated.


wxTimer::Interval

int Interval(void)

Returns the current interval for the timer.


wxTimer::Notify

void Notify(void)

This member should be overridden by the user. It is called on timeout.


wxTimer::Start

Bool Start(int milliseconds = -1, Bool oneShot=FALSE)

(Re)starts the timer. If milliseconds is absent or -1, 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 oneShot is FALSE (the default), the Notify function will be repeatedly called. If TRUE, Notify will be called only once.


wxTimer::Stop

void Stop(void)

Stops the timer.