/// <summary> /// Raises the <see cref="AbstractMargin.MouseMove"/> event. /// </summary> /// <param name="eventArgs">The <see cref="System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param> protected override void OnMouseMove(MouseEventArgs eventArgs) { Point mousepos = eventArgs.Location; bool showFolding = TextArea.Document.TextEditorProperties.EnableFolding; int physicalLine = (mousepos.Y + TextArea.VirtualTop.Y) / TextArea.TextView.LineHeight; int realline = TextArea.Document.GetFirstLogicalLine(physicalLine); if (!showFolding || realline < 0 || realline + 1 >= TextArea.Document.TotalNumberOfLines) { return; } List <Fold> foldMarkers = TextArea.Document.FoldingManager.GetFoldsWithStartAt(realline); int oldSelection = _selectedFoldLine; if (foldMarkers.Count > 0) { _selectedFoldLine = realline; } else { _selectedFoldLine = -1; } if (oldSelection != _selectedFoldLine) { TextArea.Invalidate(DrawingPosition); } base.OnMouseMove(eventArgs); }
/// <summary> /// Raises the <see cref="AbstractMargin.MouseLeave"/> event. /// </summary> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected override void OnMouseLeave(EventArgs e) { if (_selectedFoldLine != -1) { _selectedFoldLine = -1; TextArea.Invalidate(DrawingPosition); } base.OnMouseLeave(e); }
void HScrollBarValueChanged(object sender, EventArgs e) { _textArea.VirtualTop = new Point(_hScrollBar.Value * _textArea.TextView.ColumnWidth, _textArea.VirtualTop.Y); _textArea.Invalidate(); }