public TextEditorBoxUIExtensions(TextEditorBox textEditorBox, Control host) { this.textEditorBox = textEditorBox; this.host = host; this.popupList = new TextEditorPopup(this.textEditorBox, this.host); this.tooltip = new TextEditorTooltip(); this.tooltip.VisibleChanged += new EventHandler(tooltip_VisibleChanged); }
internal void HostAfterMouseMove(object sender, MouseEventArgs e) { TextPosition tp1 = this.textEditorBox.ViewPointToTextPosition(e.Location); string tooltip = null; if (!this.QuickInfoTooltipOpening) { TextPosition tp0 = this.textEditorBox.Controller.Normalize(new TextPosition(tp1.row, tp1.col - 1)); TextPosition tp2 = this.textEditorBox.Controller.Normalize(new TextPosition(tp1.row, tp1.col + 1)); Point p0 = this.textEditorBox.TextPositionToViewPoint(tp0); Point p2 = this.textEditorBox.TextPositionToViewPoint(tp2); Rectangle r = new Rectangle(p0.X, p0.Y, p2.X - p0.X, this.textEditorBox.LineHeight); if (r.Contains(e.Location)) { tooltip = this.textEditorBox.ControlPanel.OnGetSimpleTooltip(tp1); } } if (this.lastTooltip != tooltip) { PopupTooltip(tp1, tooltip); } this.lastTooltip = tooltip; }