]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/toolbar.mm
use wxChar correctly in wxString docs; mark wx1 compatibility functions
[wxWidgets.git] / src / cocoa / toolbar.mm
index 3688f0e7b370c308b9b26dd7d5d068e05c3bb6c1..b831696cfe323cd41a3ce6ac6c560d800ef1cccc 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     2003/08/17
 // RCS-ID:      $Id$
 // Copyright:   (c) 2003 David Elliott
-// Licence:    wxWidgets licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 #include "wx/wxprec.h"
 
 #if wxUSE_TOOLBAR_NATIVE
+
+#include "wx/toolbar.h"
+
 #ifndef WX_PRECOMP
-    #include "wx/toolbar.h"
     #include "wx/frame.h"
     #include "wx/log.h"
 #endif // WX_PRECOMP
@@ -221,6 +223,11 @@ bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
     return true;
 }
 
+bool wxToolBar::Cocoa_acceptsFirstMouse(bool &acceptsFirstMouse, WX_NSEvent theEvent)
+{
+    acceptsFirstMouse = true; return true;
+}
+
 bool wxToolBar::Cocoa_drawRect(const NSRect &rect)
 {
     wxToolBarToolsList::compatibility_iterator node;
@@ -253,6 +260,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent)
         NSButtonCell *buttonCell = m_mouseDownTool->GetNSButtonCell();
         if(buttonCell)
         {
+            [buttonCell retain];
             [buttonCell setHighlighted: YES];
             if([buttonCell trackMouse: theEvent
                 inRect:AddToolPadding(m_mouseDownTool->GetFrameRect()) ofView:m_cocoaNSView
@@ -263,6 +271,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent)
                 wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked after drag!"));
             }
             [buttonCell setHighlighted: NO];
+            [buttonCell release];
         }
     }
     return wxToolBarBase::Cocoa_mouseDragged(theEvent);
@@ -276,6 +285,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
         NSButtonCell *buttonCell = tool->GetNSButtonCell();
         if(buttonCell)
         {
+            [buttonCell retain];
             m_mouseDownTool = tool;
             [buttonCell setHighlighted: YES];
             if([buttonCell trackMouse: theEvent
@@ -287,6 +297,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
                 wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked!"));
             }
             [buttonCell setHighlighted: NO];
+            [buttonCell release];
         }
     }
     return wxToolBarBase::Cocoa_mouseDown(theEvent);