]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/toolbar.mm
Fix link errors under Cygwin with wxUSE_GRAPHICS_CONTEXT==1.
[wxWidgets.git] / src / osx / cocoa / toolbar.mm
index 30858e2119911736f0d39e4083984f3cd4672420..41d923efad1904822f40f06d2d23e3f1cccf1736 100644 (file)
@@ -218,7 +218,17 @@ public:
     {
         wxToolBarToolBase::SetLabel(label);
         UpdateLabel();
-     }
+    }
+
+    virtual bool SetShortHelp(const wxString& help)
+    {
+        if ( !wxToolBarToolBase::SetShortHelp(help) )
+            return false;
+
+        UpdateLabel();
+
+        return true;
+    }
 #endif // wxOSX_USE_NATIVE_TOOLBAR
 
 private:
@@ -506,7 +516,7 @@ void wxToolBarTool::UpdateImages()
         dc.SelectObject( m_alternateBitmap );
         dc.SetPen( wxPen(*wxBLACK) );
         dc.SetBrush( wxBrush( *wxLIGHT_GREY ));
-        dc.DrawRectangle( 0, 0, w, h );
+        dc.DrawRoundedRectangle( 0, 0, w, h, 2 );
         dc.DrawBitmap( m_bmpNormal, 0, 0, true );
         dc.SelectObject( wxNullBitmap );
 
@@ -527,7 +537,11 @@ void wxToolBarTool::UpdateToggleImage( bool toggle )
         else
             [m_toolbarItem setImage:m_bmpNormal.GetNSImage()];
     }
+    else
 #endif
+    {
+        [(NSButton*)m_controlHandle setState:(toggle ? NSOnState : NSOffState)];
+    }
 }
 
 wxToolBarTool::wxToolBarTool(
@@ -973,7 +987,7 @@ bool wxToolBar::Realize()
                     }
 
                     wxCFStringRef cfidentifier;
-                    const NSString *nsItemId;
+                    NSString *nsItemId;
                     if (tool->GetStyle() == wxTOOL_STYLE_SEPARATOR)
                     {
                         nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier
@@ -1235,8 +1249,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
 #if wxOSX_USE_NATIVE_TOOLBAR
                 if (m_macToolbar != NULL)
                 {
-                    const NSString * const
-                        nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier
+                    NSString * nsItemId = tool->IsStretchable() ? NSToolbarFlexibleSpaceItemIdentifier
                                                          : NSToolbarSeparatorItemIdentifier;
                     NSToolbarItem* item = [[NSToolbarItem alloc] initWithItemIdentifier:nsItemId];
                     tool->SetToolbarItemRef( item );
@@ -1258,7 +1271,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
 
                 [v setBezelStyle:NSRegularSquareBezelStyle];
                 [v setBordered:NO];
-                [v setButtonType: ( tool->CanBeToggled() ? NSOnOffButton : NSMomentaryPushInButton )];
+                [v setButtonType: ( tool->CanBeToggled() ? NSToggleButton : NSMomentaryPushInButton )];
                 [v setImplementation:tool];
 
                 controlHandle = v;