Exemplo n.º 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), this.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), this.gfx);

            lineFormatRenderer.Render(rect.X, rect.Y, rect.Width, rect.Height);
        }
Exemplo n.º 2
0
        FormattedTextArea GetFormattedTextArea(TextArea area, XUnit width)
        {
            if (area == null)
            {
                return(null);
            }

            FormattedTextArea formattedTextArea = new FormattedTextArea(this.documentRenderer, area, this.fieldInfos);

            if (!double.IsNaN(width))
            {
                formattedTextArea.InnerWidth = width;
            }

            formattedTextArea.Format(this.gfx);
            return(formattedTextArea);
        }