return pending position/size if any, not the current one

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-07-30 00:02:55 +00:00
parent 7d86a2d45c
commit 11cfa8ef8d

View File

@@ -1453,17 +1453,32 @@ void wxWindowMSW::DoSetToolTip(wxToolTip *tooltip)
// Get total size // Get total size
void wxWindowMSW::DoGetSize(int *x, int *y) const void wxWindowMSW::DoGetSize(int *x, int *y) const
{ {
// if SetSize() had been called at wx level but not realized at Windows
// level yet (i.e. EndDeferWindowPos() not called), we still should return
// the new and not the old position to the other wx code
if ( m_pendingSize != wxDefaultSize )
{
if ( x )
*x = m_pendingSize.x;
if ( y )
*y = m_pendingSize.y;
}
else // use current size
{
RECT rect = wxGetWindowRect(GetHwnd()); RECT rect = wxGetWindowRect(GetHwnd());
if ( x ) if ( x )
*x = rect.right - rect.left; *x = rect.right - rect.left;
if ( y ) if ( y )
*y = rect.bottom - rect.top; *y = rect.bottom - rect.top;
}
} }
// Get size *available for subwindows* i.e. excluding menu bar etc. // Get size *available for subwindows* i.e. excluding menu bar etc.
void wxWindowMSW::DoGetClientSize(int *x, int *y) const void wxWindowMSW::DoGetClientSize(int *x, int *y) const
{ {
// this is only for top level windows whose resizing is never deferred, so
// we can safely use the current size here
RECT rect = wxGetClientRect(GetHwnd()); RECT rect = wxGetClientRect(GetHwnd());
if ( x ) if ( x )
@@ -1474,6 +1489,15 @@ void wxWindowMSW::DoGetClientSize(int *x, int *y) const
void wxWindowMSW::DoGetPosition(int *x, int *y) const void wxWindowMSW::DoGetPosition(int *x, int *y) const
{ {
if ( m_pendingPosition != wxDefaultPosition )
{
if ( x )
*x = m_pendingPosition.x;
if ( y )
*y = m_pendingPosition.y;
}
else // use current position
{
RECT rect = wxGetWindowRect(GetHwnd()); RECT rect = wxGetWindowRect(GetHwnd());
POINT point; POINT point;
@@ -1510,6 +1534,7 @@ void wxWindowMSW::DoGetPosition(int *x, int *y) const
*x = point.x; *x = point.x;
if ( y ) if ( y )
*y = point.y; *y = point.y;
}
} }
void wxWindowMSW::DoScreenToClient(int *x, int *y) const void wxWindowMSW::DoScreenToClient(int *x, int *y) const