public override bool DoMouseClick(Point p, MouseButtons button) { // Right-click? Show context menu. if (button == MouseButtons.Right) { short senseIx = getSenseIxFromPoint(p); CedictEntry entry = getEntry(res.EntryId); ResultsCtxtControl ctxt = new ResultsCtxtControl(onCtxtMenuCommand, tprov, entry, senseIx, analyzedScript); ShowContextMenu(p, ctxt); return(true); } // So, it's a left-click. // Are we over a link area? if (targetLinks == null) { return(true); } LinkArea overWhat = null; foreach (LinkArea link in targetLinks) { foreach (Rectangle rect in link.ActiveAreas) { if (rect.Contains(p)) { overWhat = link; break; } } } // Yes: trigger lookup if (overWhat != null) { lookupThroughLink(overWhat.QueryString); } return(true); }
/// <summary> /// Closes context menu if it's fired a command. /// </summary> private void onCtxtMenuCommand(ResultsCtxtControl sender) { CloseContextMenu(sender); }
public override bool DoMouseClick(Point p, MouseButtons button) { // Right-click? Show context menu. if (button == MouseButtons.Right) { short senseIx = getSenseIxFromPoint(p); CedictEntry entry = getEntry(res.EntryId); ResultsCtxtControl ctxt = new ResultsCtxtControl(onCtxtMenuCommand, tprov, entry, senseIx, analyzedScript); ShowContextMenu(p, ctxt); return true; } // So, it's a left-click. // Are we over a link area? if (targetLinks == null) return true; LinkArea overWhat = null; foreach (LinkArea link in targetLinks) { foreach (Rectangle rect in link.ActiveAreas) { if (rect.Contains(p)) { overWhat = link; break; } } } // Yes: trigger lookup if (overWhat != null) lookupThroughLink(overWhat.QueryString); return true; }
/// <summary> /// Closes context menu if it's fired a command. /// </summary> private void onCtxtMenuCommand(ResultsCtxtControl sender) { CloseContextMenu(sender); }