From 3b60ea2f22359e044a667dcf33e41040f6c97e26 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Mon, 26 Sep 2005 16:20:57 +0000 Subject: [PATCH] Make wxToolBar accept first mouse clicks. That is, clicking on a toolbar tool when the window is inactive will both activate the window and cause the tool to be clicked. TODO: User should be provided a way to override this behavior. The Apple HIG are basically that "dangerous" tools (like delete) should not function on an inactive window. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/toolbar.h | 1 + src/cocoa/toolbar.mm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/wx/cocoa/toolbar.h b/include/wx/cocoa/toolbar.h index da01f719fd..6371c261de 100644 --- a/include/wx/cocoa/toolbar.h +++ b/include/wx/cocoa/toolbar.h @@ -57,6 +57,7 @@ protected: // Cocoa // ------------------------------------------------------------------------ protected: + virtual bool Cocoa_acceptsFirstMouse(bool &acceptsFirstMouse, WX_NSEvent theEvent); virtual bool Cocoa_drawRect(const NSRect &rect); virtual bool Cocoa_mouseDown(WX_NSEvent theEvent); virtual bool Cocoa_mouseDragged(WX_NSEvent theEvent); diff --git a/src/cocoa/toolbar.mm b/src/cocoa/toolbar.mm index 30f61996fd..bf0d2a4d5a 100644 --- a/src/cocoa/toolbar.mm +++ b/src/cocoa/toolbar.mm @@ -221,6 +221,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; -- 2.45.2