]> git.saurik.com Git - wxWidgets.git/commitdiff
Do not propagate key events from child controls unless they have modifiers
authorJaakko Salli <jaakko.salli@dnainternet.net>
Thu, 29 Jan 2009 17:43:35 +0000 (17:43 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Thu, 29 Jan 2009 17:43:35 +0000 (17:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/propgrid.cpp

index 56738c1635af53778c551d8e9ab3dbbb50aa27f4..764f7e820e10ff27871e4fb20dff812eec8f46be 100644 (file)
@@ -4832,6 +4832,11 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )
     // Except for TAB and ESC, handle child control events in child control
     if ( fromChild )
     {
+        // Only propagate event if it had modifiers
+        if ( !event.HasModifiers() )
+        {
+            event.StopPropagation();
+        }
         event.Skip();
         return;
     }
@@ -4905,6 +4910,19 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild )
 
 void wxPropertyGrid::OnKey( wxKeyEvent &event )
 {
+    // If there was editor open and focused, then this event should not
+    // really be processed here.
+    if ( IsEditorFocused() )
+    {
+        // However, if event had modifiers, it is probably still best
+        // to skip it.
+        if ( event.HasModifiers() )
+            event.Skip();
+        else
+            event.StopPropagation();
+        return;
+    }
+
     HandleKeyEvent(event, false);
 }