MGUI::TIMER Class Reference

Countdown timer, used to invoke delegate function when time expires. More...

#include <mgui/timer.h>

List of all members.

Public Member Functions

 TIMER ()
 ~TIMER ()
ERRVALUE Activate (double seconds, bool autorepeat=false)
void Deactivate ()
bool IsActive () const
void SetDelegate (DELEGATE_VOID_NOPARMS delegate)
void SetLimitToMainLoop (bool LimitToMainLoop)

Detailed Description

Countdown timer, used to invoke delegate function when time expires.

Timers are only processed during normal event loop handling and thus will not 'interrupt' program execution. The specified time will be the 'minimum' delay after which the delegate function will be called. The actual time may be far longer if the program does significant processing outside of event loops. By default, timer delegates are only invoked during 'main loop' processing to avoid undesired calls out of modal dialog loops. To allow timer calls for all event loops, use SetLimitToMainLoop(false). In addition, if a timer expires in a modal event loop and the auto-repeat option is not used, the delegate will never be called.


Constructor & Destructor Documentation

MGUI::TIMER::TIMER (  ) 
MGUI::TIMER::~TIMER (  ) 

Member Function Documentation

ERRVALUE MGUI::TIMER::Activate ( double  seconds,
bool  autorepeat = false 
)

Activate the timer.

If timer is already active, the countdown will be restarted using the new value. The number of active timers is limited on some platforms, an error will be returned if the maximum number of timers is already active.

Parameters:
seconds Countdown time in seconds
autorepeat True to auto-repeat countdown after delegate invoked
void MGUI::TIMER::Deactivate (  ) 

Deactivate timer.

bool MGUI::TIMER::IsActive (  )  const [inline]

Determine if timer is currently active.

void MGUI::TIMER::SetDelegate ( DELEGATE_VOID_NOPARMS  delegate  )  [inline]

Set delegate to invoke when time expires.

Parameters:
delegate Delegate to set, use MakeDelegate() if non-static class method
void MGUI::TIMER::SetLimitToMainLoop ( bool  LimitToMainLoop  )  [inline]

Set whether to limit timer calls to main loop or allow in modal event loops.

If not used, default is to limit to main loop.

Parameters:
LimitToMainLoop True to limit timer calls to main event loop

The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:36:15 2012 for TNTsdk 2012 by  doxygen 1.6.1