Make wxToolBar accept first mouse clicks. That is, clicking on a toolbar
authorDavid Elliott <dfe@tgwbd.org>
Mon, 26 Sep 2005 16:20:57 +0000 (16:20 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Mon, 26 Sep 2005 16:20:57 +0000 (16:20 +0000)
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
src/cocoa/toolbar.mm

index da01f719fd25abad5706ab3acf29a195dbd825a0..6371c261de0c16312195fe85fb9294f4c26a6f78 100644 (file)
@@ -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);
index 30f61996fdff22b38d4408ab876a1ca1936f6913..bf0d2a4d5a3d370d1e44989b5b5a75c0bf094399 100644 (file)
@@ -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;