No real changes, just change type of MSWGetBgBrush() argument.

Pass wxWindow instead of HWND to it as in most cases we already have wxWindow
for the HWND we have and calling wxFindWinFromHandle() once more is
unnecessary.

This also makes the code of MSWGetBgBrushForChild() slightly simpler.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-12-18 20:49:23 +00:00
parent b93051ef46
commit b8797d96ca
6 changed files with 21 additions and 22 deletions

View File

@@ -4816,7 +4816,7 @@ bool wxWindowMSW::DoEraseBackground(WXHDC hDC)
}
WXHBRUSH
wxWindowMSW::MSWGetBgBrushForChild(WXHDC WXUNUSED(hDC), WXHWND hWnd)
wxWindowMSW::MSWGetBgBrushForChild(WXHDC WXUNUSED(hDC), wxWindowMSW *child)
{
if ( m_hasBgCol )
{
@@ -4828,11 +4828,10 @@ wxWindowMSW::MSWGetBgBrushForChild(WXHDC WXUNUSED(hDC), WXHWND hWnd)
// children because it would look wrong if a child of non
// transparent child would show our bg colour when the child itself
// does not
wxWindow *win = wxFindWinFromHandle(hWnd);
if ( win == this ||
if ( child == this ||
m_inheritBgCol ||
(win && win->HasTransparentBackground() &&
win->GetParent() == this) )
(child->HasTransparentBackground() &&
child->GetParent() == this) )
{
// draw children with the same colour as the parent
wxBrush *
@@ -4845,14 +4844,11 @@ wxWindowMSW::MSWGetBgBrushForChild(WXHDC WXUNUSED(hDC), WXHWND hWnd)
return 0;
}
WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC, WXHWND hWndToPaint)
WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC, wxWindowMSW *child)
{
if ( !hWndToPaint )
hWndToPaint = GetHWND();
for ( wxWindowMSW *win = this; win; win = win->GetParent() )
{
WXHBRUSH hBrush = win->MSWGetBgBrushForChild(hDC, hWndToPaint);
WXHBRUSH hBrush = win->MSWGetBgBrushForChild(hDC, child);
if ( hBrush )
return hBrush;