Solved

FlickerLess CListCtrl / DoubleBufferd

Posted on 2001-09-13
9
402 Views
Last Modified: 2013-11-20
I Need WORKING example of FlickerLess CListCtrl.
I'm using win 2k and so far non of the exampes I found worked at all (they all flickerd when refreshing / updating items)

regards
0
Comment
Question by:monster2
  • 4
  • 3
  • 2
9 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 100 total points
Comment Utility
I have never seen this as a significant problem.  I think the trick is to not refresh/repopulate the entire list ... just the item(s) that need changing.  

If you show some typical code that flickers, I'll see if I can point out how to avoid the problem.

-- Dan
0
 

Author Comment

by:monster2
Comment Utility
the problem is that I did'nt wonted to search trough items and to  change them.
I cleard whole list and then populate it from scratch.
I found some examples which should owerride oppaint and on erease handlers but they still flicker.
(I could use this examples to put background bitmap but that's not needed)
I wont to take dc from control make another for in memory drawing and then copy content the one in memory to real dc so that whole drawing is in memory.
0
 
LVL 9

Expert Comment

by:ShaunWilde
Comment Utility
use SetRedraw eg



    m_List.SetRedraw(FALSE); // turn drawing off regardless of list mode

//....
//Insert the items and or delete
//....

    m_List.SetRedraw(TRUE); // turn drawing back on and update the window
    m_List.Invalidate();
    m_List.UpdateWindow();

0
 

Author Comment

by:monster2
Comment Utility
IT'S FLICKER


m_List.SetRedraw(TRUE);    m_List.Invalidate();
   m_List.UpdateWindow();

the problem is that the list itself is not doublebufferd
when I call UpdateWindow since it's not doublebufferd it flicker.
Only solution is doublebufering
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Expert Comment

by:ShaunWilde
Comment Utility
then you will need to write you own - the above method will allow you to change the items and stop it trying to flicker but in the end you have to update the window to show the new contents
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
>>I cleard whole list and then populate it from scratch

That is the problem.  

Patient:  Doctor! Doctor! It hurts when I do this!
Doctor:  Well, stop doing that!

Instead of clearing the list and repopulating it, simply replace the old top item with the new top item, and work your way down the list.  After replacing all the items if there are still more, insert them at the end.

Turn off sorting.

-- Dan
0
 

Author Comment

by:monster2
Comment Utility
will try that I'm to tired right now
Thanks
0
 

Author Comment

by:monster2
Comment Utility
well it's not what I asked but since I have decided to use such method (and to change my code :) ) I will accept it

Regards
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Thanks.
Better to use a simple, easy-to-understand, easy-to-maintain method than some convoluted double-buffer scheme anyway.

-- Dan
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now