Board index » cppbuilder » Re: TDrawGrid in BCB5 - Sensible Display Update

Re: TDrawGrid in BCB5 - Sensible Display Update


2005-04-30 07:13:56 AM
cppbuilder91
"Stephen R. Phillips" < XXXX@XXXXX.COM >wrote in message
Quote
if I change the data in the array, what is a sensible way to
update the viewed draw grid.
Invalidate() the grid.
Quote
What I have now causes some 'sparkle' effects in the TDrawGrid view.
Please clearify. What are you referring to exactly when you say "sparkle"?
I assume you mean "flickering"?
Quote
However I would prefer it to just redraw what changed. Is this possible?
Yes, but you will have to manually determine the exact display area that is
affected and then invalidate just that area rather than the entire grid as a
whole. Use the grid's CellRect() method and the Win32 API InvalidateRect()
function.
Quote
I believe the sparkle affect is a result of how fast I am updating
the information in the array and redrawing the whole thing over
and over again.
Invalidating the grid is not an immediate redraw. The OS caches multiple
invalidations, and then when the window is ready to be redrawn onscreen, a
single paint request is posted to the grid's window and all invalidated
areas are drawn at one time.
Gambit
 
 

Re:Re: TDrawGrid in BCB5 - Sensible Display Update

"Stephen R. Phillips" < XXXX@XXXXX.COM >wrote in message
Quote
It still has 'drawing' issues but in general was a much cleaner method
than any other I tried. It has a few display anomalies but compared
to what I was getting before, this is just fine.
Please elaborate.
Gambit