예제 #1
0
파일: Gutter.cs 프로젝트: stevencohn/Orqa
        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);
            }
        }
예제 #2
0
        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;
            }
        }