From: Stefan Csomor Date: Sun, 28 Mar 2004 07:18:48 +0000 (+0000) Subject: mouse handling fixed, skipping if we have no native control handling X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/39a7aa0467fcaeca022d981fc0d025979423adb3 mouse handling fixed, skipping if we have no native control handling git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index fc0644b024..6475e3f25d 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -2564,7 +2564,6 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) x += origin.x ; y += origin.y ; } - ControlRef control ; Point localwhere ; SInt16 controlpart ; @@ -2587,20 +2586,21 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) if ( event.m_metaDown ) modifiers |= cmdKey ; + + bool handled = false ; + + if ( ::IsControlActive( (ControlRef) m_macControl ) ) { - control = (ControlRef) m_macControl ; - if ( control && ::IsControlActive( control ) ) + controlpart = ::HandleControlClick( (ControlRef) m_macControl , localwhere , modifiers , (ControlActionUPP) -1 ) ; + wxTheApp->s_lastMouseDown = 0 ; + if ( controlpart != kControlNoPart ) { - { - controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ; - wxTheApp->s_lastMouseDown = 0 ; - if ( control && controlpart != kControlNoPart ) - { - MacHandleControlClick((WXWidget) control , controlpart , false /* mouse not down anymore */ ) ; - } - } + MacHandleControlClick((WXWidget) (ControlRef) m_macControl , controlpart , false /* mouse not down anymore */ ) ; + handled = true ; } } + if ( !handled ) + event.Skip() ; } else {