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
This commit is contained in:
Vadim Zeitlin
2005-04-05 21:27:35 +00:00
parent 6ecfb2c870
commit f05f427fc1
2 changed files with 8 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ All:
wxMSW: wxMSW:
- fixed static box border when the label is empty - fixed static box border when the label is empty
- fixed SetBackgroundColour() to change only label background, not entire box
2.5.5 2.5.5
----- -----

View File

@@ -286,11 +286,15 @@ WXHRGN wxStaticBox::MSWGetRegionWithoutChildren()
// helper for OnPaint() // helper for OnPaint()
void wxStaticBox::PaintBackground(wxDC& dc, const RECT& rc) 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 ) if ( !hbr )
{ {
wxBrush * wxBrush *brush =
brush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour()); wxTheBrushList->FindOrCreateBrush(parent->GetBackgroundColour());
if ( brush ) if ( brush )
hbr = GetHbrushOf(*brush); hbr = GetHbrushOf(*brush);
} }