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
This commit is contained in:
David Elliott
2005-09-26 16:20:57 +00:00
parent acb96ac277
commit 3b60ea2f22
2 changed files with 6 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ protected:
// Cocoa // Cocoa
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
protected: protected:
virtual bool Cocoa_acceptsFirstMouse(bool &acceptsFirstMouse, WX_NSEvent theEvent);
virtual bool Cocoa_drawRect(const NSRect &rect); virtual bool Cocoa_drawRect(const NSRect &rect);
virtual bool Cocoa_mouseDown(WX_NSEvent theEvent); virtual bool Cocoa_mouseDown(WX_NSEvent theEvent);
virtual bool Cocoa_mouseDragged(WX_NSEvent theEvent); virtual bool Cocoa_mouseDragged(WX_NSEvent theEvent);

View File

@@ -221,6 +221,11 @@ bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
return true; return true;
} }
bool wxToolBar::Cocoa_acceptsFirstMouse(bool &acceptsFirstMouse, WX_NSEvent theEvent)
{
acceptsFirstMouse = true; return true;
}
bool wxToolBar::Cocoa_drawRect(const NSRect &rect) bool wxToolBar::Cocoa_drawRect(const NSRect &rect)
{ {
wxToolBarToolsList::compatibility_iterator node; wxToolBarToolsList::compatibility_iterator node;