]> git.saurik.com Git - wxWidgets.git/commitdiff
extracted background painting in a separate function so that it could be called from...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 7 Jan 2005 14:38:07 +0000 (14:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 7 Jan 2005 14:38:07 +0000 (14:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index cf15c6ae66236cf30e1faff0ecf61d9411fe3a10..a3a82351a42b8d739dd38ce72bfdc8ddadf3dd7a 100644 (file)
@@ -4102,21 +4102,26 @@ void wxWindowMSW::OnEraseBackground(wxEraseEvent& event)
 
 
     // do default background painting
 
 
     // do default background painting
-    wxDC& dc = *event.GetDC();
-    HBRUSH hBrush = (HBRUSH)MSWGetBgBrush(dc.GetHDC());
-    if ( hBrush )
-    {
-        RECT rc;
-        ::GetClientRect(GetHwnd(), &rc);
-        ::FillRect(GetHdcOf(dc), &rc, hBrush);
-    }
-    else
+    if ( !DoEraseBackground(*event.GetDC()) )
     {
         // let the system paint the background
         event.Skip();
     }
 }
 
     {
         // let the system paint the background
         event.Skip();
     }
 }
 
+bool wxWindowMSW::DoEraseBackground(wxDC& dc)
+{
+    HBRUSH hBrush = (HBRUSH)MSWGetBgBrush(dc.GetHDC());
+    if ( !hBrush )
+        return false;
+
+    RECT rc;
+    ::GetClientRect(GetHwnd(), &rc);
+    ::FillRect(GetHdcOf(dc), &rc, hBrush);
+
+    return true;
+}
+
 WXHBRUSH wxWindowMSW::MSWGetSolidBgBrushForChild(wxWindow *child)
 {
     wxColour col = MSWGetBgColourForChild(child);
 WXHBRUSH wxWindowMSW::MSWGetSolidBgBrushForChild(wxWindow *child)
 {
     wxColour col = MSWGetBgColourForChild(child);