]> git.saurik.com Git - wxWidgets.git/commitdiff
If we use a background brush, we _must_ set a colour (fixes a bug with static labels
authorJulian Smart <julian@anthemion.co.uk>
Fri, 15 Sep 2006 19:46:50 +0000 (19:46 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 15 Sep 2006 19:46:50 +0000 (19:46 +0000)
not showing on a panel with a black background when system colours are high-contrast)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/control.cpp

index 6572a219c03411fa3db236f43830b900a53a25ea..9817456107b04b0f38d0f71802e8cdd2e649820c 100644 (file)
@@ -382,14 +382,15 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
 
         hbr = (WXHBRUSH)brush->GetResourceHandle();
 
 
         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
     }
 
     }
 
+    // if we use custom background, we should set foreground ourselves too
+    if ( hbr && !m_hasFgCol )
+    {
+        ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT));
+    }
+    //else: already set above
+
     return hbr;
 }
 
     return hbr;
 }