+void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
+{
+ wxPaintDC dcWin(this);
+ PrepareDC( dcWin );
+
+ if ( m_useBuffer )
+ {
+ const wxSize size = GetClientSize();
+ wxMemoryDC dc;
+ wxBitmap bmp(size.x, size.y);
+ dc.SelectObject(bmp);
+ dc.Blit(0, 0, size.x, size.y, &dcWin, 0, 0);
+ dc.DrawText(_T("(copy of background)"), 5, 120 );
+
+ DoPaint(dc);
+
+ dcWin.Blit(0, 0, size.x, size.y, &dc, 0, 0);
+ }
+ else
+ {
+ DoPaint(dcWin);
+ }
+}
+