]> git.saurik.com Git - wxWidgets.git/commitdiff
added assert to check that notebook page does have notebook as parent; removed duplic...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 6 Apr 2003 17:46:48 +0000 (17:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 6 Apr 2003 17:46:48 +0000 (17:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/notebook.h
src/msw/notebook.cpp

index 14ae37fb0eab32dc42e93d34b1f208902774b94f..b6941fe64e4867bc3f449fe217be0cb5bc66eebb 100644 (file)
@@ -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,
index 84c156cb33b547059d71b8b8cb9a7ca2ba8e6170..05b4f2c0b5d0f8c56bce953b7c97820a635dc1c3 100644 (file)
@@ -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
     // ----------------------------