wGui::CTimer Class Reference

CTimer will post a CTRL_TIMER message every time the timer expires. More...

#include <wg_timer.h>

Inheritance diagram for wGui::CTimer:

wGui::CMessageClient

Public Member Functions

Protected Attributes


Detailed Description

CTimer will post a CTRL_TIMER message every time the timer expires.

Definition at line 43 of file wg_timer.h.


Constructor & Destructor Documentation

wGui::CTimer::CTimer ( CMessageClient pOwner = 0  ) 

Standard constructor

Parameters:
pOwner A pointer to the timer 'owner'. This is what the timer will set as the destination for it's messages. Use 0 to broadcast the message.

Definition at line 39 of file wg_timer.cpp.


Member Function Documentation

void wGui::CTimer::StartTimer ( unsigned long int  Interval,
bool  bAutoRestart = false 
)

Start the timer. When the timer expires, it will post an CTRL_TIMER message

Parameters:
Interval The time interval in milliseconds before the timer will expire
bAutoRestart If this is true, the timer will restart again as soon as it expires

Definition at line 53 of file wg_timer.cpp.

References m_bAutoRestart, m_TimerID, StopTimer(), and wGui::TimerCallback().

Referenced by wGui::CToolTip::HandleMessage(), wGui::CTextBox::HandleMessage(), wGui::CMenuBase::HandleMessage(), wGui::CEditBox::HandleMessage(), wGui::CTextBox::OnMouseButtonDown(), and wGui::CEditBox::OnMouseButtonDown().

bool wGui::CTimer::IsRunning ( void   )  [inline]

Indicates if the timer is currently running

Returns:
true is the timer is currently running

Definition at line 63 of file wg_timer.h.

References m_TimerID.

Referenced by wGui::CTextBox::OnMouseButtonDown(), and wGui::CEditBox::OnMouseButtonDown().

long int wGui::CTimer::GetCount ( void   )  const [inline]

Gets the number of times the timer has triggered since it was last reset

Returns:
The count of times the timer has fired

Definition at line 67 of file wg_timer.h.

References m_iCounter.

CMessageClient* wGui::CTimer::GetOwner ( void   )  [inline]

Gets the owner of the timer

Returns:
A pointer to the owner of the timer

Definition at line 74 of file wg_timer.h.

References m_pOwner.

Uint32 wGui::CTimer::TimerHit ( Uint32  Interval  ) 

For internal use only

Definition at line 74 of file wg_timer.cpp.

References wGui::CMessage::CTRL_TIMER, wGui::CMessageServer::Instance(), m_bAutoRestart, m_iCounter, m_pOwner, wGui::CMessageServer::QueueMessage(), and StopTimer().

bool wGui::CTimer::HandleMessage ( CMessage pMessage  )  [virtual]

Attempt to handle the given message

Returns:
true if the object handled the message (the message will not be given to any other handlers)

Implements wGui::CMessageClient.

Definition at line 87 of file wg_timer.cpp.


The documentation for this class was generated from the following files:
Generated on Wed May 16 23:11:28 2007 for wGui by  doxygen 1.5.1