]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/notebook.cpp
Use lib64 for 64-bit builds on some kinds of linux and lib/64 on solaris
[wxWidgets.git] / src / generic / notebook.cpp
index 69f7bdd794c5c6a45ca270fc3547a06aaaf66e8e..71072898ffd0e7209e30cea7cf18dc91d8b58505 100644 (file)
@@ -47,7 +47,7 @@
 // ----------------------------------------------------------------------------
 
 // check that the page index is valid
-#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount()))
+#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount())
 
 // ----------------------------------------------------------------------------
 // event table
@@ -304,7 +304,7 @@ bool wxNotebook::RemovePage(size_t nPage)
 // remove one page from the notebook
 wxWindow* wxNotebook::DoRemovePage(size_t nPage)
 {
-    wxCHECK( IS_VALID_PAGE(nPage), false );
+    wxCHECK( IS_VALID_PAGE(nPage), NULL );
 
     m_pages[nPage]->Show(false);
     //    m_pages[nPage]->Lower();
@@ -622,6 +622,17 @@ void wxNotebook::OnPaint(wxPaintEvent& WXUNUSED(event) )
         m_tabView->Draw(dc);
 }
 
+wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
+{
+    // MBN: since the total tab height is really a function of the
+    // width, this should really call
+    // GetTotalTabHeightPretendingWidthIs(), but the current
+    // implementation will suffice, provided the wxNotebook has been
+    // created with a sensible initial width.
+    return wxSize( sizePage.x + 12,
+                   sizePage.y + m_tabView->GetTotalTabHeight() + 6 + 4 );
+}
+
 wxRect wxNotebook::GetAvailableClientSize()
 {
     int cw, ch;