added assert to check that notebook page does have notebook as parent; removed duplicated AddPage()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -91,13 +91,8 @@ public:
|
||||
// ----------
|
||||
// remove all pages
|
||||
bool DeleteAllPages();
|
||||
// adds a new page to the notebook (it will be deleted ny the notebook,
|
||||
// inserts a new page to the notebook (it will be deleted ny the notebook,
|
||||
// don't delete it yourself). If bSelect, this page becomes active.
|
||||
bool AddPage(wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = FALSE,
|
||||
int imageId = -1);
|
||||
// the same as AddPage(), but adds it at the specified position
|
||||
bool InsertPage(int nPage,
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
|
@@ -385,15 +385,6 @@ bool wxNotebook::DeleteAllPages()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// add a page to the notebook
|
||||
bool wxNotebook::AddPage(wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect,
|
||||
int imageId)
|
||||
{
|
||||
return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
|
||||
}
|
||||
|
||||
// same as AddPage() but does it at given position
|
||||
bool wxNotebook::InsertPage(int nPage,
|
||||
wxNotebookPage *pPage,
|
||||
@@ -405,6 +396,8 @@ bool wxNotebook::InsertPage(int nPage,
|
||||
wxCHECK_MSG( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE,
|
||||
_T("invalid index in wxNotebook::InsertPage") );
|
||||
|
||||
wxASSERT_MSG( pPage->GetParent() == this,
|
||||
_T("notebook pages must have notebook as parent") );
|
||||
|
||||
// add a new tab to the control
|
||||
// ----------------------------
|
||||
|
Reference in New Issue
Block a user