git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13506
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
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);
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
/*
// get number of pages in the dialog
// course, totally bogus - just like the original code was
wxSize sizeTotal = 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;
if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
{
sizeTotal.x += 90;
-#ifdef __WXMAC__
- sizeTotal.y += 28;
-#else
-#ifdef __WXMAC__
- sizeTotal.x += 34; // This is OK for Aqua.
- sizeTotal.y += 46;
-#else
sizeTotal.x += 10;
sizeTotal.y += 40;
sizeTotal.x += 10;
sizeTotal.y += 40;
+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
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxNotebook accessors
// ----------------------------------------------------------------------------
+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
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxNotebook accessors
// ----------------------------------------------------------------------------