Calculate correct client size for windows that are using deferred sizing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jamie Gadd
2006-01-25 23:40:20 +00:00
parent 208458a7f5
commit dc497201eb

View File

@@ -1512,12 +1512,21 @@ void wxWindowMSW::DoGetClientSize(int *x, int *y) const
if ( y )
*y = rect.bottom;
}
else // non top level
else // non top level and using deferred sizing
{
// size is the same as client size for non top level windows, so
// forward to GetSize() to take into account deferred sizing (which
// wxGetClientRect() doesn't)
DoGetSize(x, y);
// we need to calculate the *pending* client size here
RECT rect;
rect.left = m_pendingPosition.x;
rect.top = m_pendingPosition.y;
rect.right = rect.left + m_pendingSize.x;
rect.bottom = rect.top + m_pendingSize.y;
::SendMessage(GetHwnd(), WM_NCCALCSIZE, FALSE, (LPARAM)&rect);
if ( x )
*x = rect.right - rect.left;
if ( y )
*y = rect.bottom - rect.top;
}
}