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.
This commit is contained in:
Artur Wieczorek 2017-03-17 17:15:06 +01:00
parent c8cb673aa2
commit 6861a15607
2 changed files with 4 additions and 4 deletions

View File

@ -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();
}

View File

@ -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();
}