Fix bug with TAB being able to switch focus between MDI frames.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 3 Aug 2011 00:45:42 +0000 (00:45 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 3 Aug 2011 00:45:42 +0000 (00:45 +0000)
commit6e92c2991bb840f1eb9f551638fd64ca5b1b86ac
tree9fd454f4adc6c021e458eca17fabae0e1fb43cb7
parent2a0777a8f079e4f2991f219dc641de3798143f79
Fix bug with TAB being able to switch focus between MDI frames.

The keyboard navigation code correctly checked that TAB was not propagated
above the TLW containing the window in which the key was pressed to avoid
switching focus between different TLWs by pressing TAB.

However wxMDIChildFrame is not a TLW and so it was possible to switch focus
between two different MDI child frames by pressing TAB. This was unexpected
and counterintuitive, especially because the frame receiving focus was not
even activated (which might be another bug).

Fix this by adding a new wxWindow::IsTopNavigationDomain() virtual method that
can be overridden to indicate that a window is a self-contained "keyboard
navigation domain" and that keyboard events shouldn't propagate outside of it
and override it in both wxTopLevelWindow and wxMDIChildFrame to ensure that it
behaves correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/mdi.h
include/wx/toplevel.h
include/wx/window.h
src/common/containr.cpp