Board index » delphi » Fast Delphi table scrolling: PeekMessage() tricks

Fast Delphi table scrolling: PeekMessage() tricks

On Tue, 26 Nov 1996 22:00:09 GMT, cevi0...@pophost.eunet.be (Danny

Quote
Heijl) wrote:
>----------------------------------------------------------------------------------------------------------------------
>procedure TForm1.DSMasterDataChange(Sender: TObject; Field: TField);
>begin
>    UpdateTimer.Enabled := False; { reset Timer }
>    UpdateTimer.Interval := 100;
>    UpdateTimer.Enabled := True;
>end;

        Instead of using PeekMessage, consider using
Application.OnIdle event. Whenever the application is idle (not
processing any message), the procedure will fire.

Francisco Leong

 

Re:Fast Delphi table scrolling: PeekMessage() tricks


Quote
In article <34817550.7947...@news.umac.mo> d941...@umac.mo (Francisco Leong) writes:
>>----------------------------------------------------------------------------------------------------------------------
>>procedure TForm1.DSMasterDataChange(Sender: TObject; Field: TField);
>>begin
>>    UpdateTimer.Enabled := False; { reset Timer }
>>    UpdateTimer.Interval := 100;
>>    UpdateTimer.Enabled := True;
>>end;
>        Instead of using PeekMessage, consider using
>Application.OnIdle event. Whenever the application is idle (not
>processing any message), the procedure will fire.

If you want something to occur periodically, or "at least this frequently,"
you will have to use a timer.  The OnIdle event fires only once, when the
event queue is completely empty (and however-briefly).  It can fire very
erratically indeed.  Sometimes it fires hundreds of times a second; other
times it may not fire for a minute.

Other Threads