Applied patch #421554: implementation of wxEVT_CONTEXT_MENU

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-05-16 11:32:21 +00:00
parent f80eabe5a2
commit 69231000be
3 changed files with 56 additions and 1 deletions

View File

@@ -2226,10 +2226,29 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
wxHelpEvent helpEvent(wxEVT_HELP, info->iCtrlId) ;
helpEvent.SetEventObject(this);
processed = GetEventHandler()->ProcessEvent(helpEvent);
}
else processed = FALSE;
break;
}
case WM_CONTEXTMENU:
{
HWND hWnd = (HWND) wParam;
// we don't convert from screen to client coordinates as
// the event may be handled by a parent window
wxPoint p(LOWORD(lParam), HIWORD(lParam));
wxContextMenuEvent contextEvent(wxEVT_CONTEXT_MENU, GetId(), p);
GetEventHandler()->ProcessEvent(contextEvent);
// set processed to true even if the event is not handled because if we don't
// windows will propogate the WM_CONTEXTMENU up the parent window chain, which
// we have already done ourselves.
processed = true;
break;
}
#endif
}