- WXHBRUSH hbr = MSWControlColorSolid(pDC, m_hasBgCol ? m_backgroundColour
- : wxNullColour);
- if ( hbr )
- return hbr;
-
- ::SetBkMode((HDC)pDC, TRANSPARENT);
-
- // check if we should adapt our background to our parent
- for ( wxWindow *win = this; win; win = win->GetParent() )
- {
- if ( win->IsTopLevel() )
- {
- // don't go beyond the first top level parent
- break;
- }
-
- if ( win->GetBackgroundStyle() == wxBG_STYLE_COLOUR )
- {
- // parent window has solid colour, so it doesn't look
- // transparent and hence we shouldn't show notebook background
- wxBrush *brush = wxTheBrushList->FindOrCreateBrush
- (
- win->GetBackgroundColour(),
- wxSOLID
- );
-
- return (WXHBRUSH)brush->GetResourceHandle();
- }