Fix type-checking which was too tight.

Also fixes a typo leaving the return statement in the wrong place.

Fixes https://gitlab.com/kicad/code/kicad/issues/4611
This commit is contained in:
Jeff Young 2020-06-04 22:08:09 +01:00
parent 8e8979e317
commit b274b9f972
1 changed files with 5 additions and 5 deletions

View File

@ -404,19 +404,19 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent )
keyEvent.m_shiftDown = ( acceleratorKey->GetFlags() & wxMOD_SHIFT ) > 0;
keyEvent.m_altDown = ( acceleratorKey->GetFlags() & wxMOD_ALT ) > 0;
if( dynamic_cast<wxStyledTextCtrl*>( focus ) )
focus->HandleWindowEvent( keyEvent );
else if( dynamic_cast<wxTextEntry*>( focus ) )
if( dynamic_cast<wxTextEntry*>( focus ) )
TEXTENTRY_TRICKS::OnCharHook( dynamic_cast<wxTextEntry*>( focus ), keyEvent );
else
focus->HandleWindowEvent( keyEvent );
if( keyEvent.GetSkipped() )
{
keyEvent.SetEventType( wxEVT_CHAR );
focus->HandleWindowEvent( keyEvent );
}
}
return;
return;
}
}
// Store the selected position, so it can be checked by the tools