From: Kevin Ollivier Date: Fri, 13 Feb 2009 20:16:13 +0000 (+0000) Subject: clickCount is not available for mouse entered/exited events also, just use respondsTo... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f1f1500304fa0780b37bef403def82b9463016c8 clickCount is not available for mouse entered/exited events also, just use respondsToSelector to make sure we catch this always, and add some stubs for mouse entered / exited events. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index e17d8b6863..25cc1c2858 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -190,7 +190,7 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) // these parameters are not given for all events UInt32 button = [nsEvent buttonNumber]; UInt32 clickCount = 0; - if ( eventType != NSScrollWheel ) + if ( [nsEvent respondsToSelector:@selector(clickCount:)] ) [nsEvent clickCount]; wxevent.m_x = screenMouseLocation.x; @@ -332,7 +332,11 @@ void SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEvent ) break ; case NSMouseEntered : + wxevent.SetEventType( wxEVT_ENTER_WINDOW ) ; + break; case NSMouseExited : + wxevent.SetEventType( wxEVT_LEAVE_WINDOW ) ; + break; case NSLeftMouseDragged : case NSRightMouseDragged : case NSOtherMouseDragged :