]> git.saurik.com Git - wxWidgets.git/commitdiff
more specific solution to tooltips appearing on neighboring views, refs #15072
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 11 Mar 2013 10:08:19 +0000 (10:08 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 11 Mar 2013 10:08:19 +0000 (10:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73642 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/treectlg.cpp
src/osx/cocoa/window.mm

index 28ac6d781ac979aebec946371765c635cb544f76..d7193a9febe4380661f50f6e188580b8a453bb14 100644 (file)
@@ -3590,6 +3590,13 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
         wxTreeEvent
             hevent(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP,  this, hoverItem);
 
         wxTreeEvent
             hevent(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP,  this, hoverItem);
 
+        // setting a tooltip upon leaving a view is getting the tooltip displayed
+        // on the neighbouring view ...
+#ifdef __WXOSX__
+        if ( event.Leaving() )
+            SetToolTip(NULL);
+        else
+#endif
         if ( GetEventHandler()->ProcessEvent(hevent) )
         {
             // If the user permitted the tooltip change, update it, otherwise
         if ( GetEventHandler()->ProcessEvent(hevent) )
         {
             // If the user permitted the tooltip change, update it, otherwise
index faaff0b3504024f6b719f999ae2d72ed3c7d07ca..39740378c8ccfd56583c091626f15608e1111452 100644 (file)
@@ -1180,7 +1180,7 @@ void wxWidgetCocoaImpl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd)
 {
     // we are getting moved events for all windows in the hierarchy, not something wx expects
     // therefore we only handle it for the deepest child in the hierarchy
 {
     // we are getting moved events for all windows in the hierarchy, not something wx expects
     // therefore we only handle it for the deepest child in the hierarchy
-    if ( 1 /* [event type] == NSMouseMoved */ )
+    if ( [event type] == NSMouseMoved )
     {
         NSView* hitview = [[[slf window] contentView] hitTest:[event locationInWindow]];
         if ( hitview == NULL || hitview != slf)
     {
         NSView* hitview = [[[slf window] contentView] hitTest:[event locationInWindow]];
         if ( hitview == NULL || hitview != slf)
@@ -2522,7 +2522,7 @@ void wxWidgetCocoaImpl::InstallEventHandler( WXWidget control )
 
     }
     NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited|NSTrackingCursorUpdate|NSTrackingMouseMoved|NSTrackingActiveAlways|NSTrackingInVisibleRect;
 
     }
     NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited|NSTrackingCursorUpdate|NSTrackingMouseMoved|NSTrackingActiveAlways|NSTrackingInVisibleRect;
-        NSTrackingArea* area = [[NSTrackingArea alloc] initWithRect: NSZeroRect options: options owner: m_osxView userInfo: nil];
+    NSTrackingArea* area = [[NSTrackingArea alloc] initWithRect: NSZeroRect options: options owner: m_osxView userInfo: nil];
     [m_osxView addTrackingArea: area];
     [area release];
  }
     [m_osxView addTrackingArea: area];
     [area release];
  }