]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxStaticBox::SetBackgroundColour(): this should change background for the label...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Apr 2005 21:27:35 +0000 (21:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Apr 2005 21:27:35 +0000 (21:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/msw/statbox.cpp

index bc4afdb9d90f87e9643ec7685b46cf5b1d22d163..48f64b8ff6df0079897391779792626161dce5db 100644 (file)
@@ -12,6 +12,7 @@ All:
 wxMSW:
 
 - fixed static box border when the label is empty
+- fixed SetBackgroundColour() to change only label background, not entire box
 
 2.5.5
 -----
index ef01a49a6a4841e6fa574910cddc181cef628c3e..a67845a861604eac9f9c87d91a2c25dff5656bc5 100644 (file)
@@ -286,11 +286,15 @@ WXHRGN wxStaticBox::MSWGetRegionWithoutChildren()
 // helper for OnPaint()
 void wxStaticBox::PaintBackground(wxDC& dc, const RECT& rc)
 {
-    HBRUSH hbr = (HBRUSH)DoMSWControlColor(GetHdcOf(dc), wxNullColour);
+    // note that static box should be transparent, so it should show its
+    // parents colour, not its own
+    wxWindow * const parent = GetParent();
+
+    HBRUSH hbr = (HBRUSH)parent->MSWGetBgBrush(dc.GetHDC());
     if ( !hbr )
     {
-        wxBrush *
-            brush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour());
+        wxBrush *brush =
+            wxTheBrushList->FindOrCreateBrush(parent->GetBackgroundColour());
         if ( brush )
             hbr = GetHbrushOf(*brush);
     }