Let wxListCtrl generate the context menu event itself
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48784 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3105,8 +3105,13 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
|
|||||||
if (event.RightDown())
|
if (event.RightDown())
|
||||||
{
|
{
|
||||||
SendNotify( (size_t) -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() );
|
SendNotify( (size_t) -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() );
|
||||||
// Allow generation of context menu event
|
|
||||||
event.Skip();
|
wxContextMenuEvent evtCtx(
|
||||||
|
wxEVT_CONTEXT_MENU,
|
||||||
|
GetParent()->GetId(),
|
||||||
|
ClientToScreen(event.GetPosition()));
|
||||||
|
evtCtx.SetEventObject(GetParent());
|
||||||
|
GetParent()->GetEventHandler()->ProcessEvent(evtCtx);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3193,8 +3198,12 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
|
|||||||
|
|
||||||
SendNotify( current, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() );
|
SendNotify( current, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, event.GetPosition() );
|
||||||
|
|
||||||
// Allow generation of context menu event
|
wxContextMenuEvent evtCtx(
|
||||||
event.Skip();
|
wxEVT_CONTEXT_MENU,
|
||||||
|
GetParent()->GetId(),
|
||||||
|
ClientToScreen(event.GetPosition()));
|
||||||
|
evtCtx.SetEventObject(GetParent());
|
||||||
|
GetParent()->GetEventHandler()->ProcessEvent(evtCtx);
|
||||||
}
|
}
|
||||||
else if (event.MiddleDown())
|
else if (event.MiddleDown())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user