diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 97b223c14e..1cc7df0cfd 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -42,6 +42,7 @@ WX_DEFINE_OBJARRAY(wxAuiNotebookPageArray) WX_DEFINE_OBJARRAY(wxAuiTabContainerButtonArray) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_BUTTON) @@ -49,6 +50,7 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN) DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP) @@ -3823,6 +3825,13 @@ void wxAuiNotebook::OnTabEndDrag(wxCommandEvent& command_evt) // set the selection in the destination tab control nb->SetSelectionToPage(page_info); + // notify owner that the tab has been dragged + wxAuiNotebookEvent e2(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, m_windowId); + e2.SetSelection(evt.GetSelection()); + e2.SetOldSelection(evt.GetSelection()); + e2.SetEventObject(this); + GetEventHandler()->ProcessEvent(e2); + return; } } @@ -3924,6 +3933,13 @@ void wxAuiNotebook::OnTabEndDrag(wxCommandEvent& command_evt) UpdateHintWindowSize(); } + + // notify owner that the tab has been dragged + wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, m_windowId); + e.SetSelection(evt.GetSelection()); + e.SetOldSelection(evt.GetSelection()); + e.SetEventObject(this); + GetEventHandler()->ProcessEvent(e); } @@ -4150,6 +4166,8 @@ void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt) // ask owner if it's ok to close the tab wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, m_windowId); e.SetSelection(m_tabs.GetIdxFromWindow(close_wnd)); + const int idx = m_tabs.GetIdxFromWindow(close_wnd); + e.SetSelection(idx); e.SetOldSelection(evt.GetSelection()); e.SetEventObject(this); GetEventHandler()->ProcessEvent(e); @@ -4170,6 +4188,12 @@ void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt) DeletePage(main_idx); } + + // notify owner that the tab has been closed + wxAuiNotebookEvent e2(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, m_windowId); + e2.SetSelection(idx); + e2.SetEventObject(this); + GetEventHandler()->ProcessEvent(e2); } } }