]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied [ 1208344 ] wxNotebook::OnSelChange fix for focus issue
authorJulian Smart <julian@anthemion.co.uk>
Mon, 30 May 2005 11:23:27 +0000 (11:23 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 30 May 2005 11:23:27 +0000 (11:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/notebook.cpp

index e6104def388e873036d826c4826d81d74a87cff9..5694d072b999c5f850858769cd3a9fc8c69842e5 100644 (file)
@@ -967,18 +967,14 @@ void wxNotebook::OnSelChange(wxNotebookEvent& event)
       {
         wxNotebookPage *pPage = m_pages[sel];
         pPage->Show(true);
-        pPage->SetFocus();
-
-        // If the newly focused window is not a child of the new page,
-        // SetFocus was not successful and the notebook itself should be
-        // focused
-        wxWindow *currentFocus = FindFocus();
-        wxWindow *startFocus = currentFocus;
-        while ( currentFocus && currentFocus != pPage && currentFocus != this )
-            currentFocus = currentFocus->GetParent();
-
-        if ( startFocus == pPage || currentFocus != pPage )
-            SetFocus();
+        
+        // As per bug report:
+        // http://sourceforge.net/tracker/index.php?func=detail&aid=1150659&group_id=9863&atid=109863,
+        // we should not set the page focus (and thereby the focus for
+        // a child window) since it erroneously selects radio button controls and also
+        // breaks keyboard handling for a notebook's scroll buttons. So
+        // we always focus the notebook and not the page.
+        SetFocus();
 
       }
       else // no pages in the notebook, give the focus to itself