private void DrawRectangle(ITextPainter Painter, Rectangle Rect, bool DrawPlus) { Rectangle rectangle1 = new Rectangle(Rect.Left + 1, Rect.Top + 1, Rect.Width - 1, Rect.Height - 1); if (!this.Transparent) { Color color1 = Painter.BkColor; try { Painter.BkColor = (this.visible && ((this.owner.Outlining.OutlineOptions & OutlineOptions.DrawOnGutter) != OutlineOptions.None)) ? this.BrushColor : this.owner.BackColor; Painter.FillRectangle(rectangle1); } finally { Painter.BkColor = color1; } } int num1 = EditConsts.DefaultCollasedImageWidth; Painter.DrawRectangle(Rect.Left, Rect.Top, Rect.Width + 1, Rect.Height + 1); Painter.DrawLine(Rect.Left + 2, Rect.Top + (num1 >> 1), (Rect.Left + num1) - 1, Rect.Top + (num1 >> 1)); if (DrawPlus) { Painter.DrawLine(Rect.Left + (num1 >> 1), Rect.Top + 2, Rect.Left + (num1 >> 1), (Rect.Top + num1) - 1); } if (!this.Transparent) { Painter.ExcludeClipRect(Rect.Left, Rect.Top, Rect.Width + 1, Rect.Height + 1); } }
public void Paint(ITextPainter Painter, Rectangle Rect) { if ((this.owner != null) && !this.isDragging) { Painter.DrawLine(Rect.Left, 0, Rect.Left, Rect.Bottom, this.pen.Color, (int)this.pen.Width, this.pen.DashStyle); } }
public void Paint(ITextPainter Painter, Rectangle Rect, Point Location, int StartLine) { if (this.NeedPaint(ref Rect)) { Color color1 = Painter.BkColor; try { if (Painter.FontHeight > 0) { StartLine += (Rect.Top / Painter.FontHeight); } Painter.BkColor = (this.brush is SolidBrush) ? ((SolidBrush)this.brush).Color : EditConsts.DefaultGutterBackColor; this.drawInfo.Init(); if (this.owner.OnCustomDraw(Painter, Rect, DrawStage.Before, DrawState.Gutter, this.drawInfo)) { return; } this.DrawGutter(Painter, new Rectangle(Rect.Left, Rect.Top, Rect.Width, Rect.Height), StartLine); int num1 = this.GetPaintWidth(); if (this.Visible && (num1 != 0)) { if (!this.Transparent) { Painter.FillRectangle(0, Rect.Top, num1 - 1, Rect.Height); } Painter.DrawLine(num1 - 1, 0, num1 - 1, Rect.Bottom, this.Pen.Color, (int)this.Pen.Width, this.Pen.DashStyle); } if (((this.options & GutterOptions.PaintLineNumbers) != GutterOptions.None) && (((this.options & GutterOptions.PaintLinesOnGutter) == GutterOptions.None) || !this.Visible)) { int num2 = this.GetLineNumbersLeft(false); int num3 = this.GetLineNumbersRight(false); if (num2 < num3) { if (!this.Transparent) { Painter.BkColor = this.lineNumbersBackColor; Painter.FillRectangle(num2, Rect.Top, num3 - num2, Rect.Height); } Painter.DrawDotLine(num3 - 1, 0, num3 - 1, Rect.Bottom, this.lineNumbersForeColor); } } if (!this.Transparent && (((this.owner.Outlining.OutlineOptions & OutlineOptions.DrawOnGutter) == OutlineOptions.None) || !this.Visible)) { num1 = this.GetOutlineWidth(); if (num1 != 0) { Painter.BkColor = this.owner.BackColor; Painter.FillRectangle(this.GetOutlineLeft(), Rect.Top, num1, Rect.Height); } } this.owner.OnCustomDraw(Painter, Rect, DrawStage.After, DrawState.Gutter, this.drawInfo); } finally { Painter.BkColor = color1; } } }
private void FrameRect(ITextPainter Painter, ref Rectangle Rect, Color Color, Color BackColor, bool DrawBorder) { Color color1 = Painter.BkColor; Color color2 = Painter.PenColor; Painter.BkColor = Color; Painter.PenColor = Color; try { Painter.DrawRectangle(Rect); Painter.DrawLine(Rect.Right, Rect.Top + 1, Rect.Right, Rect.Bottom + 1); Painter.PenColor = BackColor; Painter.DrawLine(Rect.Right, Rect.Top, Rect.Right, Rect.Top + 1); if (DrawBorder || this.IsLastPage) { Painter.PenColor = Color; Painter.DrawLine(Rect.Left + 1, Rect.Bottom, Rect.Right, Rect.Bottom); Painter.PenColor = BackColor; Painter.DrawLine(Rect.Left, Rect.Bottom, Rect.Left + 1, Rect.Bottom); } if (DrawBorder) { Painter.PenColor = Color; Painter.DrawLine(Rect.Right + 1, Rect.Top + 1, Rect.Right + 1, Rect.Bottom + 2); Painter.DrawLine(Rect.Left + 1, Rect.Bottom + 1, Rect.Right + 1, Rect.Bottom + 1); Painter.PenColor = BackColor; Painter.DrawLine(Rect.Right + 1, Rect.Top, Rect.Right + 1, Rect.Top + 1); Painter.DrawLine(Rect.Left, Rect.Bottom + 1, Rect.Left, Rect.Bottom + 2); } Rect.Width++; if (DrawBorder || this.IsLastPage) { Rect.Height++; } if (DrawBorder) { Rect.Width++; Rect.Height++; } } finally { Painter.PenColor = color2; Painter.BkColor = color1; } }
private void DrawLine(ITextPainter Painter, int x1, int y1, int x2, int y2) { Painter.DrawLine(x1, y1, x2, y2); if (!this.Transparent) { if (x1 == x2) { Painter.ExcludeClipRect(x1, y1, 1, y2 - y1); } else { Painter.ExcludeClipRect(x1, y1, x2 - x1, 1); } } }
public void Paint(ITextPainter Painter) { if ((this.pages != null) && (this.pages.PageType != PageType.Normal)) { DrawInfo info1; SyntaxEdit edit1 = (SyntaxEdit)this.pages.Owner; Rectangle rectangle1 = this.ClientRect; info1 = new DrawInfo(); if (this.pages.PageType == PageType.PageBreaks) { Rectangle rectangle2 = edit1.ClientRect; rectangle1.X = rectangle2.Left + ((Gutter)edit1.Gutter).GetWidth(); rectangle1.Width = rectangle2.Right - rectangle1.Left; if (!this.IsLastPage) { info1.Init(); info1.Page = this.Index; if (edit1.OnCustomDraw(Painter, rectangle1, DrawStage.Before, DrawState.PageBorder, info1)) { return; } Painter.DrawLine(rectangle1.Left, rectangle1.Bottom - 1, rectangle1.Right, rectangle1.Bottom - 1, this.pages.BorderColor, 1, DashStyle.Dot); edit1.OnCustomDraw(Painter, rectangle1, DrawStage.After, DrawState.PageBorder, info1); } } else { Rectangle rectangle3 = this.BoundsRect; info1.Init(); info1.Page = this.Index; if (!edit1.OnCustomDraw(Painter, rectangle3, DrawStage.Before, DrawState.PageBorder, info1)) { bool flag1 = this.pages.DisplayWhiteSpace; int num1 = edit1.Painter.FontHeight; if (num1 != 0) { rectangle1.Height = (rectangle1.Height / num1) * num1; } Rectangle rectangle4 = this.PaintRect; rectangle3.Inflate(1, 1); this.FrameRect(Painter, ref rectangle3, this.pages.BorderColor, this.pages.BackColor, flag1); this.FillBoundsRect(Painter, rectangle4, rectangle3, this.pages.BackColor, false); rectangle3 = this.BoundsRect; this.FillBoundsRect(Painter, rectangle3, rectangle1, edit1.BackColor, this.pages.Transparent); if ((this.pages == null) || this.pages.DisplayWhiteSpace) { int num2 = Math.Max((int)(rectangle1.Left - this.header.Offset.X), rectangle3.Left); int num3 = Math.Min((int)((rectangle1.Left + rectangle1.Width) + this.header.Offset.X), rectangle3.Right); Rectangle rectangle5 = new Rectangle(num2, Math.Max((int)(rectangle1.Top - (this.header.Offset.Y + this.header.Font.Height)), this.BoundsRect.Top), num3 - num2, this.header.Font.Height); this.header.Paint(Painter, rectangle5, this.Index, this.pages.Count, false); num2 = Math.Max((int)(rectangle1.Left - this.footer.Offset.X), rectangle3.Left); num3 = Math.Min((int)((rectangle1.Left + rectangle1.Width) + this.footer.Offset.X), rectangle3.Right); rectangle5 = new Rectangle(num2, Math.Min((int)(rectangle1.Bottom + this.footer.Offset.Y), (int)(rectangle3.Bottom - this.footer.Font.Height)), num3 - num2, this.footer.Font.Height); this.footer.Paint(Painter, rectangle5, this.Index, this.pages.Count, this.paintNumber); } edit1.OnCustomDraw(Painter, rectangle3, DrawStage.After, DrawState.PageBorder, info1); } edit1.PaintWindow(Painter, this.startLine, new Rectangle(0, 0, rectangle1.Width, rectangle1.Height), rectangle1.Location, 1f, 1f, true); } } }