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:
@@ -1797,12 +1797,22 @@ void wxAuiMultiNotebook::OnTabEndDrag(wxCommandEvent& command_evt)
|
|||||||
// If the pointer is in an existing tab frame, do a tab insert
|
// If the pointer is in an existing tab frame, do a tab insert
|
||||||
wxWindow* hit_wnd = ::wxFindWindowAtPoint(mouse_screen_pt);
|
wxWindow* hit_wnd = ::wxFindWindowAtPoint(mouse_screen_pt);
|
||||||
wxTabFrame* tab_frame = (wxTabFrame*)GetTabFrameFromTabCtrl(hit_wnd);
|
wxTabFrame* tab_frame = (wxTabFrame*)GetTabFrameFromTabCtrl(hit_wnd);
|
||||||
|
int insert_idx = -1;
|
||||||
if (tab_frame)
|
if (tab_frame)
|
||||||
{
|
{
|
||||||
dest_tabs = tab_frame->m_tabs;
|
dest_tabs = tab_frame->m_tabs;
|
||||||
|
|
||||||
if (dest_tabs == src_tabs)
|
if (dest_tabs == src_tabs)
|
||||||
return;
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -1837,7 +1847,9 @@ void wxAuiMultiNotebook::OnTabEndDrag(wxCommandEvent& command_evt)
|
|||||||
|
|
||||||
|
|
||||||
// add the page to the destination tabs
|
// 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)
|
if (src_tabs->GetPageCount() == 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user