Support mouse click through as otherwise clicking inside an inactive window causes us to lose the first mouse down, unlike with MSW.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63096 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2010-01-08 01:29:51 +00:00
parent 14946ce13c
commit 5a900d5050

View File

@@ -651,6 +651,13 @@ void wxOSX_mouseEvent(NSView* self, SEL _cmd, NSEvent *event)
impl->mouseEvent(event, self, _cmd);
}
BOOL wxOSX_acceptsFirstMouse(NSView* self, SEL _cmd, NSEvent *event)
{
// This is needed to support click through, otherwise the first click on a window
// will not do anything unless it is the active window already.
return YES;
}
void wxOSX_keyEvent(NSView* self, SEL _cmd, NSEvent *event)
{
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
@@ -1120,6 +1127,8 @@ void wxOSXCocoaClassAddWXMethods(Class c)
wxOSX_CLASS_ADD_METHOD(c, @selector(rightMouseDragged:), (IMP) wxOSX_mouseEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(otherMouseDragged:), (IMP) wxOSX_mouseEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(acceptsFirstMouse:), (IMP) wxOSX_acceptsFirstMouse, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(scrollWheel:), (IMP) wxOSX_mouseEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(mouseEntered:), (IMP) wxOSX_mouseEvent, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(mouseExited:), (IMP) wxOSX_mouseEvent, "v@:@" )