X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/907789a0f72354f30ec04f79f03a0b7e2a29ac9a..7e616b1050e4aaa4b8468d82ddf5b85d46412a3c:/samples/listctrl/listtest.cpp?ds=sidebyside diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index cd7686f53b..8f17b941d9 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -55,7 +55,8 @@ BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl) EVT_LIST_SET_INFO(LIST_CTRL, MyListCtrl::OnSetInfo) EVT_LIST_ITEM_SELECTED(LIST_CTRL, MyListCtrl::OnSelected) EVT_LIST_ITEM_DESELECTED(LIST_CTRL, MyListCtrl::OnDeselected) - EVT_LIST_KEY_DOWN(LIST_CTRL, MyListCtrl::OnKeyDown) + EVT_LIST_KEY_DOWN(LIST_CTRL, MyListCtrl::OnListKeyDown) + EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, MyListCtrl::OnActivated) END_EVENT_TABLE() IMPLEMENT_APP(MyApp) @@ -374,7 +375,7 @@ void MyListCtrl::OnDeleteItem(wxListEvent& WXUNUSED(event)) text->WriteText("OnDeleteItem\n"); } -void MyListCtrl::OnGetInfo(wxListEvent& event) +void MyListCtrl::OnGetInfo(wxListEvent& /*event*/) { if ( !wxGetApp().GetTopWindow() ) return; @@ -449,7 +450,7 @@ void MyListCtrl::OnDeselected(wxListEvent& WXUNUSED(event)) text->WriteText("OnDeselected\n"); } -void MyListCtrl::OnKeyDown(wxListEvent& WXUNUSED(event)) +void MyListCtrl::OnActivated(wxListEvent& WXUNUSED(event)) { if ( !wxGetApp().GetTopWindow() ) return; @@ -458,6 +459,19 @@ void MyListCtrl::OnKeyDown(wxListEvent& WXUNUSED(event)) if ( !text ) return; - text->WriteText("OnKeyDown\n"); + text->WriteText("OnActivated\n"); } +void MyListCtrl::OnListKeyDown(wxListEvent& WXUNUSED(event)) +{ + if ( !wxGetApp().GetTopWindow() ) + return; + + wxTextCtrl *text = ((MyFrame *)wxGetApp().GetTopWindow())->m_logWindow; + if ( !text ) + return; + + text->WriteText("OnListKeyDown\n"); +} + +