Correct erasing of background behind controls in a toolbar in wxMSW.

We need to handle WM_PRINTCLIENT in wxToolBar itself as the default handler
for this message forwards to WM_ERASEBKGND of the parent window and our
handler for that message only erases the client part of the window, in wx
sense, i.e. including a relatively big vertical offset accounting for the
toolbar. This means that when we get WM_PRINTCLIENT from the embedded control
drawing code, we don't erase anything at all as the control rectangle height
is smaller than the offset.

This fix is not perfect as ideally the existing MSWGetBgBrushForChild() should
be taken into account automatically by the default MSWPrintChild()
implementation but at least it fixes the ugly visual artefacts.

Closes #12307.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2013-09-04 00:14:37 +00:00
parent c4e9a71a14
commit d9106ec5b6

View File

@ -1948,6 +1948,10 @@ WXLRESULT wxToolBar::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam
return 0;
break;
#endif // wxHAS_MSW_BACKGROUND_ERASE_HOOK
case WM_PRINTCLIENT:
wxFillRect(GetHwnd(), (HDC)wParam, MSWGetToolbarBgBrush());
return 1;
}
return wxControl::MSWWindowProc(nMsg, wParam, lParam);