From 26f60eb6a4944750bc45ace8873545a98b5b6f06 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Feb 2005 17:27:30 +0000 Subject: [PATCH] don't steal EVT_RIGHT_UP in rich edit controls for context menu (patch 1143823) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32198 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/textctrl.h | 2 +- src/msw/textctrl.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index e19c77eb7d..3f09055cdf 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -188,7 +188,7 @@ public: // Show a context menu for Rich Edit controls (the standard // EDIT control has one already) - void OnRightClick(wxMouseEvent& event); + void OnContextMenu(wxContextMenuEvent& event); // be sure the caret remains invisible if the user // called HideNativeCaret() before diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 1a072cfae3..2f4136d212 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -212,7 +212,7 @@ BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) EVT_DROP_FILES(wxTextCtrl::OnDropFiles) #if wxUSE_RICHEDIT - EVT_RIGHT_UP(wxTextCtrl::OnRightClick) + EVT_CONTEXT_MENU(wxTextCtrl::OnContextMenu) #endif EVT_MENU(wxID_CUT, wxTextCtrl::OnCut) @@ -2030,7 +2030,7 @@ void wxTextCtrl::OnUpdateSelectAll(wxUpdateUIEvent& event) event.Enable(GetLastPosition() > 0); } -void wxTextCtrl::OnRightClick(wxMouseEvent& event) +void wxTextCtrl::OnContextMenu(wxContextMenuEvent& event) { #if wxUSE_RICHEDIT if (IsRich()) @@ -2048,7 +2048,7 @@ void wxTextCtrl::OnRightClick(wxMouseEvent& event) m_privateContextMenu->AppendSeparator(); m_privateContextMenu->Append(wxID_SELECTALL, _("Select &All")); } - PopupMenu(m_privateContextMenu, event.GetPosition()); + PopupMenu(m_privateContextMenu); return; } else -- 2.45.2