From b4ae0def641ce0366e3946e546e1aaf2b7e6b821 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 27 Aug 2007 08:22:12 +0000 Subject: [PATCH] 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 --- src/richtext/richtextctrl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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;