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
This commit is contained in:
Vadim Zeitlin
2012-12-23 11:33:50 +00:00
parent 76e36b9452
commit ab67e8874d
2 changed files with 3 additions and 1 deletions

View 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).
- Fix wrong tab order in wxAuiNotebook after dragging (Mark Barber).
wxGTK:

View 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);
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();