Move notebook size code for mac to mac/notebook.cpp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
5c92264250
commit
60ec3e58b8
@ -83,6 +83,9 @@ public:
|
||||
virtual void SetPadding(const wxSize& padding);
|
||||
// sets the size of the tabs (assumes all tabs are the same size)
|
||||
virtual void SetTabSize(const wxSize& sz);
|
||||
|
||||
// calculate size for wxNotebookSizer
|
||||
wxSize CalcSizeFromPage(const wxSize& sizePage);
|
||||
|
||||
/*
|
||||
// get number of pages in the dialog
|
||||
|
@ -92,26 +92,15 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage)
|
||||
// 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;
|
||||
|
@ -143,6 +143,41 @@ wxNotebook::~wxNotebook()
|
||||
m_macControl = NULL ;
|
||||
}
|
||||
|
||||
wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage)
|
||||
{
|
||||
wxSize sizeTotal = sizePage;
|
||||
|
||||
int major,minor;
|
||||
wxGetOsVersion( &major, &minor );
|
||||
|
||||
// Mac has large notebook borders. Aqua even more so.
|
||||
|
||||
if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
|
||||
{
|
||||
sizeTotal.x += 90;
|
||||
|
||||
if (major >= 10)
|
||||
sizeTotal.y += 28;
|
||||
else
|
||||
sizeTotal.y += 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (major >= 10)
|
||||
{
|
||||
sizeTotal.x += 34;
|
||||
sizeTotal.y += 46;
|
||||
}
|
||||
else
|
||||
{
|
||||
sizeTotal.x += 22;
|
||||
sizeTotal.y += 44;
|
||||
}
|
||||
}
|
||||
|
||||
return sizeTotal;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -143,6 +143,41 @@ wxNotebook::~wxNotebook()
|
||||
m_macControl = NULL ;
|
||||
}
|
||||
|
||||
wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage)
|
||||
{
|
||||
wxSize sizeTotal = sizePage;
|
||||
|
||||
int major,minor;
|
||||
wxGetOsVersion( &major, &minor );
|
||||
|
||||
// Mac has large notebook borders. Aqua even more so.
|
||||
|
||||
if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
|
||||
{
|
||||
sizeTotal.x += 90;
|
||||
|
||||
if (major >= 10)
|
||||
sizeTotal.y += 28;
|
||||
else
|
||||
sizeTotal.y += 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (major >= 10)
|
||||
{
|
||||
sizeTotal.x += 34;
|
||||
sizeTotal.y += 46;
|
||||
}
|
||||
else
|
||||
{
|
||||
sizeTotal.x += 22;
|
||||
sizeTotal.y += 44;
|
||||
}
|
||||
}
|
||||
|
||||
return sizeTotal;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook accessors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user