X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07b8d7ecc39cfc6cce17156b91c6de1cfb56ce5b..88594d02eb59a55ac85d3210a49d02918124617b:/src/common/nbkbase.cpp?ds=inline diff --git a/src/common/nbkbase.cpp b/src/common/nbkbase.cpp index da418151d9..ccc78efd57 100644 --- a/src/common/nbkbase.cpp +++ b/src/common/nbkbase.cpp @@ -31,10 +31,11 @@ #if wxUSE_NOTEBOOK #ifndef WX_PRECOMP - #include "wx/notebook.h" - #include "wx/imaglist.h" #endif //WX_PRECOMP +#include "wx/imaglist.h" +#include "wx/notebook.h" + // ============================================================================ // implementation // ============================================================================ @@ -90,10 +91,28 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) // this was just taken from wxNotebookSizer::CalcMin() and is, of // course, totally bogus - just like the original code was wxSize sizeTotal = sizePage; + + // Mac has large notebook borders. + if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) ) + { sizeTotal.x += 90; +#ifdef __WXMAC__ + sizeTotal.y += 28; +#else + sizeTotal.y += 10; +#endif + } else + { +#ifdef __WXMAC__ + sizeTotal.x += 34; // This is OK for Aqua. + sizeTotal.y += 46; +#else + sizeTotal.x += 10; sizeTotal.y += 40; +#endif + } return sizeTotal; } @@ -113,6 +132,17 @@ bool wxNotebookBase::DeletePage(int nPage) return TRUE; } +wxNotebookPage *wxNotebookBase::DoRemovePage(int nPage) +{ + wxCHECK_MSG( nPage >= 0 && (size_t)nPage < m_pages.GetCount(), NULL, + _T("invalid page index in wxNotebookBase::DoRemovePage()") ); + + wxNotebookPage *pageRemoved = m_pages[nPage]; + m_pages.RemoveAt(nPage); + + return pageRemoved; +} + int wxNotebookBase::GetNextPage(bool forward) const { int nPage;