From 372d0bdd67de0fe30cefb231acaeccea5d38ebba Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Sat, 12 Jun 2010 09:47:25 +0000 Subject: [PATCH] Keyboard handling was blocked by label editor. Also try to maintain label editor focus state when navigating between properties. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/propgrid.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 1500ccc376..f734d40507 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1022,14 +1022,13 @@ void wxPropertyGrid::OnLabelEditorKeyPress( wxKeyEvent& event ) { int keycode = event.GetKeyCode(); - // If key code was registered as action trigger, then trigger that action if ( keycode == WXK_ESCAPE ) { DoEndLabelEdit(false); } else { - event.Skip(); + HandleKeyEvent(event, true); } } @@ -5612,11 +5611,26 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild ) p = wxPropertyGridIterator::OneStep( m_pState, wxPG_ITERATE_VISIBLE, p, selectDir ); if ( p ) { - // If editor was focused, then make the next editor focused as well int selFlags = 0; + int reopenLabelEditorCol = -1; + if ( editorFocused ) + { + // If editor was focused, then make the next editor + // focused as well selFlags |= wxPG_SEL_FOCUS; + } + else + { + // Also maintain the same label editor focus state + if ( m_labelEditor ) + reopenLabelEditorCol = m_selColumn; + } + DoSelectProperty(p, selFlags); + + if ( reopenLabelEditorCol >= 0 ) + DoBeginLabelEdit(reopenLabelEditorCol); } wasHandled = true; }