Set m_inheritBgCol flag in wxPanel with a background bitmap.

This ensures that the panel background is used by its transparent children
under wxMSW even when the panel itself is inside a wxNotebook with themed
background: making InheritsBackgroundColour() return true prevents the
notebook from overriding our background.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-03-24 16:08:11 +00:00
parent 4dc7ae1ae8
commit af2fdacdb8

View File

@@ -51,6 +51,11 @@ void wxPanel::DoSetBackgroundBitmap(const wxBitmap& bmp)
{
delete m_backgroundBrush;
m_backgroundBrush = bmp.IsOk() ? new wxBrush(bmp) : NULL;
// Our transparent children should use our background if we have it,
// otherwise try to restore m_inheritBgCol to some reasonable value: true
// if we also have non-default background colour or false otherwise.
m_inheritBgCol = bmp.IsOk() || UseBgCol();
}
WXHBRUSH wxPanel::MSWGetCustomBgBrush()