From: Julian Smart Date: Mon, 27 Aug 2007 08:22:12 +0000 (+0000) Subject: Only show the context menu if the event belongs to this window X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b4ae0def641ce0366e3946e546e1aaf2b7e6b821?ds=inline Only show the context menu if the event belongs to this window git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index bf06f72f30..caf9d338d8 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -2527,8 +2527,14 @@ void wxRichTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event) event.Enable(GetLastPosition() > 0); } -void wxRichTextCtrl::OnContextMenu(wxContextMenuEvent& WXUNUSED(event)) +void wxRichTextCtrl::OnContextMenu(wxContextMenuEvent& event) { + if (event.GetEventObject() != this) + { + event.Skip(); + return; + } + if (!m_contextMenu) { m_contextMenu = new wxMenu;