-{ Copyright (C) 2005 Bas Steendijk and Peter Green\r
- For conditions of distribution and use, see copyright notice in zlib_license.txt\r
- which is included in the package\r
- ----------------------------------------------------------------------------- }\r
-\r
unit wcore;\r
\r
{\r
end;\r
\r
tltimer=class(tlcomponent)\r
+ private\r
+ fenabled : boolean;\r
+ procedure setenabled(newvalue : boolean);\r
public\r
ontimer:tnotifyevent;\r
initialevent:boolean;\r
prevtimer:tltimer;\r
nexttimer:tltimer;\r
interval:integer; {miliseconds, default 1000}\r
- enabled:boolean;\r
nextts:integer;\r
+ property enabled:boolean read fenabled write setenabled;\r
constructor create(aowner:tcomponent);override;\r
destructor destroy;override;\r
end;\r
procedure processmessages;\r
\r
var\r
- onshutdown:procedure(s:string);\r
+ onshutdown:procedure(s:ansistring);\r
\r
implementation\r
\r
\r
{------------------------------------------------------------------------------}\r
\r
+procedure tltimer.setenabled(newvalue : boolean);\r
+begin\r
+ fenabled := newvalue;\r
+ nextts := 0;\r
+ initialdone := false;\r
+end;\r
+\r
constructor tltimer.create;\r
begin\r
inherited create(AOwner);\r
Msg : TMsg;\r
begin\r
Result := FALSE;\r
- if PeekMessage(Msg, hwndwcore, 0, 0, PM_REMOVE) then begin\r
+ if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then begin\r
Result := TRUE;\r
+ TranslateMessage(MsgRec);\r
DispatchMessage(Msg);\r
end;\r
end;\r
\r
\r
end.\r
+\r