]> git.saurik.com Git - wxWidgets.git/commitdiff
Set m_inheritBgCol flag in wxPanel with a background bitmap.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Mar 2011 16:08:11 +0000 (16:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 24 Mar 2011 16:08:11 +0000 (16:08 +0000)
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

src/msw/panel.cpp

index 5dc1bfcf5a2027b540beec3ceb26200768c4818d..e5b57eeb3af095b1115568f02064ac8a3f4b5025 100644 (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()