Fix regression with MDI children accelerators

Since the changes of 8034e35391 (see #16870)
accelerators, including the standard ones such as Ctrl-F4 under MSW, didn't
work any longer inside the MDI children.

Fix this by extending IsTopNavigationDomain() to allow for checking whether
the given window should stop propagation of all keyboard events, as wxTLW
does, or only TAB navigation ones as wxMDIChildFrame and wxAuiFloatingFrame
do.
This commit is contained in:
Vadim Zeitlin
2016-02-28 01:24:20 +01:00
parent fd738c5fdb
commit 5e61689dbf
10 changed files with 68 additions and 14 deletions

View File

@@ -1537,13 +1537,23 @@ public:
virtual wxWindow *GetMainWindowOfCompositeControl()
{ return (wxWindow*)this; }
// If this function returns true, keyboard navigation events shouldn't
enum NavigationKind
{
Navigation_Tab,
Navigation_Accel
};
// If this function returns true, keyboard events of the given kind can't
// escape from it. A typical example of such "navigation domain" is a top
// level window because pressing TAB in one of them must not transfer focus
// to a different top level window. But it's not limited to them, e.g. MDI
// children frames are not top level windows (and their IsTopLevel()
// returns false) but still are self-contained navigation domains as well.
virtual bool IsTopNavigationDomain() const { return false; }
// returns false) but still are self-contained navigation domains for the
// purposes of TAB navigation -- but not for the accelerators.
virtual bool IsTopNavigationDomain(NavigationKind WXUNUSED(kind)) const
{
return false;
}
protected: