+ // Device origins on the memDC are suspect, we translate manually
+ // with the translate parameter of Draw().
+ m_memDC->SetDeviceOrigin(0,0);
+ m_memDC->SetBackgroundMode(wxTRANSPARENT);
+ m_memDC->SetBrush(wxBrush(m_llist->GetDefaults()->GetBGColour(), wxSOLID));
+ m_memDC->SetPen(wxPen(m_llist->GetDefaults()->GetBGColour(),0,wxTRANSPARENT));
+ m_memDC->SetLogicalFunction(wxCOPY);
+ if(m_BGbitmap)
+ {
+ CoordType
+ y, x,
+ w = m_BGbitmap->GetWidth(),
+ h = m_BGbitmap->GetHeight();
+ for(y = 0; y < y1; y+=h)
+ for(x = 0; x < x1; x+=w)
+ m_memDC->DrawBitmap(*m_BGbitmap, x, y);
+ }
+ else
+ m_memDC->DrawRectangle(0,0,x1, y1);
+
+ // The offsets give the window a tiny border on the left and top, looks nice.
+ wxPoint offset(-x0+WXLO_XOFFSET,-y0+WXLO_YOFFSET);
+ m_llist->Draw(*m_memDC,offset);
+ if(IsEditable())
+ m_llist->DrawCursor(*m_memDC,m_HaveFocus,offset);
+
+ // Now copy everything to the screen:
+#if 0
+ //FIXME:
+ // 1. the update region as calculated by the list is wrong
+ // 2. we get wrong values here
+ // 3. how about the offset?
+ wxRegionIterator ri ( GetUpdateRegion() );
+ if(ri)
+ while(ri)
+ {
+ wxLogDebug("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
+ // If there are no update rectangles, we got called to reflect
+ // a change in the list. Currently there is no mechanism to
+ // easily find out which bits need updating, so we update
+ // all. The wxLayoutList could handle this, creating a list or
+ // at least one large rectangle of changes. FIXME
+ dc.Blit(x0,y0,x1,y1,m_memDC,0,0,wxCOPY,FALSE);
+
+ ResetDirty();
+ m_ScrollToCursor = false;