From: Jaakko Salli Date: Fri, 15 Jan 2010 17:19:54 +0000 (+0000) Subject: When checking whether the parent has wxTAB_TRAVERSAL style, take into account that... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bbb8690483688ae3827b2efb2c76b2c4220f0f3d When checking whether the parent has wxTAB_TRAVERSAL style, take into account that the wxComboCtrl can be part of a composite control git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index b45e28a2c6..898cbfd08c 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -1775,9 +1775,13 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event) } else // no popup { - if ( GetParent()->HasFlag(wxTAB_TRAVERSAL) && - HandleAsNavigationKey(event) ) - return; + wxWindow* mainCtrl = GetMainWindowOfCompositeControl(); + + if ( mainCtrl->GetParent()->HasFlag(wxTAB_TRAVERSAL) ) + { + if ( mainCtrl->HandleAsNavigationKey(event) ) + return; + } if ( IsKeyPopupToggle(event) ) { @@ -2022,7 +2026,8 @@ void wxComboCtrlBase::ShowPopup() // that if transient popup is open, then tab traversal is to be ignored. // However, I think this code would still be needed for cases where // transient popup doesn't work yet (wxWinCE?). - wxWindow* parent = GetParent(); + wxWindow* mainCtrl = GetMainWindowOfCompositeControl(); + wxWindow* parent = mainCtrl->GetParent(); int parentFlags = parent->GetWindowStyle(); if ( parentFlags & wxTAB_TRAVERSAL ) {