Code: Select all
#include "FiveMac.ch"
//----------------------------------------------------------------------------//
CLASS TTimer
DATA bAction
DATA lActive
DATA nInterval
DATA lRepeat
DATA hWnd
DATA Cargo
DATA hWndOwner
METHOD New( nInterval, bAction, oWnd ) CONSTRUCTOR
// METHOD Activate()
// METHOD DeActivate() INLINE ::lActive := .f.
METHOD End() INLINE TimerEnd(::hWnd )
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( nInterval, bAction, oWnd ) CLASS TTimer
DEFAULT nInterval := 18, bAction := { || nil }
oWnd:bOnTimer:= bAction
::hWndOwner := oWnd:hWnd
::hWnd := TimerCreate( nInterval ,::hWndOwner )
::nInterval:= nInterval
::bAction := bAction
::lActive := .t.
return Self
//----------------------------------------------------------------------------//