Fix MSW compilation with wxUSE_DEFERRED_SIZING==0.

Add checks for wxUSE_DEFERRED_SIZING around the code using
wxWindow::m_pending{Size,Position}.

Closes #11348.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-07-23 23:33:36 +00:00
parent 568b12fab0
commit 9741fd45f7
2 changed files with 6 additions and 0 deletions

View File

@@ -662,6 +662,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
nShowCmd = SW_HIDE;
}
#if wxUSE_DEFERRED_SIZING
// we only set pending size if we're maximized before being shown, now that
// we're shown we don't need it any more (it is reset in size event handler
// for child windows but we have to do it ourselves for this parent window)
@@ -671,6 +672,7 @@ bool wxTopLevelWindowMSW::Show(bool show)
// them, not the size returned by WM_NCCALCSIZE in DoGetClientSize() which
// turns out to be wrong for maximized windows (see #11762)
m_pendingSize = wxDefaultSize;
#endif // wxUSE_DEFERRED_SIZING
DoShowWindow(nShowCmd);
@@ -701,6 +703,7 @@ void wxTopLevelWindowMSW::Maximize(bool maximize)
// so just remember that we should do it later in this case
m_maximizeOnShow = maximize;
#if wxUSE_DEFERRED_SIZING
// after calling Maximize() the client code expects to get the frame
// "real" size and doesn't want to know that, because of implementation
// details, the frame isn't really maximized yet but will be only once
@@ -718,6 +721,7 @@ void wxTopLevelWindowMSW::Maximize(bool maximize)
m_pendingSize = wxGetClientDisplayRect().GetSize();
}
//else: can't do anything in this case, we don't have the old size
#endif // wxUSE_DEFERRED_SIZING
}
}

View File

@@ -1865,11 +1865,13 @@ void wxWindowMSW::DoGetPosition(int *x, int *y) const
wxWindow * const parent = GetParent();
wxPoint pos;
#if wxUSE_DEFERRED_SIZING
if ( m_pendingPosition != wxDefaultPosition )
{
pos = m_pendingPosition;
}
else // use current position
#endif // wxUSE_DEFERRED_SIZING
{
RECT rect = wxGetWindowRect(GetHwnd());