public void Refresh(AbstractMargin margin) { updateMargin = margin; Invalidate(updateMargin.DrawingPosition); Update(); updateMargin = null; }
protected override void OnMouseLeave(System.EventArgs e) { base.OnMouseLeave(e); this.Cursor = Cursors.Default; if (lastMouseInMargin != null) { lastMouseInMargin.HandleMouseLeave(EventArgs.Empty); lastMouseInMargin = null; } CloseToolTip(); }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (!toolTipRectangle.Contains(e.Location)) { toolTipRectangle = Rectangle.Empty; if (toolTipActive) { RequestToolTip(e.Location); } } foreach (AbstractMargin margin in leftMargins) { if (margin.DrawingPosition.Contains(e.X, e.Y)) { this.Cursor = margin.Cursor; margin.HandleMouseMove(new Point(e.X, e.Y), e.Button); if (lastMouseInMargin != margin) { if (lastMouseInMargin != null) { lastMouseInMargin.HandleMouseLeave(EventArgs.Empty); } lastMouseInMargin = margin; } return; } } if (lastMouseInMargin != null) { lastMouseInMargin.HandleMouseLeave(EventArgs.Empty); lastMouseInMargin = null; } if (textView.DrawingPosition.Contains(e.X, e.Y)) { TextLocation realmousepos = TextView.GetLogicalPosition(e.X - TextView.DrawingPosition.X, e.Y - TextView.DrawingPosition.Y); if (SelectionManager.IsSelected(Document.PositionToOffset(realmousepos)) && MouseButtons == MouseButtons.None) { // mouse is hovering over a selection, so show default mouse this.Cursor = Cursors.Default; } else { // mouse is hovering over text area, not a selection, so show the textView cursor this.Cursor = textView.Cursor; } return; } this.Cursor = Cursors.Default; }
public void InsertLeftMargin(int index, AbstractMargin margin) { leftMargins.Insert(index, margin); Refresh(); }