Board index » delphi » BeginUpdate/EndUpdate don't work in D3's TStatusBar

BeginUpdate/EndUpdate don't work in D3's TStatusBar

Anyone else experienced this?  I have a status bar that has about 7 or 8 text
panels (no owner drawing), and if I update several of the at one time, the
flicker is most annoying.  Surrounding the changes with StatusBar.BeginUpdate
and EndUpdate doesn't help, and I think it may make it a little worse.  I
ported this app from Delphi 2, which did not have this problem.  The one thing
I've noticed different in the TStatusBar source code is in the UpdatePanel
method:

procedure TStatusBar.UpdatePanel(Index: Integer);
var
  Flags: Integer;
  S: string;
begin
  if HandleAllocated then
[....stuff deleted....]  
      SendMessage(Handle, SB_SETTEXT, Index or Flags, Integer(PChar(S)));
      InvalidateRect(Handle, Nil, True);
    end;
end;

The InvalidateRect(Handle, NIL, TRUE) line was not in the Delphi 2.01 VCL
source code.  

Hints, clues?

Regards,
Brad Stowers
Delphi Free Stuff
http://www.pobox.com/~bstowers/delphi/

 

Re:BeginUpdate/EndUpdate don't work in D3's TStatusBar


Have you tried ...

LockWindowUpdate(StatusBar.Handle);
DoMyStuff;
LockWindowUpdate(0);

Works for me as a general purpose screen freeze, even with i/o going on.

Quote
Bradley D. Stowers wrote:
> Surrounding the changes with StatusBar.BeginUpdate
> and EndUpdate doesn't help,

Re:BeginUpdate/EndUpdate don't work in D3's TStatusBar


On Tue, 11 Nov 1997 22:32:40 -0500, Steve Griffiths

Quote
<supp...@imagedesigninc.com> wrote:
>Have you tried ...

>LockWindowUpdate(StatusBar.Handle);
>DoMyStuff;
>LockWindowUpdate(0);

>Works for me as a general purpose screen freeze, even with i/o going on.

Yes, but all I get there is the entire desktop window refreshed when the
second call is made.  I had been using it in several places before I ported it
to D3, but I had to get rid of them because of this.  My first thought was
that I had an "unbalanced" call, i.e. was calling LockWindowUpdate(0) when
there was no window currently locked, but I've followed this thing through the
de{*word*81} and for some reason, it always causes the whole desktop to get
repainted.  Never happened in D2.

--Brad

Regards,
Brad Stowers
Delphi Free Stuff
http://www.pobox.com/~bstowers/delphi/

Other Threads