]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/auibook.cpp
Cut is documented in wxTextEntry now
[wxWidgets.git] / src / aui / auibook.cpp
index f77bcef2e05e1d76d9f1943d86729edaa4f2ef33..2b64833d7296a006137e7d58393383b31a8a9720 100644 (file)
@@ -1233,10 +1233,9 @@ void wxAuiTabCtrl::OnMotion(wxMouseEvent& evt)
         }
     }
 
-    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);
 
@@ -1247,8 +1246,8 @@ void wxAuiTabCtrl::OnMotion(wxMouseEvent& evt)
     }
     else
         UnsetToolTip();
-#endif
-   
+#endif // wxUSE_TOOLTIPS
+
     if (!evt.LeftIsDown() || m_clickPt == wxDefaultPosition)
         return;
 
@@ -2483,8 +2482,19 @@ void wxAuiNotebook::OnTabClicked(wxAuiNotebookEvent& evt)
     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);