Board index » delphi » TStringGrid makes my mouse flicker during updates

TStringGrid makes my mouse flicker during updates

Hello,
I am writing an application that needs to display realtime data in a
stringgrid.  I would like to update frequently -- ideally, every 100
msec.  This works fine, except that the mouse cursor flicker during grid
updates.  Is there a way around this?  Alternatively, is anyone aware of
a free/shareware component, with source, that provides grid-like
functionality but updates more efficiently (presumably by not descending
from TStringGrid)?

Thanks,

Tom

 

Re:TStringGrid makes my mouse flicker during updates


if Assigned(Screen.ActiveCustomForm) then
LockWindow(Screen.ActiveCustomForm.Handle);
try
  ...  your update code
finally
  LockWindow(0);
end;

Wayne

Quote
Tom Tatham wrote:
> Hello,
> I am writing an application that needs to display realtime data in a
> stringgrid.  I would like to update frequently -- ideally, every 100
> msec.  This works fine, except that the mouse cursor flicker during grid
> updates.  Is there a way around this?  Alternatively, is anyone aware of
> a free/shareware component, with source, that provides grid-like
> functionality but updates more efficiently (presumably by not descending
> from TStringGrid)?

> Thanks,

> Tom

Re:TStringGrid makes my mouse flicker during updates


Tom,

The following comes from the Delphi help on the Update method of the
TStringGrid component. Seems much better to me than locking the windows
update. I use it when creating word puzzles on a grid (I watch them
form) to prevent the flicker.
============

Update processes any pending paint messages immediately.

procedure Update; override;

Description

Call Update to force the control to be repainted before any more,
possibly time-consuming, processing takes place. Use Update to provide
immediate feedback to the user that cannot wait for the Windows paint
message to arrive. Update does not invalidate the control, but simply
forces a repaint of any regions that have already been invalidated. Call
Repaint instead if you need to invalidate the control as well.
Update calls the Windows API UpdateWindow function, which processes any
pending paint messages. For more information, see the Win32 Developer's
Reference (WIN32.HLP).

Re:TStringGrid makes my mouse flicker during updates


Wayne,

PMFJI, but do you mean LockWindowUpdate ??

Habib

Quote
Wayne Sheffield wrote:

> if Assigned(Screen.ActiveCustomForm) then
> LockWindow(Screen.ActiveCustomForm.Handle);
> try
>   ...  your update code
> finally
>   LockWindow(0);
> end;

> Wayne

> Tom Tatham wrote:

> > Hello,
> > I am writing an application that needs to display realtime data in a
> > stringgrid.  I would like to update frequently -- ideally, every 100
> > msec.  This works fine, except that the mouse cursor flicker during grid
> > updates.  Is there a way around this?  Alternatively, is anyone aware of
> > a free/shareware component, with source, that provides grid-like
> > functionality but updates more efficiently (presumably by not descending
> > from TStringGrid)?

> > Thanks,

> > Tom

Re:TStringGrid makes my mouse flicker during updates


Sure do.  Sorry about that.

Wayne

Quote
H. Debs wrote:
> Wayne,

> PMFJI, but do you mean LockWindowUpdate ??

> Habib

> Wayne Sheffield wrote:

> > if Assigned(Screen.ActiveCustomForm) then
> > LockWindow(Screen.ActiveCustomForm.Handle);
> > try
> >   ...  your update code
> > finally
> >   LockWindow(0);
> > end;

> > Wayne

> > Tom Tatham wrote:

> > > Hello,
> > > I am writing an application that needs to display realtime data in a
> > > stringgrid.  I would like to update frequently -- ideally, every 100
> > > msec.  This works fine, except that the mouse cursor flicker during grid
> > > updates.  Is there a way around this?  Alternatively, is anyone aware of
> > > a free/shareware component, with source, that provides grid-like
> > > functionality but updates more efficiently (presumably by not descending
> > > from TStringGrid)?

> > > Thanks,

> > > Tom

Other Threads