Set position for wxEVT_DATAVIEW_ITEM_CONTEXT_MENU with generic wxDataViewCtrl

See #19188
This commit is contained in:
Paul Cornett 2021-12-22 17:24:06 -08:00
parent aacada0ea2
commit 3611a41e07

View File

@ -4988,6 +4988,11 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
if (event.RightUp()) if (event.RightUp())
{ {
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, m_owner, col, item); wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, m_owner, col, item);
int xx = event.GetX();
int yy = event.GetY();
ClientToScreen(&xx, &yy);
m_owner->ScreenToClient(&xx, &yy);
le.SetPosition(xx, yy);
m_owner->ProcessWindowEvent(le); m_owner->ProcessWindowEvent(le);
return; return;
} }