Exemple #1
0
        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);
        }
Exemple #2
0
        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),
                                   base.drawingPosition.X,
                                   markerRectangle.Y,
                                   base.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);
                    }
                }
            }
        }