From: <ob...@us...> - 2006-09-29 13:41:38
|
Revision: 10951 http://svn.sourceforge.net/jvcl/?rev=10951&view=rev Author: obones Date: 2006-09-29 06:41:32 -0700 (Fri, 29 Sep 2006) Log Message: ----------- Mantis 3355: Now only restarts the running ones. Modified Paths: -------------- trunk/jvcl/run/JvScheduledEvents.pas Modified: trunk/jvcl/run/JvScheduledEvents.pas =================================================================== --- trunk/jvcl/run/JvScheduledEvents.pas 2006-09-29 13:25:58 UTC (rev 10950) +++ trunk/jvcl/run/JvScheduledEvents.pas 2006-09-29 13:41:32 UTC (rev 10951) @@ -659,6 +659,9 @@ {$IFDEF VCL} procedure TJvCustomScheduledEvents.WndProc(var Msg: TMessage); +var + List: TList; + I: Integer; begin with Msg do case Msg of @@ -666,9 +669,25 @@ Dispatch(Msg); WM_TIMECHANGE: begin - // Mantis 3355: Time has changed, stop and restart the schedules - StopAll; - StartAll; + // Mantis 3355: Time has changed, mark all running schedules as + // "to be restarted", stop and then restart them. + List := TList.Create; + try + for I := 0 to FEvents.Count - 1 do + begin + if FEvents[I].State in [sesTriggered, sesExecuting, sesPaused] then + begin + List.Add(FEvents[I]); + FEvents[I].Stop; + end; + end; + for I := 0 to List.Count - 1 do + begin + TJvEventCollectionItem(List[I]).Start; + end; + finally + List.Free; + end; end; else Result := DefWindowProc(Handle, Msg, WParam, LParam); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |