Explicitly trigger wxNotebook layout in wxMSW to ensure it is correct.

Due to an apparent bug in the native control implementation, space could be
reserved for the second row of tabs even when the notebook was big enough to
need it. Sending it an extra WM_SIZE seems to be enough to fix this.

Closes #1792.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2013-03-31 01:12:15 +00:00
parent 6b33db8f56
commit 80ceadc165

View File

@ -736,6 +736,14 @@ bool wxNotebook::InsertPage(size_t nPage,
if ( m_pages.GetCount() == 1 || HasFlag(wxNB_MULTILINE) )
{
AdjustPageSize(pPage);
// Additionally, force the layout of the notebook itself by posting a
// size event to it. If we don't do it, notebooks with pages on the
// left or the right side may fail to account for the fact that they
// are now big enough to fit all all of their pages on one row and
// still reserve space for the second row of tabs, see #1792.
const wxSize s = GetSize();
::PostMessage(GetHwnd(), WM_SIZE, SIZE_RESTORED, MAKELPARAM(s.x, s.y));
}
// now deal with the selection