]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/toolbar.mm
do take the toolbar into account for Windows CE, otherwise the menus overlap with...
[wxWidgets.git] / src / cocoa / toolbar.mm
index 03b84d6b63ace4e6df73c0cf6661456c52861c06..94407fff8e02913e77c3bbc5f2124ed1802d0411 100644 (file)
@@ -71,9 +71,9 @@ protected:
 
 - (void)wxNSActionCellAction: (id)sender
 {
-    wxLogDebug("wxNSActionCellAction");
+    wxLogTrace(wxTRACE_COCOA,wxT("wxNSActionCellAction"));
     wxCocoaNSActionCell *wxcontrol = wxCocoaNSActionCell::GetFromCocoa(sender);
-    wxCHECK_RET(wxcontrol,"wxNSActionCellAction received but no wxCocoaNSActionCell exists!");
+    wxCHECK_RET(wxcontrol,wxT("wxNSActionCellAction received but no wxCocoaNSActionCell exists!"));
     wxcontrol->CocoaTarget_wxNSActionCellAction();
 }
 
@@ -147,6 +147,8 @@ wxToolBarTool::~wxToolBarTool()
 
 bool wxToolBarTool::CreateButtonCell()
 {
+    wxAutoNSAutoreleasePool pool;
+
     NSImage *nsimage = [m_bmpNormal.GetNSImage(true) retain];
     m_cocoaNSButtonCell = [[NSButtonCell alloc] initTextCell:nil];
     [m_cocoaNSButtonCell setImage:nsimage];
@@ -205,6 +207,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
 void wxToolBar::Init()
 {
     m_owningFrame = NULL;
+    m_mouseDownTool = NULL;
 }
 
 wxToolBar::~wxToolBar()
@@ -294,7 +297,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent)
                 untilMouseUp:NO])
             {
                 m_mouseDownTool = NULL;
-                wxLogDebug("Button was clicked after drag!");
+                wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked after drag!"));
             }
             [buttonCell setHighlighted: NO];
         }
@@ -317,7 +320,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
                 untilMouseUp:NO])
             {
                 m_mouseDownTool = NULL;
-                wxLogDebug("Button was clicked!");
+                wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked!"));
             }
             [buttonCell setHighlighted: NO];
         }
@@ -327,6 +330,8 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
 
 bool wxToolBar::Realize()
 {
+    wxAutoNSAutoreleasePool pool;
+
     wxToolBarToolsList::compatibility_iterator node;
     NSSize totalSize = NSZeroSize;
     // This is for horizontal, TODO: vertical