use WM_NCCALCSIZE in DoGetClientSize() if the window has deferred size, even if it's toplevel
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1567,6 +1567,7 @@ bool wxWindowMSW::IsSizeDeferred() const
|
|||||||
// Get total size
|
// Get total size
|
||||||
void wxWindowMSW::DoGetSize(int *x, int *y) const
|
void wxWindowMSW::DoGetSize(int *x, int *y) const
|
||||||
{
|
{
|
||||||
|
#if USE_DEFERRED_SIZING
|
||||||
// if SetSize() had been called at wx level but not realized at Windows
|
// if SetSize() had been called at wx level but not realized at Windows
|
||||||
// level yet (i.e. EndDeferWindowPos() not called), we still should return
|
// level yet (i.e. EndDeferWindowPos() not called), we still should return
|
||||||
// the new and not the old position to the other wx code
|
// the new and not the old position to the other wx code
|
||||||
@@ -1578,6 +1579,7 @@ void wxWindowMSW::DoGetSize(int *x, int *y) const
|
|||||||
*y = m_pendingSize.y;
|
*y = m_pendingSize.y;
|
||||||
}
|
}
|
||||||
else // use current size
|
else // use current size
|
||||||
|
#endif // USE_DEFERRED_SIZING
|
||||||
{
|
{
|
||||||
RECT rect = wxGetWindowRect(GetHwnd());
|
RECT rect = wxGetWindowRect(GetHwnd());
|
||||||
|
|
||||||
@@ -1592,21 +1594,9 @@ void wxWindowMSW::DoGetSize(int *x, int *y) const
|
|||||||
void wxWindowMSW::DoGetClientSize(int *x, int *y) const
|
void wxWindowMSW::DoGetClientSize(int *x, int *y) const
|
||||||
{
|
{
|
||||||
#if USE_DEFERRED_SIZING
|
#if USE_DEFERRED_SIZING
|
||||||
if ( IsTopLevel() || m_pendingSize == wxDefaultSize )
|
if ( m_pendingSize != wxDefaultSize )
|
||||||
#endif
|
|
||||||
{ // top level windows resizing is never deferred, so we can safely use
|
|
||||||
// the current size here
|
|
||||||
RECT rect = wxGetClientRect(GetHwnd());
|
|
||||||
|
|
||||||
if ( x )
|
|
||||||
*x = rect.right;
|
|
||||||
if ( y )
|
|
||||||
*y = rect.bottom;
|
|
||||||
}
|
|
||||||
#if USE_DEFERRED_SIZING
|
|
||||||
else // non top level and using deferred sizing
|
|
||||||
{
|
{
|
||||||
// we need to calculate the *pending* client size here
|
// we need to calculate the client size corresponding to pending size
|
||||||
RECT rect;
|
RECT rect;
|
||||||
rect.left = m_pendingPosition.x;
|
rect.left = m_pendingPosition.x;
|
||||||
rect.top = m_pendingPosition.y;
|
rect.top = m_pendingPosition.y;
|
||||||
@@ -1620,7 +1610,16 @@ void wxWindowMSW::DoGetClientSize(int *x, int *y) const
|
|||||||
if ( y )
|
if ( y )
|
||||||
*y = rect.bottom - rect.top;
|
*y = rect.bottom - rect.top;
|
||||||
}
|
}
|
||||||
#endif
|
else
|
||||||
|
#endif // USE_DEFERRED_SIZING
|
||||||
|
{
|
||||||
|
RECT rect = wxGetClientRect(GetHwnd());
|
||||||
|
|
||||||
|
if ( x )
|
||||||
|
*x = rect.right;
|
||||||
|
if ( y )
|
||||||
|
*y = rect.bottom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMSW::DoGetPosition(int *x, int *y) const
|
void wxWindowMSW::DoGetPosition(int *x, int *y) const
|
||||||
|
Reference in New Issue
Block a user