|
From: Olivier S. <ob...@us...> - 2005-07-12 16:57:25
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15307/dev/JVCL3/run Modified Files: JvTimer.pas Log Message: Added TTimer handling if Threaded is set to False Index: JvTimer.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvTimer.pas,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** JvTimer.pas 17 Feb 2005 10:20:57 -0000 1.19 --- JvTimer.pas 12 Jul 2005 16:57:16 -0000 1.20 *************** *** 36,40 **** Windows, Messages, {$ENDIF MSWINDOWS} ! SysUtils, Classes; type --- 36,40 ---- Windows, Messages, {$ENDIF MSWINDOWS} ! SysUtils, ExtCtrls, Classes; type *************** *** 47,50 **** --- 47,51 ---- FThreaded: Boolean; FTimerThread: TThread; + FTimer: TTimer; {$IFDEF MSWINDOWS} FThreadPriority: TThreadPriority; *************** *** 166,169 **** --- 167,171 ---- {$ENDIF MSWINDOWS} FTimerThread := TJvTimerThread.Create(Self, False); + FTimer := nil; end; *************** *** 177,180 **** --- 179,183 ---- FTimerThread.Resume; FTimerThread.Terminate; + FTimer.Free; inherited Destroy; end; *************** *** 184,187 **** --- 187,191 ---- if FThreaded then begin + FreeAndNil(FTimer); if not FTimerThread.Suspended then FTimerThread.Suspend; *************** *** 200,203 **** --- 204,212 ---- if not FTimerThread.Suspended then FTimerThread.Suspend; + if not Assigned(FTimer) then + FTimer := TTimer.Create(Self); + FTimer.Interval := FInterval; + FTimer.OnTimer := FOnTimer; + FTimer.Enabled := (FInterval <> 0) and FEnabled and Assigned(FOnTimer); end; end; |