+ m_canvas = canvas;
+ if ( ms_PaintCount > 0 ) {
+ // it means that we've already called BeginPaint and so we must just
+ // reuse the same HDC (BeginPaint shouldn't be called more than once)
+ wxASSERT( ms_PaintHDC );
+
+ m_hDC = ms_PaintHDC;
+ ms_PaintCount++;
+ }
+ else {
+ ms_PaintHDC =
+ m_hDC = (WXHDC)::BeginPaint((HWND)m_canvas->GetHWND(), &g_paintStruct);
+ ms_PaintCount = 1;
+ m_hDCCount++;
+ }
+
+ SetBackground(wxBrush(m_canvas->GetBackgroundColour(), wxSOLID));