From 55da8a0f8660e8a746443d57d592b656a0418191 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 28 Dec 2014 20:06:35 +0000 Subject: [PATCH] Pass outside wxPG a modified clone of wxEVT_TEXT event instead of hacking current event object. Using a clone of event (with PG id) instead of replacing id in the currently processed event coming from wxPGTextCtrlEditor seems to be less intrusive and safer action. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/editors.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index be733b2932..923a434704 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -406,14 +406,12 @@ bool wxPGTextCtrlEditor::OnTextCtrlEvent( wxPropertyGrid* propGrid, } else if ( event.GetEventType() == wxEVT_TEXT ) { - // - // Pass this event outside wxPropertyGrid so that, - // if necessary, program can tell when user is editing - // a textctrl. - // FIXME: Is it safe to change event id in the middle of event - // processing (seems to work, but...)? - event.Skip(); - event.SetId(propGrid->GetId()); + // Pass this event (with PG id) outside wxPropertyGrid + // with so that, if necessary, program can tell when user + // is editing a textctrl. + wxEvent *evt = event.Clone(); + evt->SetId(propGrid->GetId()); + propGrid->GetEventHandler()->QueueEvent(evt); propGrid->EditorsValueWasModified(); }