From: Andreas H. <ah...@us...> - 2004-07-22 19:50:24
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18053/run Modified Files: JvTimerList.pas Log Message: Fixed Mantis #1988 Index: JvTimerList.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvTimerList.pas,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** JvTimerList.pas 2 Jul 2004 08:09:35 -0000 1.30 --- JvTimerList.pas 22 Jul 2004 19:50:14 -0000 1.31 *************** *** 112,115 **** --- 112,116 ---- FParentList: TJvTimerList; FRepeatCount: Integer; + FLoading: Boolean; FOnTimer: TNotifyEvent; FName: string; *************** *** 119,124 **** --- 120,129 ---- procedure SetEnabled(Value: Boolean); procedure SetInterval(Value: Longint); + procedure UpdateInterval; + procedure UpdateEnabled; protected function GetDisplayName: String; override; + procedure Loaded; virtual; + property Loading: Boolean read FLoading; public constructor Create(ACollection: TCollection); override; *************** *** 154,157 **** --- 159,163 ---- protected procedure DoTimer(Event: TJvTimerEvent); dynamic; + procedure Loaded; override; public constructor Create(AOwner: TComponent); override; *************** *** 171,175 **** uses ! Consts, Forms, // for Application.HandleException Math, JvJVCLUtils, JvResources, JvTypes; --- 177,182 ---- uses ! Consts, ! Forms, // for Application.HandleException Math, JvJVCLUtils, JvResources, JvTypes; *************** *** 185,188 **** --- 192,196 ---- FHandle := INVALID_HANDLE_VALUE; inherited Create(ACollection); + FLoading := True; FCycled := True; FRepeatCount := 0; *************** *** 199,227 **** end; ! procedure TJvTimerEvent.SetEnabled(Value: Boolean); begin ! if Value <> FEnabled then ! begin ! FEnabled := Value; ! if FEnabled then begin ! FExecCount := 0; ! FLastExecute := GetTickCount; ! if FParentList <> nil then ! with FParentList do ! begin ! Events.CalculateInterval(GetTickCount); ! UpdateTimer; ! Events.Activate; ! end; end; - end; end; ! procedure TJvTimerEvent.SetInterval(Value: Longint); begin ! if Value <> FInterval then begin ! FInterval := Value; if FParentList <> nil then with FParentList do --- 207,234 ---- end; ! procedure TJvTimerEvent.Loaded; begin ! FLoading := False; ! ! UpdateInterval; ! UpdateEnabled; ! end; ! ! procedure TJvTimerEvent.UpdateInterval; ! begin ! if FParentList <> nil then ! with FParentList do begin ! Events.CalculateInterval(GetTickCount); ! UpdateTimer; end; end; ! procedure TJvTimerEvent.UpdateEnabled; begin ! if FEnabled then begin ! FExecCount := 0; ! FLastExecute := GetTickCount; if FParentList <> nil then with FParentList do *************** *** 229,236 **** --- 236,264 ---- Events.CalculateInterval(GetTickCount); UpdateTimer; + Events.Activate; end; end; end; + procedure TJvTimerEvent.SetEnabled(Value: Boolean); + begin + if Value <> FEnabled then + begin + FEnabled := Value; + if not FLoading then + UpdateEnabled; + end; + end; + + procedure TJvTimerEvent.SetInterval(Value: Longint); + begin + if Value <> FInterval then + begin + FInterval := Value; + if not FLoading then + UpdateInterval; + end; + end; + procedure TJvTimerEvent.SetRepeatCount(Value: Integer); begin *************** *** 292,295 **** --- 320,332 ---- end; + procedure TJvTimerList.Loaded; + var + I: Integer; + begin + inherited Loaded; + for I := 0 to Events.Count - 1 do + Events[I].Loaded; + end; + { Create a new timer event and returns a handle } |