Backported size fix for MSW

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20732 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-05-25 17:19:16 +00:00
parent b42599763b
commit e6380ade7a

View File

@@ -92,6 +92,28 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage)
// course, totally bogus - just like the original code was
wxSize sizeTotal = sizePage;
// 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 += 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;
@@ -102,6 +124,7 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage)
sizeTotal.x += 10;
sizeTotal.y += 40;
}
#endif
return sizeTotal;
}