BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help! ListView is flickering

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
David
Guest





PostPosted: Mon Apr 12, 2004 2:30 pm    Post subject: Help! ListView is flickering Reply with quote



Hello.

I have a listview on my form and a timer. The timer update the captions of
the items in the
listview each second. each time the listview items changes, it redraw
itself (the entire listview) which cause flickering... is there a way to
avoid it?

Thanks in advance,

David


Back to top
Simon D
Guest





PostPosted: Mon Apr 12, 2004 3:41 pm    Post subject: Re: Help! ListView is flickering Reply with quote



"David" <virtek1 (AT) hotmail (DOT) com> wrote

Quote:
Hello.

I have a listview on my form and a timer. The timer update the captions of
the items in the
listview each second. each time the listview items changes, it redraw
itself (the entire listview) which cause flickering... is there a way to
avoid it?

Thanks in advance,

David

Are you using
ListView->Items->BeginUpdate();
and
ListView->Items->EndUpdate();
??

Simon.



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Apr 12, 2004 4:57 pm    Post subject: Re: Help! ListView is flickering Reply with quote




"David" <virtek1 (AT) hotmail (DOT) com> wrote


Quote:
I have a listview on my form and a timer. The timer update
the captions of the items in the listview each second. each
time the listview items changes, it redraw itself (the entire
listview) which cause flickering... is there a way to avoid it?

Please show your actual code.


Gambit



Back to top
David
Guest





PostPosted: Mon Apr 12, 2004 9:27 pm    Post subject: Re: Help! ListView is flickering Reply with quote

I've manage to partially get rid of the flickering.
Simon, yes, i did use it but for vain somewhat.

Remy,

I've added the LockWindowUpdate() procedure, by following:

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{

ListView1->BeginUpdate();
LockWindowUpdate(ListView1->Handle);

.......Doing some items and sub-items updates.......

LockWindowUpdate(NULL);
ListView1->EndUpdate();

}

Now the header of the vsReport property never flicker, but the listview body
flicker, but rarely.

The timer interval is 1000 if it says something...

Thanks,

David

"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> כתב
בהודעה:407acb9d$3 (AT) newsgroups (DOT) borland.com...
Quote:

"David" <virtek1 (AT) hotmail (DOT) com> wrote in message
news:407aa813$2 (AT) newsgroups (DOT) borland.com...

I have a listview on my form and a timer. The timer update
the captions of the items in the listview each second. each
time the listview items changes, it redraw itself (the entire
listview) which cause flickering... is there a way to avoid it?

Please show your actual code.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Apr 12, 2004 9:33 pm    Post subject: Re: Help! ListView is flickering Reply with quote


"David" <virtek1 (AT) hotmail (DOT) com> wrote


Quote:
ListView1->BeginUpdate();

Is this your ACTUAL code copy/pasted as-is? I suspect not, considering that
TListView doesn't have Begin/EndUpdate() methods at all. They are methods
of the Items property instead:

ListView1->Items->BeginUpdate();
...
ListView1->Items->EndUpdate();

Quote:
LockWindowUpdate(ListView1->Handle);

You do not need to call LockWindowUpdate(), nor should you b doing so.
BeginUpdate() already handles disabling screen updates, you don't have to do
anything else for it.

Quote:
......Doing some items and sub-items updates.......

Please show that code.


Gambit



Back to top
Mark Jacobs
Guest





PostPosted: Tue Apr 13, 2004 10:10 am    Post subject: Re: Help! ListView is flickering Reply with quote

You might also try making your form Form1 property DoubleBuffered=true; (BCB5 onwards)
--
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
[email]markj (AT) criticalremovethisspuriousantispamstuff (DOT) co.uk[/email]

"David" <virtek1 (AT) hotmail (DOT) com> wrote

Quote:
Hello.

I have a listview on my form and a timer. The timer update the captions of
the items in the
listview each second. each time the listview items changes, it redraw
itself (the entire listview) which cause flickering... is there a way to
avoid it?

Thanks in advance,

David





Back to top
David
Guest





PostPosted: Fri Apr 16, 2004 11:27 am    Post subject: Re: Help! ListView is flickering Reply with quote

I've forgot to mention that the listview a little diffrent, it's from TMS,
and so one can
do ListView1->BeginUpdate();

But I've changed it to ListView1->Items->BeginUpdate(), EndUpdate() and the
flickring was gone!

Thanks Remy.

"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> כתב
בהודעה:407b0c58 (AT) newsgroups (DOT) borland.com...
Quote:

"David" <virtek1 (AT) hotmail (DOT) com> wrote in message
news:407b09ab (AT) newsgroups (DOT) borland.com...

ListView1->BeginUpdate();

Is this your ACTUAL code copy/pasted as-is? I suspect not, considering
that
TListView doesn't have Begin/EndUpdate() methods at all. They are methods
of the Items property instead:

ListView1->Items->BeginUpdate();
...
ListView1->Items->EndUpdate();

LockWindowUpdate(ListView1->Handle);

You do not need to call LockWindowUpdate(), nor should you b doing so.
BeginUpdate() already handles disabling screen updates, you don't have to
do
anything else for it.

......Doing some items and sub-items updates.......

Please show that code.


Gambit





Back to top
Corey Murtagh
Guest





PostPosted: Wed Apr 28, 2004 2:59 am    Post subject: Re: Help! ListView is flickering Reply with quote

Mark Jacobs wrote:

Quote:
You might also try making your form Form1 property DoubleBuffered=true; (BCB5 onwards)

BCB4 has a non-published DoubleBuffered property.

Another angle no-one seems to have mentioned, which certainly works for
BCB4, is to set the csOpaque flag in ControlStyle. This has the effect,
in TWinControl descendants that don't mess with the CMInvalidate
handler, of preventing the call to InvalidateRect() from erasing the
existing background. YMMV of course... it all depends on what you're doing.

--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.