]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixing compilation on Mac, and attempting to better calculate the bottom position...
authorKevin Ollivier <kevino@theolliviers.com>
Mon, 18 Sep 2006 02:39:36 +0000 (02:39 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Mon, 18 Sep 2006 02:39:36 +0000 (02:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/frame.cpp

index b327bfa9bfcfad096822d7a0f7881140d0b04cfa..47d8fd32cb8c3b3695dc0c345e1ed4e8c0554f12 100644 (file)
@@ -345,11 +345,11 @@ void wxFrame::PositionToolBar()
 
     GetSize( &cw , &ch ) ;
 
+    int statusX, statusY;
+    GetStatusBar()->GetClientSize(&statusX, &statusY);
+            
     if (GetStatusBar() && GetStatusBar()->IsShown())
     {
-        int statusX, statusY;
-
-        GetStatusBar()->GetClientSize(&statusX, &statusY);
         ch -= statusY;
     }
 
@@ -366,11 +366,14 @@ void wxFrame::PositionToolBar()
             // have the original client size.
             GetToolBar()->SetSize(tx , ty , tw, ch , wxSIZE_NO_ADJUSTMENTS );
         }
-        else if (GetToolBar->GetWindowStyleFlag() & wxTB_BOTTOM)
+        else if (GetToolBar()->GetWindowStyleFlag() & wxTB_BOTTOM)
         {
+            //FIXME: this positions the tool bar almost correctly, but still it doesn't work right yet,
+            //as 1) the space for the 'old' top toolbar is still taken up, and 2) the toolbar
+            //doesn't extend it's width to the width of the frame.
             tx = 0;
-            ty = statusY - th;
-                        GetToolBar->SetSize(tx, ty, cw, th, wxSIZE_NO_ADJUSTMENTS );
+            ty = ch - (th + statusY);
+            GetToolBar()->SetSize(tx, ty, cw, th, wxSIZE_NO_ADJUSTMENTS );
         }
         else
         {