]> git.saurik.com Git - wxWidgets.git/commitdiff
added a cursor hint so user knows a tab is being dragged
authorBenjamin Williams <bwilliams@kirix.com>
Thu, 2 Nov 2006 16:31:44 +0000 (16:31 +0000)
committerBenjamin Williams <bwilliams@kirix.com>
Thu, 2 Nov 2006 16:31:44 +0000 (16:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/auibook.cpp

index 6bcd7f7110ae579d6d5125467b5ad2c8ac13f382..0df4995c4fc167b2b9f2c7305b47695516ef1abb 100644 (file)
@@ -1919,6 +1919,11 @@ void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt)
     wxAuiTabCtrl* dest_tabs = GetTabCtrlFromPoint(client_pt);
     if (dest_tabs == src_tabs)
     {
     wxAuiTabCtrl* dest_tabs = GetTabCtrlFromPoint(client_pt);
     if (dest_tabs == src_tabs)
     {
+        if (src_tabs)
+        {
+            src_tabs->SetCursor(wxCursor(wxCURSOR_ARROW));
+        }
+        
         // always hide the hint for inner-tabctrl drag
         m_mgr.HideHint();
         
         // always hide the hint for inner-tabctrl drag
         m_mgr.HideHint();
         
@@ -1966,6 +1971,13 @@ void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt)
         return;
     }
 
         return;
     }
 
+
+    if (src_tabs)
+    {
+        src_tabs->SetCursor(wxCursor(wxCURSOR_SIZING));
+    }
+    
+    
     if (dest_tabs)
     {
         wxRect hint_rect = dest_tabs->GetRect();
     if (dest_tabs)
     {
         wxRect hint_rect = dest_tabs->GetRect();
@@ -1992,13 +2004,19 @@ void wxAuiNotebook::OnTabEndDrag(wxCommandEvent& command_evt)
         return;
     }
     
         return;
     }
     
+    // set cursor back to an arrow
+    wxAuiTabCtrl* src_tabs = (wxAuiTabCtrl*)evt.GetEventObject();
+    if (src_tabs)
+    {
+        src_tabs->SetCursor(wxCursor(wxCURSOR_ARROW));
+    }
+    
     // get the mouse position, which will be used to determine the drop point
     wxPoint mouse_screen_pt = ::wxGetMousePosition();
     wxPoint mouse_client_pt = ScreenToClient(mouse_screen_pt);
 
 
     // the src tab control is the control that fired this event
     // get the mouse position, which will be used to determine the drop point
     wxPoint mouse_screen_pt = ::wxGetMousePosition();
     wxPoint mouse_client_pt = ScreenToClient(mouse_screen_pt);
 
 
     // the src tab control is the control that fired this event
-    wxAuiTabCtrl* src_tabs = (wxAuiTabCtrl*)evt.GetEventObject();
     wxAuiTabCtrl* dest_tabs = NULL;
 
 
     wxAuiTabCtrl* dest_tabs = NULL;
 
 
@@ -2073,6 +2091,8 @@ void wxAuiNotebook::OnTabEndDrag(wxCommandEvent& command_evt)
     SetSelection(m_tabs.GetIdxFromWindow(page_info.window));
 }
 
     SetSelection(m_tabs.GetIdxFromWindow(page_info.window));
 }
 
+
+
 wxAuiTabCtrl* wxAuiNotebook::GetTabCtrlFromPoint(const wxPoint& pt)
 {
     // if we've just removed the last tab from the source
 wxAuiTabCtrl* wxAuiNotebook::GetTabCtrlFromPoint(const wxPoint& pt)
 {
     // if we've just removed the last tab from the source