Countdown timer, used to invoke delegate function when time expires. More...
#include <mgui/timer.h>
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) |
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.
| MGUI::TIMER::TIMER | ( | ) |
| MGUI::TIMER::~TIMER | ( | ) |
| 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.
| 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.
| 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.
| LimitToMainLoop | True to limit timer calls to main event loop |
1.6.1