]> git.saurik.com Git - wxWidgets.git/commitdiff
Propagate key up events to the wxGenericListCtrl parent, like we do with key down...
authorKevin Ollivier <kevino@theolliviers.com>
Tue, 28 Nov 2006 04:52:21 +0000 (04:52 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Tue, 28 Nov 2006 04:52:21 +0000 (04:52 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index 3bda4a220f1c71f0d6adf35f144f68318c8c221f..40a79102d5a9defeaaacebcd9cf5965bfe4a9fc6 100644 (file)
@@ -609,6 +609,7 @@ public:
 
     void OnChar( wxKeyEvent &event );
     void OnKeyDown( wxKeyEvent &event );
+    void OnKeyUp( wxKeyEvent &event );
     void OnSetFocus( wxFocusEvent &event );
     void OnKillFocus( wxFocusEvent &event );
     void OnScroll( wxScrollWinEvent& event );
@@ -2233,6 +2234,7 @@ BEGIN_EVENT_TABLE(wxListMainWindow,wxScrolledWindow)
   EVT_MOUSE_EVENTS   (wxListMainWindow::OnMouse)
   EVT_CHAR           (wxListMainWindow::OnChar)
   EVT_KEY_DOWN       (wxListMainWindow::OnKeyDown)
+  EVT_KEY_UP         (wxListMainWindow::OnKeyUp)      
   EVT_SET_FOCUS      (wxListMainWindow::OnSetFocus)
   EVT_KILL_FOCUS     (wxListMainWindow::OnKillFocus)
   EVT_SCROLLWIN      (wxListMainWindow::OnScroll)
@@ -3309,6 +3311,25 @@ void wxListMainWindow::OnKeyDown( wxKeyEvent &event )
     event.Skip();
 }
 
+void wxListMainWindow::OnKeyUp( wxKeyEvent &event )
+{
+    wxWindow *parent = GetParent();
+
+    // propagate the key event upwards
+    wxKeyEvent ke( wxEVT_KEY_UP );
+    ke.m_shiftDown = event.m_shiftDown;
+    ke.m_controlDown = event.m_controlDown;
+    ke.m_altDown = event.m_altDown;
+    ke.m_metaDown = event.m_metaDown;
+    ke.m_keyCode = event.m_keyCode;
+    ke.m_x = event.m_x;
+    ke.m_y = event.m_y;
+    ke.SetEventObject( parent );
+    if (parent->GetEventHandler()->ProcessEvent( ke )) return;
+
+    event.Skip();
+}
+
 void wxListMainWindow::OnChar( wxKeyEvent &event )
 {
     wxWindow *parent = GetParent();