Propagate EVT_CONTEXT_MENU if standard Scintilla context menu wasn't displayed

EVT_CONTEXT_MENU event should be consumed in the event handler only if Scintilla context menu was actually displayed.
This commit is contained in:
Artur Wieczorek 2017-03-16 23:36:54 +01:00
parent 962979ebf1
commit cbbd7b44b2
3 changed files with 8 additions and 3 deletions

View File

@ -1143,9 +1143,13 @@ void ScintillaWX::DoCommand(int ID) {
}
void ScintillaWX::DoContextMenu(Point pt) {
bool ScintillaWX::DoContextMenu(Point pt) {
if (ShouldDisplayPopup(pt))
{
ContextMenu(pt);
return true;
}
return false;
}
void ScintillaWX::DoOnListBox() {

View File

@ -179,7 +179,7 @@ public:
#endif
void DoCommand(int ID);
void DoContextMenu(Point pt);
bool DoContextMenu(Point pt);
void DoOnListBox();

View File

@ -5248,7 +5248,8 @@ void wxStyledTextCtrl::OnContextMenu(wxContextMenuEvent& evt) {
if (ht != wxHT_WINDOW_INSIDE) {
pt = this->PointFromPosition(this->GetCurrentPos());
}
m_swx->DoContextMenu(Point(pt.x, pt.y));
if ( !m_swx->DoContextMenu(Point(pt.x, pt.y)) )
evt.Skip();
}