예제 #1
0
        void RenderArea(FormattedTextArea area, Rectangle rect)
        {
            if (area == null)
            {
                return;
            }

            TextArea textArea = area.TextArea;

            FillFormatRenderer fillFormatRenderer = new FillFormatRenderer((FillFormat)textArea.GetValue("FillFormat", GV.ReadOnly), _gfx);

            fillFormatRenderer.Render(rect.X, rect.Y, rect.Width, rect.Height);

            XUnit top = rect.Y;

            top += textArea.TopPadding;
            XUnit bottom = rect.Y + rect.Height;

            bottom -= textArea.BottomPadding;
            top     = AlignVertically(textArea.VerticalAlignment, top, bottom, area.ContentHeight);

            XUnit left = rect.X;

            left += textArea.LeftPadding;

            RenderInfo[] renderInfos = area.GetRenderInfos();
            RenderByInfos(left, top, renderInfos);

            LineFormatRenderer lineFormatRenderer = new LineFormatRenderer((LineFormat)textArea.GetValue("LineFormat", GV.ReadOnly), _gfx);

            lineFormatRenderer.Render(rect.X, rect.Y, rect.Width, rect.Height);
        }
예제 #2
0
 internal ShapeRenderer(XGraphics gfx, Shape shape, FieldInfos fieldInfos)
     : base(gfx, shape, fieldInfos)
 {
     this.shape = shape;
       LineFormat lf = (LineFormat)this.shape.GetValue("LineFormat", GV.ReadOnly);
       this.lineFormatRenderer = new LineFormatRenderer(lf, gfx);
 }
예제 #3
0
        internal ShapeRenderer(XGraphics gfx, Shape shape, FieldInfos fieldInfos)
            : base(gfx, shape, fieldInfos)
        {
            _shape = shape;
            LineFormat lf = (LineFormat)_shape.GetValue("LineFormat", GV.ReadOnly);

            _lineFormatRenderer = new LineFormatRenderer(lf, gfx);
        }
예제 #4
0
 internal ShapeRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos)
     : base(gfx, renderInfo, fieldInfos)
 {
     this.shape = (Shape)renderInfo.DocumentObject;
       LineFormat lf = (LineFormat)this.shape.GetValue("LineFormat", GV.ReadOnly);
       this.lineFormatRenderer = new LineFormatRenderer(lf, gfx);
       FillFormat ff = (FillFormat)this.shape.GetValue("FillFormat", GV.ReadOnly);
       this.fillFormatRenderer = new FillFormatRenderer(ff, gfx);
 }
예제 #5
0
        internal ShapeRenderer(XGraphics gfx, RenderInfo renderInfo, FieldInfos fieldInfos)
            : base(gfx, renderInfo, fieldInfos)
        {
            _shape = (Shape)renderInfo.DocumentObject;
            LineFormat lf = (LineFormat)_shape.GetValue("LineFormat", GV.ReadOnly);

            _lineFormatRenderer = new LineFormatRenderer(lf, gfx);
            FillFormat ff = (FillFormat)_shape.GetValue("FillFormat", GV.ReadOnly);

            _fillFormatRenderer = new FillFormatRenderer(ff, gfx);
        }
예제 #6
0
        Rectangle CalcContentRect()
        {
            LineFormatRenderer lfr = new LineFormatRenderer(_textframe.LineFormat, _gfx);
            XUnit lineWidth        = lfr.GetWidth();
            XUnit width;
            XUnit xOffset = lineWidth / 2;
            XUnit yOffset = lineWidth / 2;

            if (_textframe.Orientation == TextOrientation.Horizontal ||
                _textframe.Orientation == TextOrientation.HorizontalRotatedFarEast)
            {
                width    = _textframe.Width.Point;
                xOffset += _textframe.MarginLeft;
                yOffset += _textframe.MarginTop;
                width   -= xOffset;
                width   -= _textframe.MarginRight + lineWidth / 2;
            }
            else
            {
                width = _textframe.Height.Point;
                if (_textframe.Orientation == TextOrientation.Upward)
                {
                    xOffset += _textframe.MarginBottom;
                    yOffset += _textframe.MarginLeft;
                    width   -= xOffset;
                    width   -= _textframe.MarginTop + lineWidth / 2;
                }
                else
                {
                    xOffset += _textframe.MarginTop;
                    yOffset += _textframe.MarginRight;
                    width   -= xOffset;
                    width   -= _textframe.MarginBottom + lineWidth / 2;
                }
            }
            XUnit height = double.MaxValue;

            return(new Rectangle(xOffset, yOffset, width, height));
        }
예제 #7
0
        void RenderArea(FormattedTextArea area, Rectangle rect)
        {
            if (area == null)
                return;

            TextArea textArea = area.TextArea;

            FillFormatRenderer fillFormatRenderer = new FillFormatRenderer((FillFormat)textArea.GetValue("FillFormat", GV.ReadOnly), _gfx);
            fillFormatRenderer.Render(rect.X, rect.Y, rect.Width, rect.Height);

            XUnit top = rect.Y;
            top += textArea.TopPadding;
            XUnit bottom = rect.Y + rect.Height;
            bottom -= textArea.BottomPadding;
            top = AlignVertically(textArea.VerticalAlignment, top, bottom, area.ContentHeight);

            XUnit left = rect.X;
            left += textArea.LeftPadding;

            RenderInfo[] renderInfos = area.GetRenderInfos();
            RenderByInfos(left, top, renderInfos);

            LineFormatRenderer lineFormatRenderer = new LineFormatRenderer((LineFormat)textArea.GetValue("LineFormat", GV.ReadOnly), _gfx);
            lineFormatRenderer.Render(rect.X, rect.Y, rect.Width, rect.Height);
        }
예제 #8
0
        Rectangle CalcContentRect()
        {
            LineFormatRenderer lfr = new LineFormatRenderer(_textframe.LineFormat, _gfx);
            XUnit lineWidth = lfr.GetWidth();
            XUnit width;
            XUnit xOffset = lineWidth / 2;
            XUnit yOffset = lineWidth / 2;

            if (_textframe.Orientation == TextOrientation.Horizontal ||
              _textframe.Orientation == TextOrientation.HorizontalRotatedFarEast)
            {
                width = _textframe.Width.Point;
                xOffset += _textframe.MarginLeft;
                yOffset += _textframe.MarginTop;
                width -= xOffset;
                width -= _textframe.MarginRight + lineWidth / 2;
            }
            else
            {
                width = _textframe.Height.Point;
                if (_textframe.Orientation == TextOrientation.Upward)
                {
                    xOffset += _textframe.MarginBottom;
                    yOffset += _textframe.MarginLeft;
                    width -= xOffset;
                    width -= _textframe.MarginTop + lineWidth / 2;
                }
                else
                {
                    xOffset += _textframe.MarginTop;
                    yOffset += _textframe.MarginRight;
                    width -= xOffset;
                    width -= _textframe.MarginBottom + lineWidth / 2;
                }
            }
            XUnit height = double.MaxValue;
            return new Rectangle(xOffset, yOffset, width, height);
        }