From: Vadim Zeitlin Date: Sun, 23 Dec 2012 11:33:50 +0000 (+0000) Subject: Fix wrong tab order in wxAuiNotebook after dragging. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ab67e8874db324fab5223cc8d5dff8a8de3e2b77?ds=sidebyside Fix wrong tab order in wxAuiNotebook after dragging. 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 --- diff --git a/docs/changes.txt b/docs/changes.txt index 1f37a94b98..f9c2eb15f0 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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). +- Fix wrong tab order in wxAuiNotebook after dragging (Mark Barber). wxGTK: diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 30691c1c03..f77bcef2e0 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2542,6 +2542,7 @@ void wxAuiNotebook::OnTabDragMotion(wxAuiNotebookEvent& evt) 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(); @@ -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); - 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();