+
+ wxPoint pt = dest_tabs->ScreenToClient(screen_pt);
+ wxWindow* dest_location_tab;
+
+ // this is an inner-tab drag/reposition
+ if (dest_tabs->TabHitTest(pt.x, pt.y, &dest_location_tab))
+ {
+ int src_idx = evt.GetSelection();
+ int dest_idx = dest_tabs->GetIdxFromWindow(dest_location_tab);
+
+ // prevent jumpy drag
+ if ((src_idx == dest_idx) || dest_idx == -1 ||
+ (src_idx > dest_idx && m_last_drag_x <= pt.x) ||
+ (src_idx < dest_idx && m_last_drag_x >= pt.x))
+ {
+ m_last_drag_x = pt.x;
+ return;
+ }
+
+
+ wxWindow* src_tab = dest_tabs->GetWindowFromIdx(src_idx);
+ dest_tabs->MovePage(src_tab, dest_idx);
+ dest_tabs->SetActivePage((size_t)dest_idx);
+ dest_tabs->DoShowHide();
+ dest_tabs->Refresh();
+ m_last_drag_x = pt.x;
+
+ }
+