Unfocus text editor when enter is pressed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -155,6 +155,12 @@ public:
|
|||||||
|
|
||||||
/** Handles events. Returns true if value in control was modified
|
/** Handles events. Returns true if value in control was modified
|
||||||
(see wxPGProperty::OnEvent for more information).
|
(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,
|
virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property,
|
||||||
wxWindow* wnd_primary, wxEvent& event ) const = 0;
|
wxWindow* wnd_primary, wxEvent& event ) const = 0;
|
||||||
|
@@ -102,6 +102,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
Handles events. Returns @true if value in control was modified
|
Handles events. Returns @true if value in control was modified
|
||||||
(see wxPGProperty::OnEvent() for more information).
|
(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,
|
virtual bool OnEvent( wxPropertyGrid* propgrid, wxPGProperty* property,
|
||||||
wxWindow* wnd_primary, wxEvent& event ) const = 0;
|
wxWindow* wnd_primary, wxEvent& event ) const = 0;
|
||||||
|
@@ -3257,6 +3257,14 @@ void wxPropertyGrid::OnCustomEditorEvent( wxCommandEvent &event )
|
|||||||
|
|
||||||
DoPropertyChanged(selected, selFlags);
|
DoPropertyChanged(selected, selFlags);
|
||||||
EditorsValueWasNotModified();
|
EditorsValueWasNotModified();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Regardless of editor type, unfocus editor on
|
||||||
|
// text-editing related enter press.
|
||||||
|
if ( event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER )
|
||||||
|
{
|
||||||
|
SetFocusOnCanvas();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user