]> git.saurik.com Git - wxWidgets.git/commitdiff
use correct background colour for the box label when foreground colour is set (remain...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Mar 2007 02:28:06 +0000 (02:28 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 22 Mar 2007 02:28:06 +0000 (02:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/statbox.cpp

index ffb1b61f2de70d0d21f7bcb75f70b337a0132b62..692e8a10caa5863a38ca07a81ba3b9ec0c14bc53 100644 (file)
@@ -483,7 +483,18 @@ void wxStaticBox::PaintForeground(wxDC& dc, const RECT& rc)
         dimensions.right += 2;
         dimensions.bottom += 2;
 
-        PaintBackground(dc, dimensions);
+        if ( UseBgCol() )
+        {
+            // our own background colour should be used for the background of
+            // the label: this is consistent with the behaviour under pre-XP
+            // systems (i.e. without visual themes) and generally makes sense
+            wxBrush brush = wxBrush(GetBackgroundColour());
+            ::FillRect(GetHdcOf(dc), &dimensions, GetHbrushOf(brush));
+        }
+        else // paint parent background
+        {
+            PaintBackground(dc, dimensions);
+        }
 
         // now draw the text
         if ( !rtl )