From f05f427fc1d824521ed07297adfa9f2e4f8d02a5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Apr 2005 21:27:35 +0000 Subject: [PATCH] fixed wxStaticBox::SetBackgroundColour(): this should change background for the label only, not the entire box contents git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/msw/statbox.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index bc4afdb9d9..48f64b8ff6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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 ----- diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index ef01a49a6a..a67845a861 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -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); } -- 2.45.2