Account for scrolling when setting the background brush origin in wxMSW.

We must use physical coordinates for the brush origin to account for the
coordinates offset in scrolled windows, so add MSWAdjustBrushOrg() and call it
from MSWGetBgBrushForChild().

Closes #14917.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-02-10 16:14:03 +00:00
parent 2aee45f63a
commit 208717f64e
3 changed files with 23 additions and 2 deletions

View File

@@ -410,6 +410,17 @@ public:
// weird wxToolBar case and MSWGetBgBrushForChild() itself is used by
// MSWGetBgBrush() to actually find the right brush to use.
// Adjust the origin for the brush returned by MSWGetBgBrushForChild().
//
// This needs to be overridden for scrolled windows to ensure that the
// scrolling of their associated DC is taken into account.
//
// Both parameters must be non-NULL.
virtual void MSWAdjustBrushOrg(int* WXUNUSED(xOrg),
int* WXUNUSED(yOrg)) const
{
}
// The brush returned from here must remain valid at least until the next
// event loop iteration. Returning 0, as is done by default, indicates
// there is no custom background brush.