Handle EVT_CONTEXT_MENU directly in wxSTC (wxOSX)
A simulation of context menu event by handling directly EVT_RIGHT_UP was implemented in wxSTC in451c5cc7b9
, but later on, EVT_CONTEXT_MENU generation in wxOSX was fixed in524c47aa3a
so simulation is no longer necessary and this event can be directly handled in wxSTC.
This commit is contained in:
@@ -5427,7 +5427,6 @@ protected:
|
||||
void OnMouseRightDown(wxMouseEvent& evt);
|
||||
void OnMouseMove(wxMouseEvent& evt);
|
||||
void OnMouseLeftUp(wxMouseEvent& evt);
|
||||
void OnMouseRightUp(wxMouseEvent& evt);
|
||||
void OnMouseMiddleUp(wxMouseEvent& evt);
|
||||
void OnContextMenu(wxContextMenuEvent& evt);
|
||||
void OnMouseWheel(wxMouseEvent& evt);
|
||||
|
@@ -6437,8 +6437,8 @@ public:
|
||||
@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.
|
||||
this function should be called with wxSTC_POPUP_NEVER. Otherwise
|
||||
the default menu will be shown instead of the custom one.
|
||||
*/
|
||||
void UsePopUp(int popUpMode);
|
||||
|
||||
|
@@ -1282,8 +1282,8 @@ extendedDocs = {
|
||||
'@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.',),
|
||||
'this function should be called with wxSTC_POPUP_NEVER. Otherwise',
|
||||
'the default menu will be shown instead of the custom one.',),
|
||||
|
||||
'PropertyType':
|
||||
('The return value will be one of the',
|
||||
|
@@ -151,11 +151,7 @@ wxBEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||
EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown)
|
||||
EVT_MOTION (wxStyledTextCtrl::OnMouseMove)
|
||||
EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp)
|
||||
#if defined(__WXMAC__)
|
||||
EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp)
|
||||
#else
|
||||
EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu)
|
||||
#endif
|
||||
EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel)
|
||||
EVT_MIDDLE_UP (wxStyledTextCtrl::OnMouseMiddleUp)
|
||||
EVT_CHAR (wxStyledTextCtrl::OnChar)
|
||||
@@ -5211,8 +5207,7 @@ 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 wxOSX
|
||||
// We need to call evt.Skip() to allow generating EVT_CONTEXT_MENU
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
@@ -5227,13 +5222,6 @@ void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent& evt) {
|
||||
evt.ControlDown());
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) {
|
||||
wxPoint pt = evt.GetPosition();
|
||||
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent& evt) {
|
||||
wxPoint pt = evt.GetPosition();
|
||||
m_swx->DoMiddleButtonUp(Point(pt.x, pt.y));
|
||||
|
@@ -151,11 +151,7 @@ wxBEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||
EVT_LEFT_DCLICK (wxStyledTextCtrl::OnMouseLeftDown)
|
||||
EVT_MOTION (wxStyledTextCtrl::OnMouseMove)
|
||||
EVT_LEFT_UP (wxStyledTextCtrl::OnMouseLeftUp)
|
||||
#if defined(__WXMAC__)
|
||||
EVT_RIGHT_UP (wxStyledTextCtrl::OnMouseRightUp)
|
||||
#else
|
||||
EVT_CONTEXT_MENU (wxStyledTextCtrl::OnContextMenu)
|
||||
#endif
|
||||
EVT_MOUSEWHEEL (wxStyledTextCtrl::OnMouseWheel)
|
||||
EVT_MIDDLE_UP (wxStyledTextCtrl::OnMouseMiddleUp)
|
||||
EVT_CHAR (wxStyledTextCtrl::OnChar)
|
||||
@@ -726,8 +722,7 @@ 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 wxOSX
|
||||
// We need to call evt.Skip() to allow generating EVT_CONTEXT_MENU
|
||||
evt.Skip();
|
||||
}
|
||||
|
||||
@@ -742,13 +737,6 @@ void wxStyledTextCtrl::OnMouseLeftUp(wxMouseEvent& evt) {
|
||||
evt.ControlDown());
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnMouseRightUp(wxMouseEvent& evt) {
|
||||
wxPoint pt = evt.GetPosition();
|
||||
m_swx->DoContextMenu(Point(pt.x, pt.y));
|
||||
}
|
||||
|
||||
|
||||
void wxStyledTextCtrl::OnMouseMiddleUp(wxMouseEvent& evt) {
|
||||
wxPoint pt = evt.GetPosition();
|
||||
m_swx->DoMiddleButtonUp(Point(pt.x, pt.y));
|
||||
|
@@ -550,7 +550,6 @@ protected:
|
||||
void OnMouseRightDown(wxMouseEvent& evt);
|
||||
void OnMouseMove(wxMouseEvent& evt);
|
||||
void OnMouseLeftUp(wxMouseEvent& evt);
|
||||
void OnMouseRightUp(wxMouseEvent& evt);
|
||||
void OnMouseMiddleUp(wxMouseEvent& evt);
|
||||
void OnContextMenu(wxContextMenuEvent& evt);
|
||||
void OnMouseWheel(wxMouseEvent& evt);
|
||||
|
Reference in New Issue
Block a user