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
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);