disable Windows on-paint clipping for non-transparent canvases, just in case

svn: r9835
This commit is contained in:
Matthew Flatt 2008-05-14 20:42:48 +00:00
parent 40d7afd81c
commit 07c618d3e1

View File

@ -509,7 +509,7 @@ wxCanvasWnd::wxCanvasWnd (wxWnd * parent, wxWindow * wx_win,
static HBRUSH btnface_brush;
BOOL wxCanvasWnd::OnEraseBkgnd (HDC pDC)
static void DoErase(wxWindow *wx_window, HDC pDC)
{
long wstyle;
@ -553,6 +553,11 @@ BOOL wxCanvasWnd::OnEraseBkgnd (HDC pDC)
SetWindowExtEx(pDC, canvas->wx_dc->window_ext_x, canvas->wx_dc->window_ext_y, NULL);
}
}
}
BOOL wxCanvasWnd::OnEraseBkgnd (HDC pDC)
{
DoErase(wx_window, pDC);
return TRUE;
}
@ -708,6 +713,7 @@ void wxCanvas::DoPaint()
if (need_update) {
RECT r;
if (GetRgnBox(need_update, &r) != NULLREGION) {
if (wstyle & wxTRANSPARENT_WIN) {
wxDC *dc;
HDC hdc;
HRGN paint_rgn;
@ -730,6 +736,23 @@ void wxCanvas::DoPaint()
dc->DoneDC(hdc);
DeleteObject(paint_rgn);
} else {
SetRectRgn(need_update, 0, 0, 0, 0);
if (!(wstyle & wxNO_AUTOCLEAR)) {
/* The erase through OnEraseBkgnd() was confine to the clipping
area. Erase the full area. */
wxDC *dc;
HDC hdc;
dc = GetDC();
hdc = dc->ThisDC(FALSE);
DoErase(this, hdc);
dc->DoneDC(hdc);
}
OnPaint();
}
}
}
}