- m_llist->Draw(*m_memDC,offset);
- if(IsEditable())
- m_llist->DrawCursor(*m_memDC,m_HaveFocus,offset);
- // Now copy everything to the screen:
- dc.Blit(x0,y0,x1,y1,m_memDC,0,0,wxCOPY,FALSE);
+ m_llist->Draw(*m_memDC,offset, y0, y0+y1);
+
+ // We start calculating a new update rect before drawing the
+ // cursor, so that the cursor coordinates get included in the next
+ // update rectangle (although they are drawn on the memDC, this is
+ // needed to erase it):
+ m_llist->InvalidateUpdateRect();
+ m_llist->DrawCursor(*m_memDC,
+ m_HaveFocus && IsEditable(), // draw a thick
+ // cursor for editable windows with focus
+ offset);
+
+// Now copy everything to the screen:
+#if 0
+ // This somehow doesn't work, but even the following bit with the
+ // whole rect at once is still a bit broken I think.
+ wxRegionIterator ri ( GetUpdateRegion() );
+ if(ri)
+ while(ri)
+ {
+ WXLO_DEBUG(("UpdateRegion: %ld,%ld, %ld,%ld",
+ ri.GetX(),ri.GetY(),ri.GetW(),ri.GetH()));
+ dc.Blit(x0+ri.GetX(),y0+ri.GetY(),ri.GetW(),ri.GetH(),
+ m_memDC,ri.GetX(),ri.GetY(),wxCOPY,FALSE);
+ ri++;
+ }
+ else
+#endif
+ {
+ // FIXME: Trying to copy only the changed parts, but it does not seem
+ // to work:
+// x0 = updateRect->x; y0 = updateRect->y;
+// if(updateRect->height < y1)
+// y1 = updateRect->height;
+// y1 += WXLO_YOFFSET; //FIXME might not be needed
+ dc.Blit(x0,y0,x1,y1,m_memDC,0,0,wxCOPY,FALSE);
+ }