X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/441dfa1d99912c0b5fd1568efe9ff9df96656819..69659fd770f615210efac4b4fa741b3ad6223616:/src/msw/statbox.cpp diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index ffb1b61f2d..0d4df55d13 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -483,19 +483,30 @@ 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 ) { RECT rc2 = { x, 0, x + width, y }; - ::DrawText(hdc, label, label.length(), &rc2, + ::DrawText(hdc, label.wx_str(), label.length(), &rc2, DT_SINGLELINE | DT_VCENTER); } else // RTL { RECT rc2 = { x, 0, x - width, y }; - ::DrawText(hdc, label, label.length(), &rc2, + ::DrawText(hdc, label.wx_str(), label.length(), &rc2, DT_SINGLELINE | DT_VCENTER | DT_RTLREADING); } }