]> git.saurik.com Git - wxWidgets.git/commitdiff
wxAuiNotebook tab drag-drop bug fixes
authorBenjamin Williams <bwilliams@kirix.com>
Wed, 8 Nov 2006 09:54:05 +0000 (09:54 +0000)
committerBenjamin Williams <bwilliams@kirix.com>
Wed, 8 Nov 2006 09:54:05 +0000 (09:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/auibook.cpp

index 53f00a42f72da042b30541b860c8565a530305fa..f2ed26ae883af506ef603ab0d9be9e1f442a14e4 100644 (file)
@@ -2728,8 +2728,12 @@ void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt)
     {
         wxWindow* tab_ctrl = ::wxFindWindowAtPoint(screen_pt);
         
+        // if we aren't over any window, stop here
+        if (!tab_ctrl)
+            return;
+            
         // make sure we are not over the hint window
-        if (tab_ctrl && !tab_ctrl->IsKindOf(CLASSINFO(wxFrame)))
+        if (!tab_ctrl->IsKindOf(CLASSINFO(wxFrame)))
         {
             while (tab_ctrl)
             {
@@ -2744,12 +2748,20 @@ void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt)
                 
                 if (nb != this)
                 {
-                    wxRect hint_rect = tab_ctrl->GetRect();
+                    wxRect hint_rect = tab_ctrl->GetClientRect();
                     tab_ctrl->ClientToScreen(&hint_rect.x, &hint_rect.y);
                     m_mgr.ShowHint(hint_rect);
                     return;
                 }
-                
+            }
+        }
+         else
+        {
+            if (!dest_tabs)
+            {
+                // we are either over a hint window, or not over a tab
+                // window, and there is no where to drag to, so exit
+                return;
             }
         }
     }