From 6861a15607ace53a0965b0cf8cc72aea8c2f2a62 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 17 Mar 2017 17:15:06 +0100 Subject: [PATCH] Handle EVT_CONTEXT_MENU directly in wxSTC (wxGTK) A simulation of context menu event by handling directly EVT_RIGHT_UP was implemented in wxSTC in ddf2da08b5, but later on, EVT_CONTEXT_MENU generation in wxGTK was fixed in ac103441d1 so simulation is no longer necessary and this event can be directly handled in wxSTC. --- src/stc/stc.cpp | 4 ++-- src/stc/stc.cpp.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index f67ee92846..3e6a563569 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -151,7 +151,7 @@ wxBEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl) EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown) EVT_MOTION (wxStyledTextCtrl::OnMouseMove) EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp) -#if defined(__WXGTK__) || defined(__WXMAC__) +#if defined(__WXMAC__) EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp) #else EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu) @@ -5210,7 +5210,7 @@ void wxStyledTextCtrl::OnMouseRightDown(wxMouseEvent& evt) { m_swx->DoRightButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(), evt.ShiftDown(), evt.ControlDown(), evt.AltDown()); // we need to call evt.Skip() to ensure the context menu event - // is generated with wxGTK and wxOSX + // is generated with wxOSX evt.Skip(); } diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 77208d0132..b96ce08314 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -151,7 +151,7 @@ wxBEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl) EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown) EVT_MOTION (wxStyledTextCtrl::OnMouseMove) EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp) -#if defined(__WXGTK__) || defined(__WXMAC__) +#if defined(__WXMAC__) EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp) #else EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu) @@ -725,7 +725,7 @@ void wxStyledTextCtrl::OnMouseRightDown(wxMouseEvent& evt) { m_swx->DoRightButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(), evt.ShiftDown(), evt.ControlDown(), evt.AltDown()); // we need to call evt.Skip() to ensure the context menu event - // is generated with wxGTK and wxOSX + // is generated with wxOSX evt.Skip(); }