]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow closing wxAuiTabCtrl pages without switching to them.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 29 Mar 2012 12:08:05 +0000 (12:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 29 Mar 2012 12:08:05 +0000 (12:08 +0000)
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

index 2d58a372293f4331ad2261cda861d18213378ad0..eed5e4c7f0a0ccbe3a67984a0cb1d9ecd6b146ca 100644 (file)
@@ -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);