]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toolbar.cpp
adding a peer pointing back to wxWindow
[wxWidgets.git] / src / mac / carbon / toolbar.cpp
index 1df959231d5d48c0d66dd5c65c54a85b3a2d474c..cdefd9ccbb619587c77bd77afbde50855b0806cb 100644 (file)
@@ -99,8 +99,10 @@ public:
         {
             // separator size
             wxSize sz = GetToolBar()->GetToolSize() ;
-            sz.x /= 4 ;
-            sz.y /= 4 ;
+            if ( GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL )
+                sz.y /= 4 ;
+            else
+                sz.x /= 4 ;
             return sz ;
         }
     }
@@ -147,7 +149,11 @@ static pascal OSStatus wxMacToolBarToolControlEventHandler( EventHandlerCallRef
                 wxToolBarTool* tbartool = (wxToolBarTool*)data ;
                 if ( tbartool->CanBeToggled() )
                 {
+#ifdef __WXMAC_OSX__
+                    ((wxToolBar*)tbartool->GetToolBar())->ToggleTool(tbartool->GetId(), !tbartool->IsToggled() );
+#else
                     ((wxToolBar*)tbartool->GetToolBar())->ToggleTool(tbartool->GetId(), GetControl32BitValue((ControlRef)tbartool->GetControlHandle()));
+#endif
                 }
                 ((wxToolBar*)tbartool->GetToolBar())->OnLeftClick( tbartool->GetId() , tbartool -> IsToggled() ) ;
                 result = noErr;