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:
Vadim Zeitlin 2005-09-24 21:22:28 +00:00
parent a5924a7a35
commit e1cffcd6e3
2 changed files with 11 additions and 15 deletions

View File

@ -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:

View File

@ -90,7 +90,7 @@
static WXFARPROC gs_wndprocNotebookSpinBtn = (WXFARPROC)NULL;
// the pointer to standard tab control wnd proc
static WXFARPROC gs_wndprocNotebook = (WXFARPROC)NULL;
static WXFARPROC gs_wndprocNotebook = (WXFARPROC)NULL;
LRESULT APIENTRY _EXPORT wxNotebookWndProc(HWND hwnd,
UINT message,
@ -812,8 +812,6 @@ LRESULT APIENTRY _EXPORT wxNotebookWndProc(HWND hwnd,
hwnd, message, wParam, lParam);
}
void wxNotebook::OnEraseBackground(wxEraseEvent& WXUNUSED(event))
{
// do nothing here
@ -991,21 +989,18 @@ 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.
// 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();
}
else // no pages in the notebook, give the focus to itself
{
SetFocus();
}
m_nSelection = sel;
}