+#if wxABI_VERSION >= 20801
+void wxListCtrl::OnRightDown(wxMouseEvent& event)
+{
+ if (m_dbImpl)
+ FireMouseEvent(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition());
+ event.Skip();
+}
+
+void wxListCtrl::OnMiddleDown(wxMouseEvent& event)
+{
+ if (m_dbImpl)
+ FireMouseEvent(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, event.GetPosition());
+ event.Skip();
+}
+
+void wxListCtrl::FireMouseEvent(wxEventType eventType, wxPoint position)
+{
+ wxListEvent le( eventType, GetId() );
+ le.SetEventObject(this);
+ le.m_pointDrag = position;
+ le.m_itemIndex = -1;
+
+ int flags;
+ long item = HitTest(position, flags);
+ if (flags & wxLIST_HITTEST_ONITEM)
+ {
+ le.m_itemIndex = item;
+ le.m_item.m_itemId = item;
+ GetItem(le.m_item);
+ HandleWindowEvent(le);
+ }
+}
+
+void wxListCtrl::OnChar(wxKeyEvent& event)
+{
+
+
+ if (m_dbImpl)
+ {
+ wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetId() );
+ le.SetEventObject(this);
+ le.m_code = event.GetKeyCode();
+ le.m_itemIndex = -1;
+
+ if (m_current == -1)
+ {
+ // if m_current isn't set, check if there's been a selection
+ // made before continuing
+ m_current = GetNextItem(-1, wxLIST_NEXT_BELOW, wxLIST_STATE_SELECTED);
+ }
+
+ // We need to determine m_current ourselves when navigation keys
+ // are used. Note that PAGEUP and PAGEDOWN do not alter the current
+ // item on native Mac ListCtrl, so we only handle up and down keys.
+ switch ( event.GetKeyCode() )
+ {
+ case WXK_UP:
+ if ( m_current > 0 )
+ m_current -= 1;
+ else
+ m_current = 0;
+
+ break;
+
+ case WXK_DOWN:
+ if ( m_current < GetItemCount() - 1 )
+ m_current += 1;
+ else
+ m_current = GetItemCount() - 1;
+
+ break;
+ }
+
+ if (m_current != -1)
+ {
+ le.m_itemIndex = m_current;
+ le.m_item.m_itemId = m_current;
+ GetItem(le.m_item);
+ HandleWindowEvent(le);
+ }
+ }
+ event.Skip();
+}
+#endif
+