don't use parent window of a TLW in HandleOnNavigationKey(), even if it's apparently harmless it's wrong to involve the parent TLW in the code navigating inside this one

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-02-11 00:09:24 +00:00
parent 521d34369b
commit 391b16953a

View File

@ -316,7 +316,10 @@ wxRadioButton* wxGetSelectedButtonInGroup(wxRadioButton *btn)
void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
{
wxWindow *parent = m_winParent->GetParent();
// for a TLW we shouldn't involve the parent window, it has nothing to do
// with keyboard navigation inside this TLW
wxWindow *parent = m_winParent->IsTopLevel() ? NULL
: m_winParent->GetParent();
// the event is propagated downwards if the event emitter was our parent
bool goingDown = event.GetEventObject() == parent;