don't remember size passed to SetSize() as pending position/size for TLW as deferred move is not used for them
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -458,7 +458,10 @@ protected:
|
|||||||
// this simply moves/resizes the given HWND which is supposed to be our
|
// this simply moves/resizes the given HWND which is supposed to be our
|
||||||
// sibling (this is useful for controls which are composite at MSW level
|
// sibling (this is useful for controls which are composite at MSW level
|
||||||
// and for which DoMoveWindow() is not enough)
|
// and for which DoMoveWindow() is not enough)
|
||||||
void DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height);
|
//
|
||||||
|
// returns true if the window move was deferred, false if it was moved
|
||||||
|
// immediately (no error return)
|
||||||
|
bool DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height);
|
||||||
|
|
||||||
// move the window to the specified location and resize it: this is called
|
// move the window to the specified location and resize it: this is called
|
||||||
// from both DoSetSize() and DoSetClientSize() and would usually just call
|
// from both DoSetSize() and DoSetClientSize() and would usually just call
|
||||||
|
@@ -1567,7 +1567,7 @@ void wxWindowMSW::DoClientToScreen(int *x, int *y) const
|
|||||||
*y = pt.y;
|
*y = pt.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
bool
|
||||||
wxWindowMSW::DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height)
|
wxWindowMSW::DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
#if USE_DEFERRED_SIZING
|
#if USE_DEFERRED_SIZING
|
||||||
@@ -1592,15 +1592,23 @@ wxWindowMSW::DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height)
|
|||||||
parent->m_hDWP = (WXHANDLE)hdwp;
|
parent->m_hDWP = (WXHANDLE)hdwp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise (or if deferring failed) move the window in place immediately
|
if ( hdwp )
|
||||||
if ( !hdwp )
|
|
||||||
#endif // USE_DEFERRED_SIZING
|
|
||||||
{
|
{
|
||||||
if ( !::MoveWindow((HWND)hwnd, x, y, width, height, IsShown()) )
|
// did deferred move, remember new coordinates of the window as they're
|
||||||
{
|
// different from what Windows would return for it
|
||||||
wxLogLastError(wxT("MoveWindow"));
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// otherwise (or if deferring failed) move the window in place immediately
|
||||||
|
#endif // USE_DEFERRED_SIZING
|
||||||
|
if ( !::MoveWindow((HWND)hwnd, x, y, width, height, IsShown()) )
|
||||||
|
{
|
||||||
|
wxLogLastError(wxT("MoveWindow"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// if USE_DEFERRED_SIZING, indicates that we didn't use deferred move,
|
||||||
|
// ignored otherwise
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
|
void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
|
||||||
@@ -1612,7 +1620,13 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
if (height < 0)
|
if (height < 0)
|
||||||
height = 0;
|
height = 0;
|
||||||
|
|
||||||
DoMoveSibling(m_hWnd, x, y, width, height);
|
if ( DoMoveSibling(m_hWnd, x, y, width, height) )
|
||||||
|
{
|
||||||
|
#if USE_DEFERRED_SIZING
|
||||||
|
m_pendingPosition = wxPoint(x, y);
|
||||||
|
m_pendingSize = wxSize(width, height);
|
||||||
|
#endif // USE_DEFERRED_SIZING
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the size of the window: if the dimensions are positive, just use them,
|
// set the size of the window: if the dimensions are positive, just use them,
|
||||||
@@ -1680,8 +1694,6 @@ void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pendingPosition = wxPoint(x, y);
|
|
||||||
m_pendingSize = wxSize(width, height);
|
|
||||||
DoMoveWindow(x, y, width, height);
|
DoMoveWindow(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user