Erase toolbar background even if it doesn't contain any controls/spaces.
Minor correction to changes in r62971: we still need to hook WM_ERASEBKGND in toolbar parent when painting the toolbar itself even when there are no dummy separators in it (and so we don't need to paint them over). Without this, the background of simple toolbars without controls was not erased correctly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62980 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1744,19 +1744,16 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !rgnDummySeps.IsOk() )
|
if ( rgnDummySeps.IsOk() )
|
||||||
{
|
{
|
||||||
// don't interfere with toolbar default painting at all if we don't
|
// exclude the area occupied by the controls and stretchable spaces
|
||||||
// need to -- and we don't if we have no dummy separators at all
|
// from the update region to prevent the toolbar from drawing
|
||||||
return false;
|
// separators in it
|
||||||
}
|
|
||||||
|
|
||||||
// exclude the area occupied by the controls and stretchable spaces from
|
|
||||||
// the update region to prevent the toolbar from drawing separators in it
|
|
||||||
if ( !::ValidateRgn(GetHwnd(), GetHrgnOf(rgnDummySeps)) )
|
if ( !::ValidateRgn(GetHwnd(), GetHrgnOf(rgnDummySeps)) )
|
||||||
{
|
{
|
||||||
wxLogLastError(wxT("ValidateRgn()"));
|
wxLogLastError(wxT("ValidateRgn()"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// still let the native control draw everything else normally but set up a
|
// still let the native control draw everything else normally but set up a
|
||||||
// hook to be able to process the next WM_ERASEBKGND sent to our parent
|
// hook to be able to process the next WM_ERASEBKGND sent to our parent
|
||||||
@@ -1779,11 +1776,14 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam)
|
|||||||
GetParent()->MSWSetEraseBgHook(NULL);
|
GetParent()->MSWSetEraseBgHook(NULL);
|
||||||
|
|
||||||
|
|
||||||
// erase the dummy separators region ourselves now as nobody painted over
|
if ( rgnDummySeps.IsOk() )
|
||||||
// them
|
{
|
||||||
|
// erase the dummy separators region ourselves now as nobody painted
|
||||||
|
// over them
|
||||||
WindowHDC hdc(GetHwnd());
|
WindowHDC hdc(GetHwnd());
|
||||||
::SelectClipRgn(hdc, GetHrgnOf(rgnDummySeps));
|
::SelectClipRgn(hdc, GetHrgnOf(rgnDummySeps));
|
||||||
MSWDoEraseBackground(hdc);
|
MSWDoEraseBackground(hdc);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user