Applied [ 1208344 ] wxNotebook::OnSelChange fix for focus issue
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -967,17 +967,13 @@ void wxNotebook::OnSelChange(wxNotebookEvent& event)
|
|||||||
{
|
{
|
||||||
wxNotebookPage *pPage = m_pages[sel];
|
wxNotebookPage *pPage = m_pages[sel];
|
||||||
pPage->Show(true);
|
pPage->Show(true);
|
||||||
pPage->SetFocus();
|
|
||||||
|
|
||||||
// If the newly focused window is not a child of the new page,
|
// As per bug report:
|
||||||
// SetFocus was not successful and the notebook itself should be
|
// http://sourceforge.net/tracker/index.php?func=detail&aid=1150659&group_id=9863&atid=109863,
|
||||||
// focused
|
// we should not set the page focus (and thereby the focus for
|
||||||
wxWindow *currentFocus = FindFocus();
|
// a child window) since it erroneously selects radio button controls and also
|
||||||
wxWindow *startFocus = currentFocus;
|
// breaks keyboard handling for a notebook's scroll buttons. So
|
||||||
while ( currentFocus && currentFocus != pPage && currentFocus != this )
|
// we always focus the notebook and not the page.
|
||||||
currentFocus = currentFocus->GetParent();
|
|
||||||
|
|
||||||
if ( startFocus == pPage || currentFocus != pPage )
|
|
||||||
SetFocus();
|
SetFocus();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user