FormattedTextArea GetFormattedTextArea(TextArea area, XUnit width) { if (area == null) return null; FormattedTextArea formattedTextArea = new FormattedTextArea(_documentRenderer, area, _fieldInfos); if (!double.IsNaN(width)) formattedTextArea.InnerWidth = width; formattedTextArea.Format(_gfx); return formattedTextArea; }
/// <summary> /// Determines the type of the given textarea. /// </summary> internal string CheckTextArea(TextArea textArea) { if ((_headerArea != null) && (textArea == _headerArea)) return "headerarea"; if ((_footerArea != null) && (textArea == _footerArea)) return "footerarea"; if ((_leftArea != null) && (textArea == _leftArea)) return "leftarea"; if ((_rightArea != null) && (textArea == _rightArea)) return "rightarea"; if ((_topArea != null) && (textArea == _topArea)) return "toparea"; if ((_bottomArea != null) && (textArea == _bottomArea)) return "bottomarea"; return ""; }
FormattedTextArea GetFormattedTextArea(TextArea area) { return GetFormattedTextArea(area, double.NaN); }
/// <summary> /// Parses the keywords «\headerarea», «\toparea», «\bottomarea», «\footerarea», /// «\leftarea» or «\rightarea» inside a chart. /// </summary> private void ParseArea(TextArea area) { // Syntax: // 1. \toparea{...} // 2. \toparea[...]{...} // // Usage of header-, bottom-, footer-, left- and rightarea are similar. try { ReadCode(); if (Symbol == Symbol.BracketLeft) { ParseAttributes(area, false); ReadCode(); } if (Symbol != Symbol.BraceLeft) return; if (IsParagraphContent()) ParseParagraphContent(area.Elements, null); else { ReadCode(); // read beyond '{' bool fContinue = true; while (fContinue) { switch (Symbol) { case Symbol.BraceRight: fContinue = false; break; case Symbol.Legend: ParseLegend(area.AddLegend()); break; case Symbol.Paragraph: ParseParagraph(area.Elements); break; case Symbol.Table: ParseTable(null, area.AddTable()); break; case Symbol.TextFrame: ParseTextFrame(area.Elements); break; case Symbol.Image: Image image = new Image(); ParseImage(image, false); area.Elements.Add(image); break; default: ThrowParserException(DomMsgID.UnexpectedSymbol, Token); break; } } } AssertSymbol(Symbol.BraceRight); ReadCode(); // read beyond '}' } catch (DdlParserException pe) { ReportParserException(pe); AdjustToNextBlock(); } }
internal override void VisitTextArea(TextArea textArea) { if (textArea == null || textArea._elements == null) return; Document document = textArea.Document; ParagraphFormat parentFormat; if (!textArea._style.IsNull) { Style style = textArea.Document.Styles[textArea.Style]; if (style == null) style = textArea.Document.Styles[StyleNames.InvalidStyleName]; parentFormat = style._paragraphFormat; } else { Chart chart = (Chart)textArea._parent; parentFormat = chart._format; textArea._style = chart._style; } if (textArea._format == null) textArea.Format = parentFormat.Clone(); else FlattenParagraphFormat(textArea._format, parentFormat); FlattenFillFormat(textArea._fillFormat); FlattenLineFormat(textArea._lineFormat, null); }
internal FormattedTextArea(DocumentRenderer documentRenderer, TextArea textArea, FieldInfos fieldInfos) { TextArea = textArea; _fieldInfos = fieldInfos; _documentRenderer = documentRenderer; }
internal virtual void VisitTextArea(TextArea textArea) { }
/// <summary> /// Determines the type of the given textarea. /// </summary> internal string CheckTextArea(TextArea textArea) { if ((this.headerArea != null) && (textArea == this.headerArea)) return "headerarea"; if ((this.footerArea != null) && (textArea == this.footerArea)) return "footerarea"; if ((this.leftArea != null) && (textArea == this.leftArea)) return "leftarea"; if ((this.rightArea != null) && (textArea == this.rightArea)) return "rightarea"; if ((this.topArea != null) && (textArea == this.topArea)) return "toparea"; if ((this.bottomArea != null) && (textArea == this.bottomArea)) return "bottomarea"; return ""; }
internal FormattedTextArea(DocumentRenderer documentRenderer, TextArea textArea, FieldInfos fieldInfos) { this.textArea = textArea; this.fieldInfos = fieldInfos; this.documentRenderer = documentRenderer; }