Fix regression in mouse click event handling in wxSTC

In EVT_RIGHT_DOWN event handler introduced in 68888ca0a2 we need to propagate event to process it further in EVT_RIGHT_UP handler. This is important especially for wxGTK and wxOSX where EVT_RIGHT_UP is used to generate a context menu event.

Closes #17817.
This commit is contained in:
New Pagodi
2017-03-12 17:03:35 +01:00
committed by Artur Wieczorek
parent edb72282a4
commit 187c4692c8
4 changed files with 15 additions and 1 deletions

View File

@@ -6413,6 +6413,10 @@ public:
The input should be one of the 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.
*/ */
void UsePopUp(int popUpMode); void UsePopUp(int popUpMode);

View File

@@ -1258,7 +1258,11 @@ extendedDocs = {
'UsePopUp': 'UsePopUp':
('The input should be one of the', ('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': 'PropertyType':
('The return value will be one of the', ('The return value will be one of the',

View File

@@ -5260,6 +5260,9 @@ void wxStyledTextCtrl::OnMouseRightDown(wxMouseEvent& evt) {
wxPoint pt = evt.GetPosition(); wxPoint pt = evt.GetPosition();
m_swx->DoRightButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(), m_swx->DoRightButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(),
evt.ShiftDown(), evt.ControlDown(), evt.AltDown()); 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) { void wxStyledTextCtrl::OnMouseMove(wxMouseEvent& evt) {

View File

@@ -726,6 +726,9 @@ void wxStyledTextCtrl::OnMouseRightDown(wxMouseEvent& evt) {
wxPoint pt = evt.GetPosition(); wxPoint pt = evt.GetPosition();
m_swx->DoRightButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(), m_swx->DoRightButtonDown(Point(pt.x, pt.y), m_stopWatch.Time(),
evt.ShiftDown(), evt.ControlDown(), evt.AltDown()); 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) { void wxStyledTextCtrl::OnMouseMove(wxMouseEvent& evt) {