diff --git a/interface/wx/stc/stc.h b/interface/wx/stc/stc.h index e70954a4af..bb4f58b81d 100644 --- a/interface/wx/stc/stc.h +++ b/interface/wx/stc/stc.h @@ -6413,6 +6413,10 @@ public: The input should be one of the @link wxStyledTextCtrl::wxSTC_POPUP_NEVER wxSTC_POPUP_* @endlink constants. + @remarks + When wxContextMenuEvent is used to create a custom popup menu, + this function should be called with wxSTC_POPUP_NEVER. Otherwise both + the custom and the default popup menus may be shown. */ void UsePopUp(int popUpMode); diff --git a/src/stc/gen_docs.py b/src/stc/gen_docs.py index c9faa01003..0af91aaad5 100644 --- a/src/stc/gen_docs.py +++ b/src/stc/gen_docs.py @@ -1258,7 +1258,11 @@ extendedDocs = { 'UsePopUp': ('The input should be one of the', - '@link wxStyledTextCtrl::wxSTC_POPUP_NEVER wxSTC_POPUP_* @endlink constants.',), + '@link wxStyledTextCtrl::wxSTC_POPUP_NEVER wxSTC_POPUP_* @endlink constants.', + '@remarks', + 'When wxContextMenuEvent is used to create a custom popup menu,', + 'this function should be called with wxSTC_POPUP_NEVER. Otherwise both', + 'the custom and the default popup menus may be shown.',), 'PropertyType': ('The return value will be one of the', diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 73883a3bd5..3ababf3240 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -5260,6 +5260,9 @@ void wxStyledTextCtrl::OnMouseRightDown(wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); 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 + evt.Skip(); } void wxStyledTextCtrl::OnMouseMove(wxMouseEvent& evt) { diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index d45eaf67a6..42c3a6ccb2 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -726,6 +726,9 @@ void wxStyledTextCtrl::OnMouseRightDown(wxMouseEvent& evt) { wxPoint pt = evt.GetPosition(); 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 + evt.Skip(); } void wxStyledTextCtrl::OnMouseMove(wxMouseEvent& evt) {