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:
@@ -1512,12 +1512,21 @@ void wxWindowMSW::DoGetClientSize(int *x, int *y) const
|
|||||||
if ( y )
|
if ( y )
|
||||||
*y = rect.bottom;
|
*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
|
// we need to calculate the *pending* client size here
|
||||||
// forward to GetSize() to take into account deferred sizing (which
|
RECT rect;
|
||||||
// wxGetClientRect() doesn't)
|
rect.left = m_pendingPosition.x;
|
||||||
DoGetSize(x, y);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user