extracted background painting in a separate function so that it could be called from derived classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4102,21 +4102,26 @@ void wxWindowMSW::OnEraseBackground(wxEraseEvent& event)
|
||||
|
||||
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
Reference in New Issue
Block a user