X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c768ded54ac51711ad6e62c3c802b382a1965eec..303313165165302d5f95b234a79c83413ec9c8c8:/src/common/nbkbase.cpp diff --git a/src/common/nbkbase.cpp b/src/common/nbkbase.cpp index 29a24d0a8b..fa4db5f419 100644 --- a/src/common/nbkbase.cpp +++ b/src/common/nbkbase.cpp @@ -36,6 +36,16 @@ #include "wx/imaglist.h" #include "wx/notebook.h" +#ifdef __GNUWIN32_OLD__ + #include "wx/msw/gnuwin32/extra.h" +#endif + +#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__)) +#include "wx/msw/private.h" +#include +#include "wx/msw/winundef.h" +#endif + // ============================================================================ // implementation // ============================================================================ @@ -92,26 +102,39 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) // course, totally bogus - just like the original code was wxSize sizeTotal = sizePage; - // Mac has large notebook borders. - + // Slightly less bogus, at least under Windows. + // We need to make getting tab size part of the wxWindows API. +#ifdef __WXMSW__ + wxSize tabSize(0, 0); + if (GetPageCount() > 0) + { + RECT rect; + TabCtrl_GetItemRect((HWND) GetHWND(), 0, & rect); + tabSize.x = rect.right - rect.left; + tabSize.y = rect.bottom - rect.top; + } if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) ) { - sizeTotal.x += 90; -#ifdef __WXMAC__ - sizeTotal.y += 20; + sizeTotal.x += tabSize.x + 7; + sizeTotal.y += 7; + } + else + { + sizeTotal.x += 7; + sizeTotal.y += tabSize.y + 7; + } #else + if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) ) + { + sizeTotal.x += 90; sizeTotal.y += 10; -#endif } else { -#ifdef __WXMAC__ - sizeTotal.x += 32; // This is OK for Aqua. -#else sizeTotal.x += 10; -#endif sizeTotal.y += 40; } +#endif return sizeTotal; }