]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/notebook.cpp
Improve sizer support in generic wxNotebook. Fix the widgets sample
[wxWidgets.git] / src / generic / notebook.cpp
index 11b4abfe09bc52e2d3295edc925ea6c659f0238d..ec05ba70b4f967934ca7f60f86bcf3e5c9657ec2 100644 (file)
@@ -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;