Fix navigating through wxPropertyGrid with wxPG_ACTION_EDIT

wxPG_ACTION_EDIT should not be considered done when wxPGProperty is
not editable (i.e. is disabled, read-only, is a wxPropertyCategory)
to prevent from blocking secondary actions (like
wxPG_ACTION_NEXT_PROPERTY) in this case.

Closes #19060.
This commit is contained in:
Artur Wieczorek
2021-01-28 19:13:09 +01:00
parent e7206701c5
commit 914cc63d32

View File

@@ -5733,8 +5733,12 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )
if ( action == wxPG_ACTION_EDIT && !editorFocused ) if ( action == wxPG_ACTION_EDIT && !editorFocused )
{ {
DoSelectProperty( p, wxPG_SEL_FOCUS ); // Mark as handled only for editable property
wasHandled = true; if ( !p->IsCategory() && p->IsEnabled() && !p->HasFlag(wxPG_PROP_READONLY) )
{
DoSelectProperty( p, wxPG_SEL_FOCUS );
wasHandled = true;
}
} }
// Travel and expand/collapse // Travel and expand/collapse
@@ -5774,10 +5778,10 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )
int selFlags = 0; int selFlags = 0;
int reopenLabelEditorCol = -1; int reopenLabelEditorCol = -1;
if ( editorFocused ) if ( action == wxPG_ACTION_EDIT )
{ {
// If editor was focused, then make the next editor // Make the next editor focused as well
// focused as well // if we are actually going to edit the property.
selFlags |= wxPG_SEL_FOCUS; selFlags |= wxPG_SEL_FOCUS;
} }
else else