]> git.saurik.com Git - wxWidgets.git/commitdiff
allow mouse events being sent to parents, see #10876
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 10 Jun 2009 06:52:52 +0000 (06:52 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 10 Jun 2009 06:52:52 +0000 (06:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/window.mm

index 713fce435b7c9f6ed1d1fc7f1d5455cbfb9919f9..7fd8287b8227ccd6f36c41ba09faa295afe455a1 100644 (file)
@@ -848,8 +848,12 @@ void wxWidgetCocoaImpl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
 {
     if ( !DoHandleMouseEvent(event) )
     {
-        wxOSX_EventHandlerPtr superimpl = (wxOSX_EventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
-        superimpl(slf, (SEL)_cmd, event);
+        // for plain NSView mouse events would propagate to parents otherwise
+        if (!m_wxPeer->MacIsUserPane())
+        {
+            wxOSX_EventHandlerPtr superimpl = (wxOSX_EventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
+            superimpl(slf, (SEL)_cmd, event);
+        }
     }
 }
 
@@ -866,8 +870,8 @@ void wxWidgetCocoaImpl::insertText(NSString* text, WXWidget slf, void *_cmd)
 {
     if (m_lastKeyDownEvent && !DoHandleCharEvent(m_lastKeyDownEvent, text) )
     {
-            wxOSX_TextEventHandlerPtr superimpl = (wxOSX_TextEventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
-            superimpl(slf, (SEL)_cmd, text);
+        wxOSX_TextEventHandlerPtr superimpl = (wxOSX_TextEventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
+        superimpl(slf, (SEL)_cmd, text);
     }
     m_lastKeyDownEvent = NULL;
 }