]> git.saurik.com Git - wxWidgets.git/commitdiff
mouse handling fixed, skipping if we have no native control handling
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 28 Mar 2004 07:18:48 +0000 (07:18 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 28 Mar 2004 07:18:48 +0000 (07:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index fc0644b0247bfe5755b70d6ae3bbeeeb68149c1b..6475e3f25d3752033d8beee15524ced682d0b344 100644 (file)
@@ -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
     {