]> git.saurik.com Git - wxWidgets.git/commitdiff
Eats EVT_CHAR events for WXK_ESCAPE, WXK_TAB, and WXK_RETURN since
authorRobin Dunn <robin@alldunn.com>
Wed, 16 Feb 2000 20:54:27 +0000 (20:54 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 16 Feb 2000 20:54:27 +0000 (20:54 +0000)
they are handled in EVT_KEY_DOWN.  It also gets rid of the annoying
bell on MSW for the return key.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index d7c6bf2daadbd354adf80b64a7914c4cc10c45b9..7e0d05e7d3d30bfba8ea0f0492a101ebf136bc87 100644 (file)
@@ -182,6 +182,7 @@ public:
         { }
 
     void OnKeyDown(wxKeyEvent& event);
+    void OnChar(wxKeyEvent& event);
 
 private:
     wxGrid*             m_grid;
@@ -194,6 +195,7 @@ private:
 IMPLEMENT_DYNAMIC_CLASS( wxGridCellEditorEvtHandler, wxEvtHandler )
 BEGIN_EVENT_TABLE( wxGridCellEditorEvtHandler, wxEvtHandler )
     EVT_KEY_DOWN( wxGridCellEditorEvtHandler::OnKeyDown )
+    EVT_CHAR( wxGridCellEditorEvtHandler::OnChar )
 END_EVENT_TABLE()
 
 
@@ -492,6 +494,20 @@ void wxGridCellEditorEvtHandler::OnKeyDown(wxKeyEvent& event)
     }
 }
 
+void wxGridCellEditorEvtHandler::OnChar(wxKeyEvent& event)
+{
+    switch ( event.KeyCode() )
+    {
+        case WXK_ESCAPE:
+        case WXK_TAB:
+        case WXK_RETURN:
+            break;
+
+        default:
+            event.Skip();
+    }
+}
+
 // ----------------------------------------------------------------------------
 // wxGridCellRenderer
 // ----------------------------------------------------------------------------