]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/control.cpp
reSWIGged
[wxWidgets.git] / src / msw / control.cpp
index ce27473f216a1c36010b8dd1f8abef8fff682df4..8b27babb0636cb49db71bd5022faf5d09e5a7e93 100644 (file)
@@ -339,10 +339,6 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
     {
         ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
     }
     {
         ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour()));
     }
-    else
-    {
-        ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT));
-    }
 
     WXHBRUSH hbr = 0;
     if ( !colBg.Ok() )
 
     WXHBRUSH hbr = 0;
     if ( !colBg.Ok() )
@@ -365,6 +361,13 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
         wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg, wxSOLID);
 
         hbr = (WXHBRUSH)brush->GetResourceHandle();
         wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBg, wxSOLID);
 
         hbr = (WXHBRUSH)brush->GetResourceHandle();
+
+        // if we use custom background, we should set foreground ourselves too
+        if ( !m_hasFgCol )
+        {
+            ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT));
+        }
+        //else: already set above
     }
 
     return hbr;
     }
 
     return hbr;