X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7dafb55fdec4ef71567ee1ccbf16d4461df8198f..f8b2997476e15b63f1699b9f7b6f1db2ae6b440c:/src/cocoa/toolbar.mm diff --git a/src/cocoa/toolbar.mm b/src/cocoa/toolbar.mm index 03b84d6b63..6ad048346d 100644 --- a/src/cocoa/toolbar.mm +++ b/src/cocoa/toolbar.mm @@ -6,7 +6,7 @@ // Created: 2003/08/17 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -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