+ switch ( event.GetCode() )
+ {
+ case 'c':
+ {
+ wxListItem info;
+ info.m_itemId = event.GetIndex();
+ GetItem(info);
+
+ wxListItemAttr *attr = info.GetAttributes();
+ if ( !attr || !attr->HasTextColour() )
+ {
+ info.SetTextColour(*wxCYAN);
+
+ SetItem(info);
+ }
+ }
+ break;
+
+ case WXK_DELETE:
+ {
+ long item = GetNextItem(-1,
+ wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ while ( item != -1 )
+ {
+ DeleteItem(item);
+
+ wxLogMessage(_T("Item %ld deleted"), item);
+
+ // -1 because the indices were shifted by DeleteItem()
+ item = GetNextItem(item - 1,
+ wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
+ }
+ }
+ break;
+
+ case WXK_INSERT:
+ if ( GetWindowStyle() & wxLC_REPORT )
+ {
+ if ( GetWindowStyle() & wxLC_VIRTUAL )
+ {
+ SetItemCount(GetItemCount() + 1);
+ }
+ else // !virtual
+ {
+ InsertItemInReportView(event.GetIndex());
+ }
+ }
+ //else: fall through
+
+ default:
+ LogEvent(event, _T("OnListKeyDown"));
+
+ event.Skip();
+ }
+}
+
+void MyListCtrl::OnChar(wxKeyEvent& event)
+{
+ wxLogMessage(_T("Got char event."));
+
+ event.Skip();