-// Potentially handles a keyboard event for editor controls.
-// Returns false if event should *not* be skipped (on true it can
-// be optionally skipped).
-// Basicly, false means that SelectProperty was called (or was about
-// to be called, if canDestroy was false).
-bool wxPropertyGrid::HandleChildKey( wxKeyEvent& event )
-{
- bool res = true;
-
- if ( !m_selected || !m_wndEditor )
- {
- return true;
- }
-
- int action = KeyEventToAction(event);
-
- // Unfocus?
- if ( action == wxPG_ACTION_CANCEL_EDIT )
- {
- //
- // Esc cancels any changes
- if ( IsEditorsValueModified() )
- {
- EditorsValueWasNotModified();
-
- // Update the control as well
- m_selected->GetEditorClass()->SetControlStringValue( m_selected,
- GetEditorControl(),
- m_selected->GetDisplayedString() );
- }
-
- OnValidationFailureReset(m_selected);
-
- res = false;
- UnfocusEditor();
- }
-
- return res;
-}
-
-// -----------------------------------------------------------------------
-