Update selection in wxAuiNotebook correctly after tab move
Update the selected state of the tab with the index corresponding to the old index of the tab which was moved. Closes #16605.
This commit is contained in:
committed by
Vadim Zeitlin
parent
06963940fb
commit
7e530e23e1
@@ -2769,11 +2769,12 @@ void wxAuiNotebook::OnTabEndDrag(wxAuiNotebookEvent& evt)
|
|||||||
nb->m_tabs.InsertPage(page_info.window, page_info, insert_idx);
|
nb->m_tabs.InsertPage(page_info.window, page_info, insert_idx);
|
||||||
|
|
||||||
nb->DoSizing();
|
nb->DoSizing();
|
||||||
|
dest_tabs->SetActivePage(insert_idx);
|
||||||
dest_tabs->DoShowHide();
|
dest_tabs->DoShowHide();
|
||||||
dest_tabs->Refresh();
|
dest_tabs->Refresh();
|
||||||
|
|
||||||
// set the selection in the destination tab control
|
// set the selection in the destination tab control
|
||||||
nb->SetSelectionToPage(page_info);
|
nb->DoModifySelection(insert_idx, false);
|
||||||
|
|
||||||
// notify owner that the tab has been dragged
|
// notify owner that the tab has been dragged
|
||||||
wxAuiNotebookEvent e2(wxEVT_AUINOTEBOOK_DRAG_DONE, m_windowId);
|
wxAuiNotebookEvent e2(wxEVT_AUINOTEBOOK_DRAG_DONE, m_windowId);
|
||||||
@@ -2804,8 +2805,10 @@ void wxAuiNotebook::OnTabEndDrag(wxAuiNotebookEvent& evt)
|
|||||||
dest_tabs = tab_frame->m_tabs;
|
dest_tabs = tab_frame->m_tabs;
|
||||||
|
|
||||||
if (dest_tabs == src_tabs)
|
if (dest_tabs == src_tabs)
|
||||||
|
{
|
||||||
|
m_curPage = evt.GetSelection();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wxPoint pt = dest_tabs->ScreenToClient(mouse_screen_pt);
|
wxPoint pt = dest_tabs->ScreenToClient(mouse_screen_pt);
|
||||||
wxWindow* target = NULL;
|
wxWindow* target = NULL;
|
||||||
|
Reference in New Issue
Block a user