+
+ /* Check whether the window has grown, if so, we need to reallocate
+ the bitmap to be larger. */
+ if(x1 > m_bitmapSize.x || y1 > m_bitmapSize.y)
+ {
+ wxASSERT(m_bitmapSize.x > 0);
+ wxASSERT(m_bitmapSize.y > 0);
+
+ m_memDC->SelectObject(wxNullBitmap);
+ delete m_bitmap;
+ m_bitmapSize = wxPoint(x1,y1);
+ m_bitmap = new wxBitmap(x1,y1);
+ m_memDC->SelectObject(*m_bitmap);
+ }
+ // Device origins on the memDC are suspect, we translate manually
+ // with the translate parameter of Draw().
+ m_memDC->SetDeviceOrigin(0,0);
+ m_memDC->Clear();
+
+ // The +4 give the window a tiny border on the left and top, looks nice.
+ wxPoint offset(-x0+4,-y0+4);
+ 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);