diff --git a/include/wx/propgrid/editors.h b/include/wx/propgrid/editors.h index d07e7adf0d..0d6ff4db6e 100644 --- a/include/wx/propgrid/editors.h +++ b/include/wx/propgrid/editors.h @@ -155,6 +155,12 @@ public: /** Handles events. Returns true if value in control was modified (see wxPGProperty::OnEvent for more information). + + @remarks wxPropertyGrid will automatically unfocus the editor when + wxEVT_COMMAND_TEXT_ENTER is received and when it results in + property value being modified. This happens regardless of + editor type (ie. behavior is same for any wxTextCtrl and + wxComboBox based editor). */ virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd_primary, wxEvent& event ) const = 0; diff --git a/interface/wx/propgrid/editors.h b/interface/wx/propgrid/editors.h index 77ae7bf005..5e121e1432 100644 --- a/interface/wx/propgrid/editors.h +++ b/interface/wx/propgrid/editors.h @@ -102,6 +102,12 @@ public: /** Handles events. Returns @true if value in control was modified (see wxPGProperty::OnEvent() for more information). + + @remarks wxPropertyGrid will automatically unfocus the editor when + wxEVT_COMMAND_TEXT_ENTER is received and when it results in + property value being modified. This happens regardless of + editor type (ie. behavior is same for any wxTextCtrl and + wxComboBox based editor). */ virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property, wxWindow* wnd_primary, wxEvent& event ) const = 0; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 1e4850c31c..ad2faab46f 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3257,6 +3257,14 @@ void wxPropertyGrid::OnCustomEditorEvent( wxCommandEvent &event ) DoPropertyChanged(selected, selFlags); EditorsValueWasNotModified(); + + // + // Regardless of editor type, unfocus editor on + // text-editing related enter press. + if ( event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER ) + { + SetFocusOnCanvas(); + } } else {