+ SetSize( CalcSizeFromPage( size ) );
+}
+
+wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
+{
+ wxSize sizeTotal = sizePage;
+ sizeTotal.x += 2 * m_macHorizontalBorder + wxMacTabLeftMargin(GetWindowStyle()) +
+ wxMacTabRightMargin(GetWindowStyle()) ;
+ sizeTotal.y += 2 * m_macVerticalBorder + wxMacTabTopMargin(GetWindowStyle()) +
+ wxMacTabBottomMargin(GetWindowStyle()) ;
+
+ return sizeTotal;
+}
+
+wxSize wxNotebook::DoGetBestSize() const
+{
+ // calculate the max page size
+ wxSize size(0, 0);
+
+ size_t count = GetPageCount();
+ if ( count )
+ {
+ for ( size_t n = 0; n < count; n++ )
+ {
+ wxSize sizePage = m_pages[n]->GetSize();
+
+ if ( size.x < sizePage.x )
+ size.x = sizePage.x;
+ if ( size.y < sizePage.y )
+ size.y = sizePage.y;
+ }
+ }
+ else // no pages
+ {
+ // use some arbitrary default size
+ size.x =
+ size.y = 100;
+ }
+
+ return CalcSizeFromPage(size);