From: Kevin Ollivier Date: Sun, 31 Dec 2006 06:03:51 +0000 (+0000) Subject: Make sure mouse events are only sent in the case of the native control. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1a4b6b97b1141a81a129baa34a50d2835d5ec003 Make sure mouse events are only sent in the case of the native control. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 4054da540d..9cfef3b8d6 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -622,13 +622,15 @@ void wxListCtrl::OnDblClick(wxMouseEvent& event) #if wxABI_VERSION >= 20801 void wxListCtrl::OnRightDown(wxMouseEvent& event) { - FireMouseEvent(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition()); + if (m_dbImpl) + FireMouseEvent(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition()); event.Skip(); } void wxListCtrl::OnMiddleDown(wxMouseEvent& event) { - FireMouseEvent(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, event.GetPosition()); + if (m_dbImpl) + FireMouseEvent(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, event.GetPosition()); event.Skip(); } @@ -656,20 +658,23 @@ void wxListCtrl::FireMouseEvent(wxEventType eventType, wxPoint position) void wxListCtrl::OnChar(wxKeyEvent& event) { - 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_dbImpl) { - le.m_itemIndex = m_current; - if (!IsVirtual()) + wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetId() ); + le.SetEventObject(this); + le.m_code = event.GetKeyCode(); + le.m_itemIndex = -1; + + if (m_current != -1) { - le.m_item.m_itemId = m_current; - GetItem(le.m_item); + le.m_itemIndex = m_current; + if (!IsVirtual()) + { + le.m_item.m_itemId = m_current; + GetItem(le.m_item); + } + GetEventHandler()->ProcessEvent(le); } - GetEventHandler()->ProcessEvent(le); } event.Skip(); }