X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cd95f7e65c4e1ee61a5d90eb13687ff468cb13ad..773db5dfb386719b34ea90c1885ca1f082717b7f:/src/msw/panel.cpp diff --git a/src/msw/panel.cpp b/src/msw/panel.cpp index bc73d1267a..c502caf9f5 100644 --- a/src/msw/panel.cpp +++ b/src/msw/panel.cpp @@ -24,6 +24,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/bitmap.h" #include "wx/brush.h" #include "wx/panel.h" #endif // WX_PRECOMP @@ -32,6 +33,11 @@ // implementation // ============================================================================ +wxPanel::~wxPanel() +{ + delete m_backgroundBrush; +} + bool wxPanel::HasTransparentBackground() { for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) @@ -50,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()