don't set focus to a hidden notebook (patch 1299005)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -8,6 +8,7 @@ wxWidgets Change Log - For more verbose changes, see the manual
 | 
			
		||||
wxMSW:
 | 
			
		||||
 | 
			
		||||
- wxFileDialog respects absence of wxCHANGE_DIR flag under NT (Brad Anderson)
 | 
			
		||||
- Switching page of a hidden notebook doesn't lose focus (Jamie Gadd)
 | 
			
		||||
 | 
			
		||||
Unix:
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -812,8 +812,6 @@ LRESULT APIENTRY _EXPORT wxNotebookWndProc(HWND hwnd,
 | 
			
		||||
                            hwnd, message, wParam, lParam);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
void wxNotebook::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
 | 
			
		||||
{
 | 
			
		||||
    // do nothing here
 | 
			
		||||
@@ -991,20 +989,17 @@ void wxNotebook::OnSelChange(wxNotebookEvent& event)
 | 
			
		||||
      {
 | 
			
		||||
        wxNotebookPage *pPage = m_pages[sel];
 | 
			
		||||
        pPage->Show(true);
 | 
			
		||||
 | 
			
		||||
        // 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
 | 
			
		||||
      {
 | 
			
		||||
 | 
			
		||||
      // Changing the page should give the focus to it but, as per bug report
 | 
			
		||||
      // http://sf.net/tracker/index.php?func=detail&aid=1150659&group_id=9863&atid=109863,
 | 
			
		||||
      // we should not set the focus to it directly since it erroneously
 | 
			
		||||
      // selects radio buttons and breaks keyboard handling for a notebook's
 | 
			
		||||
      // scroll buttons. So give focus to the notebook and not the page.
 | 
			
		||||
 | 
			
		||||
      // but don't do this is the notebook is hidden
 | 
			
		||||
      if ( ::IsWindowVisible(GetHwnd()) )
 | 
			
		||||
        SetFocus();
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      m_nSelection = sel;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user