From 4e2d26b22eca8ac0f90c07a9c631b8b2a9eee933 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 11 Nov 2018 11:19:29 +0100 Subject: [PATCH] Keep wxPGProperty editor focused while refreshing the property Active property's editor should remain focused after refreshing the property. --- src/propgrid/propgrid.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index e4e4639084..fc76cfb8e0 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2590,7 +2590,11 @@ void wxPropertyGrid::RefreshProperty( wxPGProperty* p ) { // NB: We must copy the selection. wxArrayPGProperty selection = m_pState->m_selection; - DoSetSelection(selection, wxPG_SEL_FORCE); + int selFlags = wxPG_SEL_FORCE; + // We want to keep property's editor focused. + if ( IsEditorFocused() ) + selFlags |= wxPG_SEL_FOCUS; + DoSetSelection(selection, selFlags); } DrawItemAndChildren(p);