[ wxwindows-Bugs-1639629 ] wxVScrolledWindow repaints wrong content on SetLineCount()

SourceForge.net noreply at sourceforge.net
Fri Jan 19 07:21:33 PST 2007


Bugs item #1639629, was opened at 2007-01-19 16:21
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1639629&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Common
Group: Must fix
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: cecilio (cecilios)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxVScrolledWindow repaints wrong content on SetLineCount()

Initial Comment:
I am using wxVScrolledWindow (wxMSW 2.8.0), as base class to implement a control. When the user clicks on a displayed item I have to insert some extra lines into the wxVScrolledWindow content. To this end I execute next code (I suppose this is the right expected way of using wxScrolledWindow):

    //some code to insert more lines;
    ...
    //inform wxScrolledWindow about new size              
    SetLineCount(count);
    //request it to repaint all content        
    RefreshAll();               

In the previous code I am observing a couple of problems due to 'SetLineCount()' behaviour.  SetLineCount() main objective is to recalculate the new scrollbars parameters, and to this end the next two lines of code are executed:

        m_lineFirst = 1;    // make sure it is != 0
        ScrollToLine(0);
        
The bug I am observing is that as a side effect, ScrollToLine(0) causes to repaint all wxScrolledWindow again but displaced one line !!!! so first line is duplicated on screen.
This is the bug to solve. [I attach vscroll sample (file vstest.cpp) modified to spot the bug:
choose 'File->Update line count'].

And then, my second line of code, RefreshAll(), forces to re-display all content again, but this time correctly.

This double repaint causes a flicking that should be avoided. This flicking is specially ugly due to the displaced repaint done by SetLineCount, so user perceives not only a flicking on the image but also some strange movement.

One suggestion: If the purpose of SetLineCount(count) is just to recalculate the new scroll bar size, it shouldn't repaint content. And, conversely, if it always repaints contents, I suggests to change documentation to say it or to change method name (SetLineCountAndRepaintAll ?), so that users do not invoke RefreshAll() after setting a new line count.

Hope the attached file helps to solve the bug.

Regards,
Cecilio


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1639629&group_id=9863




More information about the wx-dev mailing list