Reverted last change. The page size must be set when it is added in

case the notebook has already been sized by the time the new page is
added.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-10-16 22:48:18 +00:00
parent d3a5c14ab4
commit a5b317c973

View File

@@ -433,6 +433,13 @@ bool wxNotebook::InsertPage(int nPage,
// this updates internal flag too - otherwise it will get out of sync // this updates internal flag too - otherwise it will get out of sync
pPage->Show(FALSE); pPage->Show(FALSE);
// fit the notebook page to the tab control's display area
RECT rc;
rc.left = rc.top = 0;
GetSize((int *)&rc.right, (int *)&rc.bottom);
TabCtrl_AdjustRect(m_hwnd, FALSE, &rc);
pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);
// some page should be selected: either this one or the first one if there is // some page should be selected: either this one or the first one if there is
// still no selection // still no selection
int selNew = -1; int selNew = -1;