X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/4782a5c5afee47721cc617daa40dd29828342c2b..3745aa61ef489e4b143b5c753a006d0613a0297f:/wcore.pas?ds=sidebyside diff --git a/wcore.pas b/wcore.pas index 40505ef..8b402b5 100755 --- a/wcore.pas +++ b/wcore.pas @@ -1,8 +1,3 @@ -{ Copyright (C) 2005 Bas Steendijk and Peter Green - For conditions of distribution and use, see copyright notice in zlib_license.txt - which is included in the package - ----------------------------------------------------------------------------- } - unit wcore; { @@ -30,6 +25,9 @@ interface end; tltimer=class(tlcomponent) + private + fenabled : boolean; + procedure setenabled(newvalue : boolean); public ontimer:tnotifyevent; initialevent:boolean; @@ -37,8 +35,8 @@ interface prevtimer:tltimer; nexttimer:tltimer; interval:integer; {miliseconds, default 1000} - enabled:boolean; nextts:integer; + property enabled:boolean read fenabled write setenabled; constructor create(aowner:tcomponent);override; destructor destroy;override; end; @@ -62,7 +60,7 @@ procedure exitmessageloop; procedure processmessages; var - onshutdown:procedure(s:string); + onshutdown:procedure(s:ansistring); implementation @@ -96,6 +94,13 @@ end; {------------------------------------------------------------------------------} +procedure tltimer.setenabled(newvalue : boolean); +begin + fenabled := newvalue; + nextts := 0; + initialdone := false; +end; + constructor tltimer.create; begin inherited create(AOwner); @@ -357,8 +362,9 @@ var Msg : TMsg; begin Result := FALSE; - if PeekMessage(Msg, hwndwcore, 0, 0, PM_REMOVE) then begin + if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then begin Result := TRUE; + TranslateMessage(MsgRec); DispatchMessage(Msg); end; end; @@ -370,3 +376,4 @@ end; end. +