Listctrl should now send char and key_down events.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2510 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1999-05-19 10:46:48 +00:00
parent ea5c6ca7f7
commit 3dfb93fd82
2 changed files with 23 additions and 2 deletions

View File

@ -481,6 +481,7 @@ class WXDLLEXPORT wxListMainWindow: public wxScrolledWindow
void MoveToFocus( void );
void OnArrowChar( wxListLineData *newCurrent, bool shiftDown );
void OnChar( wxKeyEvent &event );
void OnKeyDown( wxKeyEvent &event );
void OnSetFocus( wxFocusEvent &event );
void OnKillFocus( wxFocusEvent &event );
void OnSize( wxSizeEvent &event );

View File

@ -942,6 +942,7 @@ BEGIN_EVENT_TABLE(wxListMainWindow,wxScrolledWindow)
EVT_SIZE (wxListMainWindow::OnSize)
EVT_MOUSE_EVENTS (wxListMainWindow::OnMouse)
EVT_CHAR (wxListMainWindow::OnChar)
EVT_KEY_DOWN (wxListMainWindow::OnKeyDown)
EVT_SET_FOCUS (wxListMainWindow::OnSetFocus)
EVT_KILL_FOCUS (wxListMainWindow::OnKillFocus)
END_EVENT_TABLE()
@ -1381,6 +1382,25 @@ void wxListMainWindow::OnArrowChar( wxListLineData *newCurrent, bool shiftDown )
UnfocusLine( oldCurrent );
}
void wxListMainWindow::OnKeyDown( wxKeyEvent &event )
{
wxWindow *parent = GetParent();
/* we propagate the key event up */
wxKeyEvent ke( wxEVT_KEY_DOWN );
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();
@ -1391,8 +1411,8 @@ void wxListMainWindow::OnChar( wxKeyEvent &event )
le.SetEventObject( parent );
parent->GetEventHandler()->ProcessEvent( le );
/* we propagate the key event up */
wxKeyEvent ke( wxEVT_KEY_DOWN );
/* we propagate the char event up */
wxKeyEvent ke( wxEVT_CHAR );
ke.m_shiftDown = event.m_shiftDown;
ke.m_controlDown = event.m_controlDown;
ke.m_altDown = event.m_altDown;