public override void Paint(Graphics g, Rectangle rect) { if (rect.Width <= 0 || rect.Height <= 0) { return; } HighlightColor colorFor = this.textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers"); for (int i = 0; i < (base.DrawingPosition.Height + this.textArea.TextView.VisibleLineDrawingRemainder) / this.textArea.TextView.FontHeight + 1; i++) { int x = base.DrawingPosition.X; Rectangle drawingPosition = base.DrawingPosition; int top = drawingPosition.Top + i * this.textArea.TextView.FontHeight - this.textArea.TextView.VisibleLineDrawingRemainder; Rectangle rectangle = base.DrawingPosition; Rectangle rectangle1 = new Rectangle(x, top, rectangle.Width, this.textArea.TextView.FontHeight); if (rect.IntersectsWith(rectangle1)) { if (!this.textArea.Document.TextEditorProperties.ShowLineNumbers) { g.FillRectangle(BrushRegistry.GetBrush((this.textArea.Enabled ? colorFor.BackgroundColor : SystemColors.InactiveBorder)), rectangle1); } else { g.FillRectangle(BrushRegistry.GetBrush((this.textArea.Enabled ? colorFor.BackgroundColor : SystemColors.InactiveBorder)), rectangle1); g.DrawLine(BrushRegistry.GetDotPen(colorFor.Color), this.drawingPosition.X, rectangle1.Y, this.drawingPosition.X, rectangle1.Bottom); } int firstLogicalLine = this.textArea.Document.GetFirstLogicalLine(this.textArea.TextView.FirstPhysicalLine + i); if (firstLogicalLine < this.textArea.Document.TotalNumberOfLines) { this.PaintFoldMarker(g, firstLogicalLine, rectangle1); } } } }
public override void Paint(Graphics g, Rectangle rect) { if (rect.Width <= 0 || rect.Height <= 0) { return; } HighlightColor lineNumberPainterColor = textArea.Document.HighlightingStrategy.GetColorFor("LineNumbers"); for (int y = 0; y < (DrawingPosition.Height + textArea.TextView.VisibleLineDrawingRemainder) / textArea.TextView.FontHeight + 1; ++y) { Rectangle markerRectangle = new Rectangle(DrawingPosition.X, DrawingPosition.Top + y * textArea.TextView.FontHeight - textArea.TextView.VisibleLineDrawingRemainder, DrawingPosition.Width, textArea.TextView.FontHeight); if (rect.IntersectsWith(markerRectangle)) { // draw dotted separator line if (textArea.Document.TextEditorProperties.ShowLineNumbers) { g.FillRectangle(BrushRegistry.GetBrush(textArea.Enabled ? lineNumberPainterColor.BackgroundColor : SystemColors.InactiveBorder), markerRectangle); g.DrawLine(BrushRegistry.GetDotPen(lineNumberPainterColor.Color), drawingPosition.X, markerRectangle.Y, drawingPosition.X, markerRectangle.Bottom); } else { g.FillRectangle(BrushRegistry.GetBrush(textArea.Enabled ? lineNumberPainterColor.BackgroundColor : SystemColors.InactiveBorder), markerRectangle); } int currentLine = textArea.Document.GetFirstLogicalLine(textArea.TextView.FirstPhysicalLine + y); if (currentLine < textArea.Document.TotalNumberOfLines) { PaintFoldMarker(g, currentLine, markerRectangle); } } } }
private void PaintCaretLine(Graphics g) { if (!textArea.Document.TextEditorProperties.CaretLine) { return; } HighlightColor caretLineColor = textArea.Document.HighlightingStrategy.GetColorFor("CaretLine"); g.DrawLine(BrushRegistry.GetDotPen(caretLineColor.Color), currentPos.X, 0, currentPos.X, textArea.DisplayRectangle.Height); }
void PaintCaretLine(Graphics g) { if (Shared.TEP.CaretLine) { HighlightColor caretLineColor = Shared.TEP.CaretLineColor; g.DrawLine(BrushRegistry.GetDotPen(caretLineColor.Color), _currentPos.X, 0, _currentPos.X, _textArea.DisplayRectangle.Height); } }
private void PaintCaretLine(Graphics g) { if (!this.textArea.Document.TextEditorProperties.CaretLine) { return; } HighlightColor colorFor = this.textArea.Document.HighlightingStrategy.GetColorFor("CaretLine"); Pen dotPen = BrushRegistry.GetDotPen(colorFor.Color); int x = this.currentPos.X; int num = this.currentPos.X; Rectangle displayRectangle = this.textArea.DisplayRectangle; g.DrawLine(dotPen, x, 0, num, displayRectangle.Height); }
public void Paint(Graphics g, Rectangle rect) { if (rect.Width <= 0 || rect.Height <= 0) { return; } HighlightColor lineNumberPainterColor = Shared.TEP.LineNumbersColor; for (int y = 0; y < (DrawingPosition.Height + TextArea.VisibleLineDrawingRemainder) / TextArea._FontHeight + 1; ++y) { Rectangle markerRectangle = new Rectangle(DrawingPosition.X, DrawingPosition.Top + y * TextArea._FontHeight - TextArea.VisibleLineDrawingRemainder, DrawingPosition.Width, TextArea._FontHeight); if (rect.IntersectsWith(markerRectangle)) { // draw dotted separator line if (Shared.TEP.ShowLineNumbers) { g.FillRectangle(BrushRegistry.GetBrush(TextArea.Enabled ? lineNumberPainterColor.BackgroundColor : SystemColors.InactiveBorder), markerRectangle); g.DrawLine(BrushRegistry.GetDotPen(lineNumberPainterColor.Color), DrawingPosition.X, markerRectangle.Y, DrawingPosition.X, markerRectangle.Bottom); } else { g.FillRectangle(BrushRegistry.GetBrush(TextArea.Enabled ? lineNumberPainterColor.BackgroundColor : SystemColors.InactiveBorder), markerRectangle); } int currentLine = TextArea.Document.GetFirstLogicalLine(TextArea.FirstPhysicalLine + y); if (currentLine < TextArea.Document.TotalNumberOfLines) { PaintFoldMarker(g, currentLine, markerRectangle); } } } }