Don't assert if Ctrl+Tab is pressed inside a wxGTK window

Ignore the WinChange flag in DoNavigateIn() to fix an assertion that happened
when pressing Ctrl+Tab with the generic wxListCtrl having focus.

This seems to be consistent with pressing Ctrl+Tab elsewhere, e.g. when
cycling between buttons in a dialog.
This commit is contained in:
Tim Kosse
2016-01-14 15:26:49 +01:00
committed by Vadim Zeitlin
parent e72133371e
commit 8eef0f9ce2

View File

@@ -3818,26 +3818,17 @@ void wxWindowGTK::DoMoveInTabOrder(wxWindow *win, WindowOrder move)
bool wxWindowGTK::DoNavigateIn(int flags)
{
if ( flags & wxNavigationKeyEvent::WinChange )
{
wxFAIL_MSG( wxT("not implemented") );
wxWindow *parent = wxGetTopLevelParent((wxWindow *)this);
wxCHECK_MSG( parent, false, wxT("every window must have a TLW parent") );
return false;
}
else // navigate inside the container
{
wxWindow *parent = wxGetTopLevelParent((wxWindow *)this);
wxCHECK_MSG( parent, false, wxT("every window must have a TLW parent") );
GtkDirectionType dir;
dir = flags & wxNavigationKeyEvent::IsForward ? GTK_DIR_TAB_FORWARD
: GTK_DIR_TAB_BACKWARD;
GtkDirectionType dir;
dir = flags & wxNavigationKeyEvent::IsForward ? GTK_DIR_TAB_FORWARD
: GTK_DIR_TAB_BACKWARD;
gboolean rc;
g_signal_emit_by_name(parent->m_widget, "focus", dir, &rc);
gboolean rc;
g_signal_emit_by_name(parent->m_widget, "focus", dir, &rc);
return rc != 0;
}
return rc != 0;
}
bool wxWindowGTK::GTKWidgetNeedsMnemonic() const