- case wxBG_STYLE_COLOUR:
- // we have a fixed solid background colour, do use it
- RECT rect;
- ::GetClientRect(GetHwnd(), &rect);
+ // do default background painting
+ wxDC& dc = *event.GetDC();
+ HBRUSH hBrush = (HBRUSH)MSWGetBgBrush(dc.GetHDC());
+ if ( hBrush )
+ {
+ RECT rc;
+ ::GetClientRect(GetHwnd(), &rc);
+ ::FillRect(GetHdcOf(dc), &rc, hBrush);
+ }
+ else
+ {
+ // let the system paint the background
+ event.Skip();
+ }
+}
+
+WXHBRUSH wxWindowMSW::MSWGetSolidBgBrushForChild(wxWindow *child)
+{
+ wxColour col = MSWGetBgColourForChild(child);
+ if ( col.Ok() )
+ {
+ // draw children with the same colour as the parent
+ wxBrush *brush = wxTheBrushList->FindOrCreateBrush(col, wxSOLID);
+
+ return (WXHBRUSH)brush->GetResourceHandle();
+ }
+
+ return 0;
+}
+
+wxColour wxWindowMSW::MSWGetBgColourForChild(wxWindow * WXUNUSED(child))
+{
+ return m_hasBgCol ? GetBackgroundColour() : wxNullColour;
+}