}
}
- wxWindow* wnd = NULL;
-
#if wxUSE_TOOLTIPS
- if (evt.Moving() && TabHitTest(evt.m_x, evt.m_y, &wnd))
+ wxWindow* wnd = NULL;
+ if (evt.Moving() && TabHitTest(evt.m_x, evt.m_y, &wnd))
{
wxString tooltip(m_pages[GetIdxFromWindow(wnd)].tooltip);
}
else
UnsetToolTip();
-#endif
-
+#endif // wxUSE_TOOLTIPS
+
if (!evt.LeftIsDown() || m_clickPt == wxDefaultPosition)
return;
SetSelectionToWindow(wnd);
}
-void wxAuiNotebook::OnTabBgDClick(wxAuiNotebookEvent& WXUNUSED(evt))
+void wxAuiNotebook::OnTabBgDClick(wxAuiNotebookEvent& evt)
{
+ // select the tab ctrl which received the db click
+ int selection;
+ wxWindow* wnd;
+ wxAuiTabCtrl* ctrl = (wxAuiTabCtrl*)evt.GetEventObject();
+ if ( (ctrl != NULL)
+ && ((selection = ctrl->GetActivePage()) != wxNOT_FOUND)
+ && ((wnd = ctrl->GetWindowFromIdx(selection)) != NULL))
+ {
+ SetSelectionToWindow(wnd);
+ }
+
// notify owner that the tabbar background has been double-clicked
wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, m_windowId);
e.SetEventObject(this);
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();
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();