]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wrong tab order in wxAuiNotebook after dragging.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 23 Dec 2012 11:33:50 +0000 (11:33 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 23 Dec 2012 11:33:50 +0000 (11:33 +0000)
Update the tab index correctly to keep tabs list and windows list in sync.

Closes #10848.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/aui/auibook.cpp

index 1f37a94b986cd9dd5c3fbdb38cf36d6154ce4949..f9c2eb15f09bc1095deaac55c4c546cac5930760 100644 (file)
@@ -596,6 +596,7 @@ All (GUI):
 - Add possibility to delay showing wxRichToolTip (John Roberts).
 - Add "rect" paramerer to wxRichToolTip::ShowFor() (John Roberts).
 - Add wxListCtrl::EnableAlternateRowColours() (troelsk).
 - Add possibility to delay showing wxRichToolTip (John Roberts).
 - Add "rect" paramerer to wxRichToolTip::ShowFor() (John Roberts).
 - Add wxListCtrl::EnableAlternateRowColours() (troelsk).
+- Fix wrong tab order in wxAuiNotebook after dragging (Mark Barber).
 
 wxGTK:
 
 
 wxGTK:
 
index 30691c1c036a1e581a046a2e0c10abb84fbda6b9..f77bcef2e05e1d76d9f1943d86729edaa4f2ef33 100644 (file)
@@ -2542,6 +2542,7 @@ void wxAuiNotebook::OnTabDragMotion(wxAuiNotebookEvent& evt)
 
             wxWindow* src_tab = dest_tabs->GetWindowFromIdx(src_idx);
             dest_tabs->MovePage(src_tab, dest_idx);
 
             wxWindow* src_tab = dest_tabs->GetWindowFromIdx(src_idx);
             dest_tabs->MovePage(src_tab, dest_idx);
+            m_tabs.MovePage(m_tabs.GetPage(src_idx).window, dest_idx);
             dest_tabs->SetActivePage((size_t)dest_idx);
             dest_tabs->DoShowHide();
             dest_tabs->Refresh();
             dest_tabs->SetActivePage((size_t)dest_idx);
             dest_tabs->DoShowHide();
             dest_tabs->Refresh();
@@ -2726,7 +2727,7 @@ void wxAuiNotebook::OnTabEndDrag(wxAuiNotebookEvent& evt)
                 if (insert_idx == -1)
                     insert_idx = dest_tabs->GetPageCount();
                 dest_tabs->InsertPage(page_info.window, page_info, insert_idx);
                 if (insert_idx == -1)
                     insert_idx = dest_tabs->GetPageCount();
                 dest_tabs->InsertPage(page_info.window, page_info, insert_idx);
-                nb->m_tabs.AddPage(page_info.window, page_info);
+                nb->m_tabs.InsertPage(page_info.window, page_info, insert_idx);
 
                 nb->DoSizing();
                 dest_tabs->DoShowHide();
 
                 nb->DoSizing();
                 dest_tabs->DoShowHide();