]>
git.saurik.com Git - wxWidgets.git/blob - src/msw/panel.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/panel.cpp
3 // Purpose: Implementation of wxMSW-specific wxPanel class.
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // ============================================================================
13 // ============================================================================
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 // for compilers that support precompilation, includes "wx.h".
20 #include "wx/wxprec.h"
27 #include "wx/bitmap.h"
32 // ============================================================================
34 // ============================================================================
38 delete m_backgroundBrush
;
41 bool wxPanel::HasTransparentBackground()
43 for ( wxWindow
*win
= GetParent(); win
; win
= win
->GetParent() )
45 if ( win
->MSWHasInheritableBackground() )
48 if ( win
->IsTopLevel() )
55 void wxPanel::DoSetBackgroundBitmap(const wxBitmap
& bmp
)
57 delete m_backgroundBrush
;
58 m_backgroundBrush
= bmp
.IsOk() ? new wxBrush(bmp
) : NULL
;
60 // Our transparent children should use our background if we have it,
61 // otherwise try to restore m_inheritBgCol to some reasonable value: true
62 // if we also have non-default background colour or false otherwise.
63 m_inheritBgCol
= bmp
.IsOk() || UseBgCol();
66 WXHBRUSH
wxPanel::MSWGetCustomBgBrush()
68 if ( m_backgroundBrush
)
69 return (WXHBRUSH
)m_backgroundBrush
->GetResourceHandle();
71 return wxPanelBase::MSWGetCustomBgBrush();