Moved the pending pos and size into wxWindowMSW
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -494,6 +494,11 @@ private:
|
|||||||
// current defer window position operation handle (may be NULL)
|
// current defer window position operation handle (may be NULL)
|
||||||
WXHANDLE m_hDWP;
|
WXHANDLE m_hDWP;
|
||||||
|
|
||||||
|
// When deferred positioning is done these hold the pending changes, and
|
||||||
|
// are used for the default values if another size/pos changes is done on
|
||||||
|
// this window before the group of deferred changes is completed.
|
||||||
|
wxPoint m_pendingPosition;
|
||||||
|
wxSize m_pendingSize;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindowMSW)
|
DECLARE_DYNAMIC_CLASS(wxWindowMSW)
|
||||||
DECLARE_NO_COPY_CLASS(wxWindowMSW)
|
DECLARE_NO_COPY_CLASS(wxWindowMSW)
|
||||||
|
@@ -231,28 +231,6 @@ bool GetCursorPosWinCE(POINT* pt)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// wxWindowExtraData
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#if USE_DEFER_BUG_WORKAROUND
|
|
||||||
// This class is used to hold additional data memebers that were added after
|
|
||||||
// the stable 2.6.0 release. They should be moved into wxWindow for 2.7 after
|
|
||||||
// binary compatibility is no longer being maintained.
|
|
||||||
|
|
||||||
class wxWindowExtraData {
|
|
||||||
public:
|
|
||||||
wxWindowExtraData()
|
|
||||||
: m_pendingPosition(wxDefaultPosition),
|
|
||||||
m_pendingSize(wxDefaultSize)
|
|
||||||
{}
|
|
||||||
|
|
||||||
wxPoint m_pendingPosition;
|
|
||||||
wxSize m_pendingSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// event tables
|
// event tables
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -488,9 +466,8 @@ void wxWindowMSW::Init()
|
|||||||
m_lastMouseEvent = -1;
|
m_lastMouseEvent = -1;
|
||||||
#endif // wxUSE_MOUSEEVENT_HACK
|
#endif // wxUSE_MOUSEEVENT_HACK
|
||||||
|
|
||||||
#if USE_DEFER_BUG_WORKAROUND
|
m_pendingPosition = wxDefaultPosition;
|
||||||
m_extraData = new wxWindowExtraData;
|
m_pendingSize = wxDefaultSize;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
@@ -539,9 +516,6 @@ wxWindowMSW::~wxWindowMSW()
|
|||||||
|
|
||||||
delete m_childrenDisabled;
|
delete m_childrenDisabled;
|
||||||
|
|
||||||
#if USE_DEFER_BUG_WORKAROUND
|
|
||||||
delete m_extraData;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// real construction (Init() must have been called before!)
|
// real construction (Init() must have been called before!)
|
||||||
@@ -1612,19 +1586,19 @@ void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
int currentW, currentH;
|
int currentW, currentH;
|
||||||
|
|
||||||
#if USE_DEFER_BUG_WORKAROUND
|
#if USE_DEFER_BUG_WORKAROUND
|
||||||
currentX = m_extraData->m_pendingPosition.x;
|
currentX = m_pendingPosition.x;
|
||||||
if (currentX == wxDefaultCoord)
|
if (currentX == wxDefaultCoord)
|
||||||
GetPosition(¤tX, NULL);
|
GetPosition(¤tX, NULL);
|
||||||
|
|
||||||
currentY = m_extraData->m_pendingPosition.y;
|
currentY = m_pendingPosition.y;
|
||||||
if (currentY == wxDefaultCoord)
|
if (currentY == wxDefaultCoord)
|
||||||
GetPosition(NULL, ¤tY);
|
GetPosition(NULL, ¤tY);
|
||||||
|
|
||||||
currentW = m_extraData->m_pendingSize.x;
|
currentW = m_pendingSize.x;
|
||||||
if (currentW == wxDefaultCoord)
|
if (currentW == wxDefaultCoord)
|
||||||
GetSize(¤tW, NULL);
|
GetSize(¤tW, NULL);
|
||||||
|
|
||||||
currentH = m_extraData->m_pendingSize.y;
|
currentH = m_pendingSize.y;
|
||||||
if (currentH == wxDefaultCoord)
|
if (currentH == wxDefaultCoord)
|
||||||
GetSize(NULL, ¤tH);
|
GetSize(NULL, ¤tH);
|
||||||
#else
|
#else
|
||||||
@@ -1688,13 +1662,13 @@ void wxWindowMSW::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
HDWP hdwp = GetParent() && !IsTopLevel() ? (HDWP)GetParent()->m_hDWP : NULL;
|
HDWP hdwp = GetParent() && !IsTopLevel() ? (HDWP)GetParent()->m_hDWP : NULL;
|
||||||
if (hdwp)
|
if (hdwp)
|
||||||
{
|
{
|
||||||
m_extraData->m_pendingPosition = wxPoint(x, y);
|
m_pendingPosition = wxPoint(x, y);
|
||||||
m_extraData->m_pendingSize = wxSize(width, height);
|
m_pendingSize = wxSize(width, height);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_extraData->m_pendingPosition = wxDefaultPosition;
|
m_pendingPosition = wxDefaultPosition;
|
||||||
m_extraData->m_pendingSize = wxDefaultSize;
|
m_pendingSize = wxDefaultSize;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -4312,8 +4286,8 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
|
|||||||
node = node->GetNext() )
|
node = node->GetNext() )
|
||||||
{
|
{
|
||||||
wxWindow *child = node->GetData();
|
wxWindow *child = node->GetData();
|
||||||
child->m_extraData->m_pendingPosition = wxDefaultPosition;
|
child->m_pendingPosition = wxDefaultPosition;
|
||||||
child->m_extraData->m_pendingSize = wxDefaultSize;
|
child->m_pendingSize = wxDefaultSize;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user