From 20ebd9ffbf9d74413112414c3304d0035241d0be Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 29 Mar 2012 12:08:05 +0000 Subject: [PATCH] Allow closing wxAuiTabCtrl pages without switching to them. Clicking on the page "x" close button switched to the page before doing anything else which was unusual as other tabbed controls don't behave like this. Handle clicks on the close button specially and avoid switching to the page which is about to be closed anyhow. Closes #14150. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 2d58a37229..eed5e4c7f0 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -1050,8 +1050,8 @@ void wxAuiTabCtrl::OnLeftDown(wxMouseEvent& evt) // wxAuiNotebooks always want to receive this event // even if the tab is already active, because they may // have multiple tab controls - if (new_selection != GetActivePage() || - GetParent()->IsKindOf(CLASSINFO(wxAuiNotebook))) + if ((new_selection != GetActivePage() || + GetParent()->IsKindOf(CLASSINFO(wxAuiNotebook))) && !m_hoverButton) { wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, m_windowId); e.SetSelection(new_selection); -- 2.45.2