X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55a40ad970a1ac4f6d1457a441be4d83445efb74..abd474ea63667f727940a009cc3e0b23ba9f418f:/src/msw/panel.cpp diff --git a/src/msw/panel.cpp b/src/msw/panel.cpp index 5dc1bfcf5a..be95de10b3 100644 --- a/src/msw/panel.cpp +++ b/src/msw/panel.cpp @@ -3,7 +3,7 @@ // Purpose: Implementation of wxMSW-specific wxPanel class. // Author: Vadim Zeitlin // Created: 2011-03-18 -// RCS-ID: $Id: wxhead.cpp,v 1.11 2010-04-22 12:44:51 zeitlin Exp $ +// RCS-ID: $Id$ // Copyright: (c) 2011 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -33,6 +33,11 @@ // implementation // ============================================================================ +wxPanel::~wxPanel() +{ + delete m_backgroundBrush; +} + bool wxPanel::HasTransparentBackground() { for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) @@ -51,6 +56,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()