]> git.saurik.com Git - wxWidgets.git/commitdiff
Move notebook size code for mac to mac/notebook.cpp
authorRobert Roebling <robert@roebling.de>
Fri, 11 Jan 2002 14:34:38 +0000 (14:34 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 11 Jan 2002 14:34:38 +0000 (14:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mac/notebook.h
src/common/nbkbase.cpp
src/mac/carbon/notebmac.cpp
src/mac/notebmac.cpp

index 188bde8cfb1be9ec4c7b635397ab4c1746a9fc0a..de06aa8331c5f894d2a82d7c7cdf2520e62d37e3 100644 (file)
@@ -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);
   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
index ccc78efd571a3f26b6bb13e006704ebde51a7ffd..527fcc27db5a4d6f8f8d02c9dca4ef821104936a 100644 (file)
@@ -92,26 +92,15 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage)
     // 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
         sizeTotal.y += 10;
         sizeTotal.y += 10;
-#endif
     }
     else
     {
     }
     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;
-#endif
     }
 
     return sizeTotal;
     }
 
     return sizeTotal;
index aa5351acc5feee1fec3b736217e47f897fcf6734..f9bf5dc99949e4db3b4750f9917789d196542b7b 100644 (file)
@@ -143,6 +143,41 @@ wxNotebook::~wxNotebook()
        m_macControl = NULL ;
 }
 
        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
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxNotebook accessors
 // ----------------------------------------------------------------------------
index aa5351acc5feee1fec3b736217e47f897fcf6734..f9bf5dc99949e4db3b4750f9917789d196542b7b 100644 (file)
@@ -143,6 +143,41 @@ wxNotebook::~wxNotebook()
        m_macControl = NULL ;
 }
 
        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
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxNotebook accessors
 // ----------------------------------------------------------------------------