current page bug fix in wxAuiNotebook

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Benjamin Williams
2006-11-21 07:46:24 +00:00
parent 67d6c8cb7e
commit 298773ec33

View File

@@ -2615,6 +2615,12 @@ bool wxAuiNotebook::InsertPage(size_t page_idx,
m_tabs.InsertPage(page, info, page_idx);
// if that was the first page added, even if
// select is false, it must become the "current page"
// (though no select events will be fired)
if (!select && m_tabs.GetPageCount() == 1)
m_curpage = GetPageIndex(page);
wxAuiTabCtrl* active_tabctrl = GetActiveTabCtrl();
if (page_idx >= active_tabctrl->GetPageCount())
active_tabctrl->AddPage(page, info);