aui notebook - foreign tab drops are positioned correctly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Benjamin Williams
2006-10-31 13:55:54 +00:00
parent 8efbb8ad30
commit c69532f71c

View File

@@ -1797,12 +1797,22 @@ void wxAuiMultiNotebook::OnTabEndDrag(wxCommandEvent& command_evt)
// If the pointer is in an existing tab frame, do a tab insert
wxWindow* hit_wnd = ::wxFindWindowAtPoint(mouse_screen_pt);
wxTabFrame* tab_frame = (wxTabFrame*)GetTabFrameFromTabCtrl(hit_wnd);
int insert_idx = -1;
if (tab_frame)
{
dest_tabs = tab_frame->m_tabs;
if (dest_tabs == src_tabs)
return;
wxPoint pt = dest_tabs->ScreenToClient(mouse_screen_pt);
wxWindow* target = NULL;
dest_tabs->TabHitTest(pt.x, pt.y, &target);
if (target)
{
insert_idx = dest_tabs->GetIdxFromWindow(target);
}
}
else
{
@@ -1837,7 +1847,9 @@ void wxAuiMultiNotebook::OnTabEndDrag(wxCommandEvent& command_evt)
// add the page to the destination tabs
dest_tabs->AddPage(page_info.window, page_info);
if (insert_idx == -1)
insert_idx = dest_tabs->GetPageCount();
dest_tabs->InsertPage(page_info.window, page_info, insert_idx);
if (src_tabs->GetPageCount() == 0)
{