From 5fbe3cab7600d40f5f4dcd952c83b2f1b749d74e Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 1 Nov 2018 18:11:57 +0100 Subject: [PATCH] Don't reset wxPGProperty editor if focus is switched between its components As long as focus is being switched only between subcontrols of the active editor the state of the edited wxPGProperty remains unchanged and there is no need to explicitly reset the editor. Unwanted editor resets could happen if such internal focus changes would be captured in EVT_IDLE handler. Closes #18162. --- .editorconfig | 2 +- src/propgrid/propgrid.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index e980c39bd4..2ab7c9a47f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ root = true [*] charset = utf-8 -end_of_line = lf +end_of_line = crlf insert_final_newline = true indent_style = space indent_size = 4 diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 1fa1201b27..6fb3782835 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5961,6 +5961,11 @@ void wxPropertyGrid::HandleFocusChange( wxWindow* newFocused ) { if ( parent == wndEditor ) { + // If editor is active consider focus set on its components + // as a focus set on the editor itself (to prevent doing actions + // when focus is switched between subcontrols of a compound + // editor like e.g. wxComboCtrl). + newFocused = wndEditor; wasEditorFocused = true; } // Use m_eventObject, which is either wxPropertyGrid or