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
This commit is contained in:
Kevin Ollivier 2006-12-31 06:03:51 +00:00
parent 7528971e6b
commit 1a4b6b97b1

View File

@ -622,13 +622,15 @@ void wxListCtrl::OnDblClick(wxMouseEvent& event)
#if wxABI_VERSION >= 20801 #if wxABI_VERSION >= 20801
void wxListCtrl::OnRightDown(wxMouseEvent& event) 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(); event.Skip();
} }
void wxListCtrl::OnMiddleDown(wxMouseEvent& event) 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(); event.Skip();
} }
@ -656,20 +658,23 @@ void wxListCtrl::FireMouseEvent(wxEventType eventType, wxPoint position)
void wxListCtrl::OnChar(wxKeyEvent& event) void wxListCtrl::OnChar(wxKeyEvent& event)
{ {
wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetId() ); if (m_dbImpl)
le.SetEventObject(this);
le.m_code = event.GetKeyCode();
le.m_itemIndex = -1;
if (m_current != -1)
{ {
le.m_itemIndex = m_current; wxListEvent le( wxEVT_COMMAND_LIST_KEY_DOWN, GetId() );
if (!IsVirtual()) le.SetEventObject(this);
le.m_code = event.GetKeyCode();
le.m_itemIndex = -1;
if (m_current != -1)
{ {
le.m_item.m_itemId = m_current; le.m_itemIndex = m_current;
GetItem(le.m_item); if (!IsVirtual())
{
le.m_item.m_itemId = m_current;
GetItem(le.m_item);
}
GetEventHandler()->ProcessEvent(le);
} }
GetEventHandler()->ProcessEvent(le);
} }
event.Skip(); event.Skip();
} }