]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/control.cpp
Don't always override the default background colours.
[wxWidgets.git] / src / msw / control.cpp
index dbefd0d91fa8b8bc68a5bbfcf5c04a1217e5ed4c..cab5151e1cf0bdf551ff4e71d1c7986b9c1748cc 100644 (file)
@@ -398,8 +398,7 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
         ::SetBkColor(hdc, wxColourToRGB(colBg));
 
         // draw children with the same colour as the parent
-        wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg,
-                                                           wxBRUSHSTYLE_SOLID);
+        wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg);
         hbr = (WXHBRUSH)brush->GetResourceHandle();
     }
 
@@ -415,14 +414,13 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
 
 WXHBRUSH wxControl::MSWControlColor(WXHDC pDC, WXHWND hWnd)
 {
-    wxColour colBg;
-
     if ( HasTransparentBackground() )
         ::SetBkMode((HDC)pDC, TRANSPARENT);
-    else // if the control is opaque it shouldn't use the parents background
-        colBg = GetBackgroundColour();
 
-    return DoMSWControlColor(pDC, colBg, hWnd);
+    // don't pass any background colour to DoMSWControlColor(), our own
+    // background colour will be used by it only if it is set, otherwise the
+    // defaults will be used
+    return DoMSWControlColor(pDC, wxColour(), hWnd);
 }
 
 WXHBRUSH wxControl::MSWControlColorDisabled(WXHDC pDC)