git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31270
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// do default background painting
// 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
+ if ( !DoEraseBackground(*event.GetDC()) )
{
// let the system paint the background
event.Skip();
}
}
{
// let the system paint the background
event.Skip();
}
}
+bool wxWindowMSW::DoEraseBackground(wxDC& dc)
+{
+ HBRUSH hBrush = (HBRUSH)MSWGetBgBrush(dc.GetHDC());
+ if ( !hBrush )
+ return false;
+
+ RECT rc;
+ ::GetClientRect(GetHwnd(), &rc);
+ ::FillRect(GetHdcOf(dc), &rc, hBrush);
+
+ return true;
+}
+
WXHBRUSH wxWindowMSW::MSWGetSolidBgBrushForChild(wxWindow *child)
{
wxColour col = MSWGetBgColourForChild(child);
WXHBRUSH wxWindowMSW::MSWGetSolidBgBrushForChild(wxWindow *child)
{
wxColour col = MSWGetBgColourForChild(child);