Board index » cppbuilder » TStringGrid Screen Updates

TStringGrid Screen Updates


2006-08-21 09:12:28 PM
cppbuilder57
I am using TStringGrid for a project (actually, I am trying
TAdvStringGrid from TMS Software). It seems to be working OK,
but I am having a problem with screen updates. After filling
some cells with data, colors, etc, I need to force an immediate
update before proceeding, but these updates lag way too long.
I have been issuing a call to Update() for my form, but this
doesn't seem to have an effect. Any ideas on where to look?
 
 

Re:TStringGrid Screen Updates

"Barry" < XXXX@XXXXX.COM >wrote:
Quote
I am using TStringGrid for a project (actually, I am trying
TAdvStringGrid from TMS Software). It seems to be working OK,
but I am having a problem with screen updates. After filling
some cells with data, colors, etc, I need to force an immediate
update before proceeding, but these updates lag way too long.
I have been issuing a call to Update() for my form, but this
doesn't seem to have an effect. Any ideas on where to look?
Try this: Grid->Repaint();
 

Re:TStringGrid Screen Updates

"Thorsten Kettner" < XXXX@XXXXX.COM >wrote:
Quote

"Barry" < XXXX@XXXXX.COM >wrote:
>I am using TStringGrid for a project (actually, I am trying
>TAdvStringGrid from TMS Software). It seems to be working OK,
>but I am having a problem with screen updates. After filling
>some cells with data, colors, etc, I need to force an immediate
>update before proceeding, but these updates lag way too long.
>I have been issuing a call to Update() for my form, but this
>doesn't seem to have an effect. Any ideas on where to look?

Try this: Grid->Repaint();
Great suggestion, but, alas, it had no apparent effect.
Perhaps a little more info would help.
This system is an automatic hardware tester. The grid contains
a sequence of tests to be performed. After I initialize the
Grid with startup data, the auto-sequencing function is called
from the idle loop
Application->OnIdle = MyIdleHandler;
If I am in a running state, My IdleHandler contains a line
RunAutoProcess().
to do my thing. As I finish each test, I "fill in the grid"
fields with data and then scroll up the grid to show the next
test line with
AutoTestDataGrid->TopRow += 1;
followed by
AutoTestDataGrid->Repaint();
The changing grid data display works fine, except for the
scrolling. When I have finished the 50 test points, I can
manually scroll using the scrollbar just fine. I have tried
Repaint(), Invalidate(), Update() with no success.
 

{smallsort}

Re:TStringGrid Screen Updates

"Barry" < XXXX@XXXXX.COM >wrote:
Quote
AutoTestDataGrid->TopRow += 1;
followed by
AutoTestDataGrid->Repaint();

The changing grid data display works fine, except for the
scrolling. When I have finished the 50 test points, I can
manually scroll using the scrollbar just fine. I have tried
Repaint(), Invalidate(), Update() with no success.
Just a guess: Maybe issuing Application->ProcessMessages();
after setting the top row would give the system time to scroll
the grid. (I.e. maybe Repaint *sends* a message whereas setting
TopRow only *posts* a message, hence the delay).
 

Re:TStringGrid Screen Updates

"Thorsten Kettner" < XXXX@XXXXX.COM >wrote:
Quote

"Barry" < XXXX@XXXXX.COM >wrote:
>AutoTestDataGrid->TopRow += 1;
>followed by
>AutoTestDataGrid->Repaint();
>
>The changing grid data display works fine, except for the
>scrolling. When I have finished the 50 test points, I can
>manually scroll using the scrollbar just fine. I have tried
>Repaint(), Invalidate(), Update() with no success.

Just a guess: Maybe issuing Application->ProcessMessages();
after setting the top row would give the system time to scroll
the grid. (I.e. maybe Repaint *sends* a message whereas setting
TopRow only *posts* a message, hence the delay).
I tried that, but it didn't work either. Another thing I tried
was to put a short delay in the code just after the
ProcessMessages() call. I did this with my own function
Wait(0.5), which waits 1/2 second with a Windows timer based
wait loop (do nothing until get a timer tick). This worked
much better, but significantly increases my processing time
when I have a lot of test points. I am next trying a
Grid->BeginUpdate and Grid->EndUpdate pair of calls, which is
unique to TMS's TAdvStringGrid. I'll let you know how it works.
 

Re:TStringGrid Screen Updates

"Barry" < XXXX@XXXXX.COM >wrote:
Quote

"Thorsten Kettner" < XXXX@XXXXX.COM >wrote:
>
>"Barry" < XXXX@XXXXX.COM >wrote:
>>AutoTestDataGrid->TopRow += 1;
>>followed by
>>AutoTestDataGrid->Repaint();
>>
>>The changing grid data display works fine, except for the
>>scrolling. When I have finished the 50 test points, I can
>>manually scroll using the scrollbar just fine. I have tried
>>Repaint(), Invalidate(), Update() with no success.
>
>Just a guess: Maybe issuing Application->ProcessMessages();
>after setting the top row would give the system time to scroll
>the grid. (I.e. maybe Repaint *sends* a message whereas setting
>TopRow only *posts* a message, hence the delay).

I tried that, but it didn't work either. Another thing I tried
was to put a short delay in the code just after the
ProcessMessages() call. I did this with my own function
Wait(0.5), which waits 1/2 second with a Windows timer based
wait loop (do nothing until get a timer tick). This worked
much better, but significantly increases my processing time
when I have a lot of test points. I am next trying a
Grid->BeginUpdate and Grid->EndUpdate pair of calls, which is
unique to TMS's TAdvStringGrid. I'll let you know how it works.
The Grid->BeginUpdate and Grid->EndUpdate pair works great!!
It also speeds things up since Windows is not constantly
updating my grid as I go along.