internal override void ProcessRenderingElementContent(RPLElement rplElement, GdiContext context, RectangleF bounds) { RPLTextBox rPLTextBox = rplElement as RPLTextBox; RPLTextBoxPropsDef rPLTextBoxPropsDef = DefinitionProperties as RPLTextBoxPropsDef; RPLTextBoxProps rPLTextBoxProps = InstanceProperties as RPLTextBoxProps; m_textPosition = new RectangleF(base.Position.X, base.Position.Y, base.Position.Width, base.Position.Height); GdiContext.CalculateUsableReportItemRectangle(InstanceProperties, ref m_textPosition); if (TextPosition.Width <= 0f || TextPosition.Height <= 0f) { return; } m_richTextBox = new TextBox(this); if (m_paragraphs == null) { m_paragraphs = new List <RenderingParagraph>(); } if (rPLTextBoxPropsDef.IsSimple) { RenderingParagraph renderingParagraph = new RenderingParagraph(); renderingParagraph.Initialize(rPLTextBox, TextPosition); renderingParagraph.ProcessRenderingElementContent(rPLTextBox, context, TextPosition); m_paragraphs.Add(renderingParagraph); } else { for (RPLParagraph nextParagraph = rPLTextBox.GetNextParagraph(); nextParagraph != null; nextParagraph = rPLTextBox.GetNextParagraph()) { RenderingParagraph renderingParagraph2 = new RenderingParagraph(); renderingParagraph2.Initialize(nextParagraph, TextPosition); renderingParagraph2.ProcessRenderingElementContent(nextParagraph, context, TextPosition); m_paragraphs.Add(renderingParagraph2); } } if (rPLTextBoxProps.IsToggleParent) { GetToggleImage(context.GdiWriter, out Bitmap _); m_textPosition.X += m_toggleRectangleMM.Width + 2.2f; m_textPosition.Width -= m_toggleRectangleMM.Width + 2.2f; Action action = new ToggleAction(InstanceProperties.UniqueName, rPLTextBoxProps.Label, m_toggleRectangleMM, rPLTextBoxProps.ToggleState); RegisterAction(context, action); } if (rPLTextBoxPropsDef.CanSort) { GetSortImage(context.GdiWriter, out Bitmap _, out SortOrder nextOrder); m_textPosition.Width -= m_sortRectangleMM.Width + 2.2f; if (m_sortRectangleMM.Width > 0f) { Action action2 = new SortAction(InstanceProperties.UniqueName, rPLTextBoxProps.Label, m_sortRectangleMM, nextOrder); RegisterAction(context, action2); } } ProcessActions(context, InstanceProperties.UniqueName, ((RPLTextBoxProps)InstanceProperties).ActionInfo, TextPosition); }
protected override void RenderSortAction(RPLTextBoxProps textBoxProps, RPLFormat.SortOptions sortState) { this.WriteStream(HTML4Renderer.m_openStyle); this.WriteStream(HTML4Renderer.m_cursorHand); this.WriteStream(HTML4Renderer.m_semiColon); this.WriteStream(HTML4Renderer.m_quote); string uniqueName = textBoxProps.UniqueName; uniqueName = ((sortState != RPLFormat.SortOptions.Descending && sortState != 0) ? (uniqueName + "_D") : (uniqueName + "_A")); base.RenderOnClickActionScript("Sort", uniqueName); this.WriteStream(HTML4Renderer.m_closeBracket); }
protected override void RenderTextBox(RPLTextBox textBox, RPLItemMeasurement measurement, int cellIndex, float left, BorderContext borderContext, bool inTablix, bool hasBorder) { RPLTextBoxPropsDef textBoxPropsDef; bool isSimple; string textBoxValue; bool notCanGrow; bool needsTable; RPLElementStyle style; int oldCellIndex; RPLTextBoxProps textBoxProperties = GetTextBoxProperties(textBox, out textBoxPropsDef, out isSimple, out textBoxValue, inTablix, out notCanGrow, hasBorder, cellIndex, out needsTable, out style, out oldCellIndex); RenderTextBoxProperties(inTablix, cellIndex, needsTable, style); RenderTextBox(textBox, inTablix, cellIndex, needsTable, style, measurement, notCanGrow, textBoxPropsDef, textBoxProperties, isSimple, textBoxValue, borderContext, oldCellIndex); }
protected internal override void RenderSortAction(RPLTextBoxProps textBoxProps, RPLFormat.SortOptions sortState) { this.WriteStream(HTMLElements.m_openStyle); this.WriteStream(HTMLElements.m_cursorHand); this.WriteStream(HTMLElements.m_semiColon); this.WriteStream(HTMLElements.m_quote); string text = textBoxProps.UniqueName; if (sortState == RPLFormat.SortOptions.Descending || sortState == RPLFormat.SortOptions.None) { text += "_A"; } else { text += "_D"; } base.RenderOnClickActionScript("Sort", text, null); this.WriteStream(HTMLElements.m_closeBracket); }
protected override void RenderToggleImage(RPLTextBoxProps textBoxProps) { bool toggleState = textBoxProps.ToggleState; if (textBoxProps.IsToggleParent) { this.WriteStream(HTML4Renderer.m_openA); this.WriteStream(HTML4Renderer.m_tabIndex); base.WriteStream(++base.m_tabIndexNum); this.WriteStream(HTML4Renderer.m_quote); this.WriteStream(HTML4Renderer.m_openStyle); this.WriteStream(HTML4Renderer.m_cursorHand); this.WriteStream(HTML4Renderer.m_semiColon); this.WriteStream(HTML4Renderer.m_quote); base.RenderOnClickActionScript("Toggle", textBoxProps.UniqueName); this.WriteStream(HTML4Renderer.m_closeBracket); this.WriteStream(HTML4Renderer.m_img); if (base.m_browserIE) { this.WriteStream(HTML4Renderer.m_imgOnError); } this.WriteStream(HTML4Renderer.m_zeroBorder); this.WriteStream(HTML4Renderer.m_src); this.WriteToggleImage(toggleState); this.WriteStream(HTML4Renderer.m_quote); this.WriteStream(HTML4Renderer.m_alt); if (toggleState) { this.WriteStream(RenderRes.ToggleStateCollapse); } else { this.WriteStream(RenderRes.ToggleStateExpand); } this.WriteStream(HTML4Renderer.m_closeTag); this.WriteStream(HTML4Renderer.m_closeA); this.WriteStream(HTML4Renderer.m_nbsp); } }
protected internal override void RenderSortAction(RPLTextBoxProps textBoxProps, RPLFormat.SortOptions sortState) { if (m_deviceInfo.AllowScript) { RenderSortOnClick(textBoxProps, sortState); WriteStream(HTMLElements.m_closeBracket); return; } CatalogItemUrlBuilder catalogItemUrlBuilder = BaseBookmarkSortUrl(isSort: true); catalogItemUrlBuilder.AppendCatalogParameter("SortId", textBoxProps.UniqueName); if (sortState == RPLFormat.SortOptions.Descending || sortState == RPLFormat.SortOptions.None) { catalogItemUrlBuilder.AppendCatalogParameter("SortDirection", "Ascending"); } else { catalogItemUrlBuilder.AppendCatalogParameter("SortDirection", "Descending"); } catalogItemUrlBuilder.AppendCatalogParameter("ClearSort", "TRUE"); WriteStream(HTMLElements.m_hrefString + HttpUtility.HtmlAttributeEncode(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri)) + HTMLElements.m_closeQuoteString); }
internal void FixIndents(ref RPLReportSize leftIndent, ref RPLReportSize rightIndent, ref RPLReportSize spaceBefore, ref RPLReportSize spaceAfter, RPLReportSize hangingIndent) { RPLTextBoxProps rPLTextBoxProps = m_textBox.ElementProps as RPLTextBoxProps; if (HTML5Renderer.IsDirectionRTL(rPLTextBoxProps.Style)) { rightIndent = FixHangingIndent(rightIndent, hangingIndent); } else { leftIndent = FixHangingIndent(leftIndent, hangingIndent); } object obj = rPLTextBoxProps.Style[30]; if (obj != null && HTML5Renderer.IsWritingModeVertical((RPLFormat.WritingModes)obj)) { RPLReportSize rPLReportSize = leftIndent; leftIndent = spaceAfter; spaceAfter = rightIndent; rightIndent = spaceBefore; spaceBefore = rPLReportSize; } }
private void RenderSortOnClick(RPLTextBoxProps textBoxProps, RPLFormat.SortOptions sortState) { WriteStream(HTMLElements.m_openStyle); WriteStream(HTMLElements.m_cursorHand); WriteStream(HTMLElements.m_semiColon); WriteStream(HTMLElements.m_quote); string uniqueName = textBoxProps.UniqueName; if (m_deviceInfo.HasActionScript) { uniqueName = ((sortState != RPLFormat.SortOptions.Descending && sortState != 0) ? (uniqueName + "_D") : (uniqueName + "_A")); RenderOnClickActionScript("Sort", uniqueName); return; } m_pageWithSortClicks = true; string theString = "Ascending"; if (sortState == RPLFormat.SortOptions.Ascending) { theString = "Descending"; } WriteStream(" onclick=\""); WriteStream(m_deviceInfo.JavascriptPrefixId); WriteStream("Sort('"); WriteStreamEncoded(uniqueName); WriteStream("', '"); WriteStream(theString); WriteStream("');return false;\""); WriteStream(" onkeypress=\""); WriteStream(HTMLElements.m_checkForEnterKey); WriteStream(m_deviceInfo.JavascriptPrefixId); WriteStream("Sort('"); WriteStreamEncoded(uniqueName); WriteStream("','"); WriteStream(theString); WriteStream("');return false;}\""); }
protected override bool NeedSharedToggleParent(RPLTextBoxProps textBoxProps) { return(false); }
protected internal override void RenderToggleImage(RPLTextBoxProps textBoxProps) { bool toggleState = textBoxProps.ToggleState; RPLTextBoxPropsDef rPLTextBoxPropsDef = (RPLTextBoxPropsDef)textBoxProps.Definition; if (!textBoxProps.IsToggleParent) { return; } WriteStream(HTMLElements.m_openA); WriteStream(HTMLElements.m_tabIndex); WriteStream(++m_tabIndexNum); WriteStream(HTMLElements.m_quote); if (m_deviceInfo.HasActionScript) { WriteStream(HTMLElements.m_openStyle); WriteStream(HTMLElements.m_cursorHand); WriteStream(HTMLElements.m_semiColon); WriteStream(HTMLElements.m_quote); RenderOnClickActionScript("Toggle", textBoxProps.UniqueName); WriteStream(HTMLElements.m_closeBracket); } else { string reportUrl = m_report.GetReportUrl(addParams: false); CatalogItemUrlBuilder catalogItemUrlBuilder = new CatalogItemUrlBuilder(reportUrl); catalogItemUrlBuilder.AppendRenderingParameters(m_rawDeviceInfo); if (m_allPages) { catalogItemUrlBuilder.AppendRenderingParameter("Section", "0"); } else { catalogItemUrlBuilder.AppendRenderingParameter("Section", m_pageNum.ToString(CultureInfo.InvariantCulture)); } if (m_deviceInfo.HtmlPrefixId != null && m_deviceInfo.HtmlPrefixId.Length > 0) { catalogItemUrlBuilder.AppendRenderingParameter("PrefixId", m_deviceInfo.HtmlPrefixId); } m_serverParams["ShowHideToggle"] = textBoxProps.UniqueName; catalogItemUrlBuilder.AppendCatalogParameters(m_serverParams); WriteStream(HTMLElements.m_hrefString + HttpUtility.HtmlAttributeEncode(ReplaceRoot(new Uri(catalogItemUrlBuilder.ToString()).AbsoluteUri)) + HTMLElements.m_closeQuoteString); } WriteStream(HTMLElements.m_img); if (m_browserIE) { WriteStream(HTMLElements.m_imgOnError); } WriteStream(HTMLElements.m_zeroBorder); WriteStream(HTMLElements.m_src); RenderInternalImageSrc(); if (toggleState) { WriteStream(m_report.GetImageName("ToggleMinus.gif")); } else { WriteStream(m_report.GetImageName("TogglePlus.gif")); } WriteStream(HTMLElements.m_quote); WriteStream(HTMLElements.m_alt); if (toggleState) { WriteStream(RenderRes.ToggleStateCollapse); } else { WriteStream(RenderRes.ToggleStateExpand); } WriteStream(HTMLElements.m_closeTag); WriteStream(HTMLElements.m_closeA); if (!string.IsNullOrEmpty(textBoxProps.Value) || (rPLTextBoxPropsDef != null && !string.IsNullOrEmpty(rPLTextBoxPropsDef.Value))) { WriteStream(HTMLElements.m_nbsp); } }
public override void WriteStyles(StyleWriterMode mode, IRPLStyle style) { RPLParagraph paragraph = this.m_paragraph; RPLTextBox textBox = this.m_textBox; RPLTextBoxProps rPLTextBoxProps = textBox.ElementProps as RPLTextBoxProps; if (paragraph != null) { RPLParagraphProps rPLParagraphProps = paragraph.ElementProps as RPLParagraphProps; RPLParagraphPropsDef rPLParagraphPropsDef = rPLParagraphProps.Definition as RPLParagraphPropsDef; RPLReportSize rPLReportSize = null; RPLReportSize rPLReportSize2 = null; RPLReportSize rPLReportSize3 = null; RPLReportSize rPLReportSize4 = null; RPLReportSize rPLReportSize5 = null; switch (mode) { case StyleWriterMode.All: rPLReportSize = rPLParagraphProps.HangingIndent; if (rPLReportSize == null) { rPLReportSize = rPLParagraphPropsDef.HangingIndent; } rPLReportSize2 = rPLParagraphProps.LeftIndent; if (rPLReportSize2 == null) { rPLReportSize2 = rPLParagraphPropsDef.LeftIndent; } rPLReportSize3 = rPLParagraphProps.RightIndent; if (rPLReportSize3 == null) { rPLReportSize3 = rPLParagraphPropsDef.RightIndent; } rPLReportSize4 = rPLParagraphProps.SpaceBefore; if (rPLReportSize4 == null) { rPLReportSize4 = rPLParagraphPropsDef.SpaceBefore; } rPLReportSize5 = rPLParagraphProps.SpaceAfter; if (rPLReportSize5 == null) { rPLReportSize5 = rPLParagraphPropsDef.SpaceAfter; } break; case StyleWriterMode.NonShared: { RPLStyleProps nonSharedStyle = this.m_textBox.ElementProps.NonSharedStyle; rPLReportSize = rPLParagraphProps.HangingIndent; rPLReportSize3 = rPLParagraphProps.RightIndent; rPLReportSize2 = rPLParagraphProps.LeftIndent; rPLReportSize5 = rPLParagraphProps.SpaceAfter; rPLReportSize4 = rPLParagraphProps.SpaceBefore; if (this.m_outputSharedInNonShared) { if (rPLReportSize == null) { rPLReportSize = rPLParagraphPropsDef.HangingIndent; } if (rPLReportSize3 == null) { rPLReportSize3 = rPLParagraphPropsDef.RightIndent; } if (rPLReportSize2 == null) { rPLReportSize2 = rPLParagraphPropsDef.LeftIndent; } if (rPLReportSize5 == null) { rPLReportSize5 = rPLParagraphPropsDef.SpaceAfter; } if (rPLReportSize4 == null) { rPLReportSize4 = rPLParagraphPropsDef.SpaceBefore; } } else { bool flag = HTML5Renderer.IsDirectionRTL(this.m_textBox.ElementProps.Style); if (rPLReportSize == null) { if (flag) { if (rPLReportSize3 != null) { rPLReportSize = rPLParagraphPropsDef.HangingIndent; } } else if (rPLReportSize2 != null) { rPLReportSize = rPLParagraphPropsDef.HangingIndent; } } else if (flag) { if (rPLReportSize3 == null) { rPLReportSize3 = rPLParagraphPropsDef.RightIndent; } } else if (rPLReportSize2 == null) { rPLReportSize2 = rPLParagraphPropsDef.LeftIndent; } } break; } case StyleWriterMode.Shared: { RPLStyleProps sharedStyle = this.m_textBox.ElementPropsDef.SharedStyle; rPLReportSize = rPLParagraphPropsDef.HangingIndent; rPLReportSize2 = rPLParagraphPropsDef.LeftIndent; rPLReportSize3 = rPLParagraphPropsDef.RightIndent; rPLReportSize4 = rPLParagraphPropsDef.SpaceBefore; rPLReportSize5 = rPLParagraphPropsDef.SpaceAfter; break; } } if (this.m_currentListLevel > 0 && rPLReportSize != null && rPLReportSize.ToMillimeters() < 0.0) { rPLReportSize = null; } if (this.m_mode != Mode.ParagraphOnly) { this.FixIndents(ref rPLReportSize2, ref rPLReportSize3, ref rPLReportSize4, ref rPLReportSize5, rPLReportSize); bool flag2 = HTML5Renderer.IsWritingModeVertical(rPLTextBoxProps.Style); if (flag2) { base.WriteStyle(HTMLElements.m_paddingLeft, rPLReportSize2); } else { base.WriteStyle(HTMLElements.m_marginLeft, rPLReportSize2); } base.WriteStyle(HTMLElements.m_marginRight, rPLReportSize3); base.WriteStyle(HTMLElements.m_marginTop, rPLReportSize4); if (flag2) { base.WriteStyle(HTMLElements.m_marginBottom, rPLReportSize5); } else { base.WriteStyle(HTMLElements.m_paddingBottom, rPLReportSize5); } } if (this.m_mode == Mode.ListOnly) { base.WriteStyle(HTMLElements.m_fontFamily, "Arial"); base.WriteStyle(HTMLElements.m_fontSize, "10pt"); } else if (rPLReportSize != null && rPLReportSize.ToMillimeters() < 0.0) { base.WriteStyle(HTMLElements.m_textIndent, rPLReportSize); } } if (style != null) { if (this.m_mode != Mode.All && this.m_mode != Mode.ParagraphOnly) { return; } object obj = style[25]; if (obj != null || mode != 0) { RPLFormat.TextAlignments textAlignments = RPLFormat.TextAlignments.General; if (obj != null) { textAlignments = (RPLFormat.TextAlignments)obj; } if (textAlignments == RPLFormat.TextAlignments.General) { bool flag3 = HTML5Renderer.GetTextAlignForType(rPLTextBoxProps); if (HTML5Renderer.IsDirectionRTL(rPLTextBoxProps.Style)) { flag3 = ((byte)((!flag3) ? 1 : 0) != 0); } base.WriteStream(HTMLElements.m_textAlign); if (flag3) { base.WriteStream(HTMLElements.m_rightValue); } else { base.WriteStream(HTMLElements.m_leftValue); } base.WriteStream(HTMLElements.m_semiColon); } else { base.WriteStyle(HTMLElements.m_textAlign, EnumStrings.GetValue(textAlignments), null); } } base.WriteStyle(HTMLElements.m_lineHeight, style[28]); } }
public void BuildHeaderFooterString(StringBuilder str, RPLTextBoxProps textBox, ref string lastFont, ref double lastFontSize) { RPLElementStyle style = textBox.Style; string text = (string)style[20]; if (!string.IsNullOrEmpty(text) && !text.Equals(lastFont)) { str.Append("&").Append("\""); FormulaHandler.EncodeHeaderFooterString(str, text); str.Append("\""); lastFont = text; } string text2 = (string)style[21]; if (!string.IsNullOrEmpty(text2)) { double num = LayoutConvert.ToPoints(text2); if (num != 0.0 && num != lastFontSize) { str.Append("&").Append((int)num); } lastFontSize = num; } StringBuilder stringBuilder = new StringBuilder(); object obj = style[19]; if (obj != null && (RPLFormat.FontStyles)obj == RPLFormat.FontStyles.Italic) { str.Append("&I"); stringBuilder.Append("&I"); } object obj2 = textBox.Style[22]; if (obj2 != null && LayoutConvert.ToFontWeight((RPLFormat.FontWeights)obj2) >= 600) { str.Append("&B"); stringBuilder.Append("&B"); } object obj3 = textBox.Style[24]; if (obj3 != null) { RPLFormat.TextDecorations num2 = (RPLFormat.TextDecorations)obj3; if (num2 == RPLFormat.TextDecorations.Underline) { str.Append("&u"); stringBuilder.Append("&u"); } if (num2 == RPLFormat.TextDecorations.LineThrough) { str.Append("&s"); stringBuilder.Append("&s"); } } string text3 = string.Empty; string text4 = ((RPLTextBoxPropsDef)textBox.Definition).Formula; if (text4 != null && text4.Length != 0) { if (text4.StartsWith("=", StringComparison.Ordinal)) { text4 = text4.Remove(0, 1); } text3 = FormulaHandler.ProcessHeaderFooterFormula(text4); } if (text3 != null && text3.Length != 0) { str.Append(text3); } else { string text5 = textBox.Value; if (text5 == null) { text5 = ((RPLTextBoxPropsDef)textBox.Definition).Value; } if (text5 == null && textBox.OriginalValue != null) { text5 = textBox.OriginalValue.ToString(); } if (text5 != null) { FormulaHandler.EncodeHeaderFooterString(str, text5.Trim()); } } if (stringBuilder.Length > 0) { str.Append(stringBuilder); } str.Append(" "); }
internal ReportTextBox(RPLTextBoxProps source, WriterBase writer) { m_source = source; m_writer = writer; }
internal override void DrawContent(GdiContext context) { RPLTextBoxPropsDef rPLTextBoxPropsDef = DefinitionProperties as RPLTextBoxPropsDef; RPLTextBoxProps rPLTextBoxProps = InstanceProperties as RPLTextBoxProps; if (rPLTextBoxProps.IsToggleParent) { GetToggleImage(context.GdiWriter, out Bitmap image); if (m_toggleRectangleMM.Width > 0f) { DrawResourceImage(imageRectanglePX: new RectangleF(0f, 0f, image.Width, image.Height), context: context, image: image, itemRectangleMM: m_toggleRectangleMM); } } if (rPLTextBoxPropsDef.CanSort) { GetSortImage(context.GdiWriter, out Bitmap image2, out SortOrder _); if (m_sortRectangleMM.Width > 0f) { DrawResourceImage(imageRectanglePX: new RectangleF(0f, 0f, image2.Width, image2.Height), context: context, image: image2, itemRectangleMM: m_sortRectangleMM); } } if (TextPosition.Width <= 0f || TextPosition.Height <= 0f) { return; } RPLFormat.WritingModes writingMode = WritingMode; float contentHeight = 0f; float contentHeight2 = 0f; if (writingMode == RPLFormat.WritingModes.Horizontal) { contentHeight = rPLTextBoxProps.ContentHeight; } else { contentHeight2 = rPLTextBoxProps.ContentHeight; } List <Paragraph> list = null; List <RTSelectionHighlight> list2 = null; FlowContext flowContext = new FlowContext(TextPosition.Width, TextPosition.Height); bool flag = !rPLTextBoxPropsDef.CanGrow && !rPLTextBoxPropsDef.CanShrink; if (flag) { m_richTextBox.Paragraphs = new List <Paragraph>(m_paragraphs.Count); for (int i = 0; i < m_paragraphs.Count; i++) { RTSelectionHighlight searchHit = m_paragraphs[i].GetSearchHit(context); if (searchHit != null) { context.TextRunIndexHitStart = searchHit.SelectionStart.TextRunIndex; context.TextRunIndexHitEnd = searchHit.SelectionEnd.TextRunIndex; } m_paragraphs[i].DrawContent(context); m_richTextBox.Paragraphs.Add(m_paragraphs[i].RichParagraph); context.TextRunIndexHitStart = -1; context.TextRunIndexHitEnd = -1; } m_richTextBox.ScriptItemize(); if (writingMode == RPLFormat.WritingModes.Horizontal) { TextBox.MeasureFullHeight(m_richTextBox, context.Graphics, context.FontCache, flowContext, out contentHeight); } else { TextBox.MeasureFullHeight(m_richTextBox, context.Graphics, context.FontCache, flowContext, out contentHeight2); } list = m_richTextBox.Paragraphs; m_richTextBox.Paragraphs = null; } if (writingMode == RPLFormat.WritingModes.Horizontal) { if (contentHeight + 0.001f > TextPosition.Height) { flowContext.LineLimit = false; } } else if (contentHeight2 + 0.001f > TextPosition.Width) { flowContext.LineLimit = false; } m_richTextBox.Paragraphs = new List <Paragraph>(1); bool flag2 = true; float num = 0f; float num2 = 0f; for (int j = 0; j < m_paragraphs.Count; j++) { if (writingMode == RPLFormat.WritingModes.Horizontal) { if (num > 0f) { if (num >= TextPosition.Height) { break; } flowContext.Height = TextPosition.Height - num; } } else if (num2 > 0f) { if (num2 >= TextPosition.Width) { break; } flowContext.Width = TextPosition.Width - num2; } RTSelectionHighlight searchHit2 = m_paragraphs[j].GetSearchHit(context); if (!flag) { if (searchHit2 != null) { context.TextRunIndexHitStart = searchHit2.SelectionStart.TextRunIndex; context.TextRunIndexHitEnd = searchHit2.SelectionEnd.TextRunIndex; } m_paragraphs[j].DrawContent(context); m_richTextBox.Paragraphs.Add(m_paragraphs[j].RichParagraph); context.TextRunIndexHitStart = -1; context.TextRunIndexHitEnd = -1; m_richTextBox.ScriptItemize(); } else { m_richTextBox.Paragraphs.Add(list[0]); } if (searchHit2 != null) { searchHit2.SelectionStart.ParagraphIndex = 0; searchHit2.SelectionEnd.ParagraphIndex = 0; list2 = new List <RTSelectionHighlight>(0); list2.Add(searchHit2); } float height = 0f; List <Paragraph> rTParagraphs = LineBreaker.Flow(m_richTextBox, context.Graphics, context.FontCache, flowContext, keepLines: true, out height); RectangleF layoutParagraph = RectangleF.Empty; PointF offset = PointF.Empty; float delta = 0f; if (writingMode == RPLFormat.WritingModes.Horizontal) { AdjustParagraphLayout(contentHeight, height, num, flag2, writingMode, ref delta, ref layoutParagraph, ref offset); } else { AdjustParagraphLayout(contentHeight2, height, num2, flag2, writingMode, ref delta, ref layoutParagraph, ref offset); } m_context = context; m_paragraphs[j].TextPosition = layoutParagraph; RichTextRenderer richTextRenderer = new RichTextRenderer(); try { richTextRenderer.SetTextbox(m_richTextBox); richTextRenderer.RTParagraphs = rTParagraphs; richTextRenderer.FontCache = context.FontCache; if (writingMode == RPLFormat.WritingModes.Horizontal) { RenderRichText(richTextRenderer, context.Graphics, TextPosition, offset, list2); } else { RenderRichText(richTextRenderer, context.Graphics, layoutParagraph, offset, list2); } richTextRenderer.FontCache = null; } finally { if (richTextRenderer != null) { richTextRenderer.Dispose(); richTextRenderer = null; } } m_context = null; flowContext.Reset(); if (writingMode == RPLFormat.WritingModes.Horizontal) { if (flag2) { num += delta; flag2 = false; } num += height; } else { if (flag2) { num2 += delta; flag2 = false; } num2 += height; } if (searchHit2 != null) { searchHit2.SelectionStart.ParagraphIndex = j; searchHit2.SelectionEnd.ParagraphIndex = j; } m_richTextBox.Paragraphs.RemoveAt(0); if (!flag) { m_paragraphs[j].RichParagraph = null; } else { list.RemoveAt(0); } } if (list != null && list.Count > 0) { list.Clear(); } list = null; }
public ReportTextBox(RPLTextBoxProps source, WriterBase writer) { this.m_source = source; this.m_writer = writer; }
protected internal override void RenderToggleImage(RPLTextBoxProps textBoxProps) { RPLTextBoxPropsDef rpltextBoxPropsDef = (RPLTextBoxPropsDef)textBoxProps.Definition; bool isSimple = rpltextBoxPropsDef.IsSimple; bool toggleState = textBoxProps.ToggleState; if (!textBoxProps.IsToggleParent) { return; } this.WriteStream(HTMLElements.m_openA); this.WriteStream(HTMLElements.m_ariaLabeledBy); base.WriteReportItemId(textBoxProps.UniqueName + HTMLElements.m_ariaSuffix); this.WriteStream(HTMLElements.m_quote); this.WriteStream(HTMLElements.m_ariaExpanded); this.WriteStream(toggleState ? "true" : "false"); this.WriteStream(HTMLElements.m_quote); this.WriteStream(HTMLElements.m_id); base.WriteReportItemId(textBoxProps.UniqueName + "_na"); this.WriteStream(HTMLElements.m_quote); this.WriteStream(HTMLElements.m_tabIndex); base.WriteStream(++this.m_tabIndexNum); this.WriteStream(HTMLElements.m_quote); this.WriteStream(HTMLElements.m_openStyle); this.WriteStream(HTMLElements.m_paddingLeft); this.WriteStream("2px;"); this.WriteStream(HTMLElements.m_paddingRight); this.WriteStream("2px;"); this.WriteStream(HTMLElements.m_cursorHand); this.WriteStream(HTMLElements.m_semiColon); this.WriteStream(HTMLElements.m_quote); base.RenderOnClickActionScript("Toggle", textBoxProps.UniqueName, null); this.WriteStream(HTMLElements.m_closeBracket); this.WriteStream(HTMLElements.m_img); if (this.m_browserIE) { this.WriteStream(HTMLElements.m_imgOnError); } this.WriteStream(HTMLElements.m_zeroBorder); this.WriteStream(HTMLElements.m_src); this.WriteToggleImage(toggleState); this.WriteStream(HTMLElements.m_quote); string value = textBoxProps.Value; if (string.IsNullOrEmpty(value)) { value = rpltextBoxPropsDef.Value; } this.WriteStream(HTMLElements.m_alt); if (isSimple) { if (toggleState) { base.WriteStreamEncoded(string.Format("Collapse {0}", value)); } else { base.WriteStreamEncoded(string.Format("Expand {0}", value)); } } else if (toggleState) { base.WriteStreamEncoded(RenderRes.ToggleStateCollapse); } else { base.WriteStreamEncoded(RenderRes.ToggleStateExpand); } this.WriteStream(HTMLElements.m_closeTag); this.WriteStream(HTMLElements.m_closeA); }
internal override void WriteStyles(StyleWriterMode mode, IRPLStyle style) { RPLParagraph paragraph = m_paragraph; RPLTextBox textBox = m_textBox; RPLTextBoxProps rPLTextBoxProps = textBox.ElementProps as RPLTextBoxProps; if (paragraph != null) { RPLParagraphProps rPLParagraphProps = paragraph.ElementProps as RPLParagraphProps; RPLParagraphPropsDef rPLParagraphPropsDef = rPLParagraphProps.Definition as RPLParagraphPropsDef; RPLReportSize rPLReportSize = null; RPLReportSize leftIndent = null; RPLReportSize rightIndent = null; RPLReportSize spaceBefore = null; RPLReportSize spaceAfter = null; IRPLStyle iRPLStyle = null; switch (mode) { case StyleWriterMode.All: rPLReportSize = rPLParagraphProps.HangingIndent; if (rPLReportSize == null) { rPLReportSize = rPLParagraphPropsDef.HangingIndent; } leftIndent = rPLParagraphProps.LeftIndent; if (leftIndent == null) { leftIndent = rPLParagraphPropsDef.LeftIndent; } rightIndent = rPLParagraphProps.RightIndent; if (rightIndent == null) { rightIndent = rPLParagraphPropsDef.RightIndent; } spaceBefore = rPLParagraphProps.SpaceBefore; if (spaceBefore == null) { spaceBefore = rPLParagraphPropsDef.SpaceBefore; } spaceAfter = rPLParagraphProps.SpaceAfter; if (spaceAfter == null) { spaceAfter = rPLParagraphPropsDef.SpaceAfter; } break; case StyleWriterMode.NonShared: { iRPLStyle = m_textBox.ElementProps.NonSharedStyle; rPLReportSize = rPLParagraphProps.HangingIndent; rightIndent = rPLParagraphProps.RightIndent; leftIndent = rPLParagraphProps.LeftIndent; spaceAfter = rPLParagraphProps.SpaceAfter; spaceBefore = rPLParagraphProps.SpaceBefore; if (m_outputSharedInNonShared) { if (rPLReportSize == null) { rPLReportSize = rPLParagraphPropsDef.HangingIndent; } if (rightIndent == null) { rightIndent = rPLParagraphPropsDef.RightIndent; } if (leftIndent == null) { leftIndent = rPLParagraphPropsDef.LeftIndent; } if (spaceAfter == null) { spaceAfter = rPLParagraphPropsDef.SpaceAfter; } if (spaceBefore == null) { spaceBefore = rPLParagraphPropsDef.SpaceBefore; } break; } bool flag = HTML5Renderer.IsDirectionRTL(m_textBox.ElementProps.Style); if (rPLReportSize == null) { if (flag) { if (rightIndent != null) { rPLReportSize = rPLParagraphPropsDef.HangingIndent; } } else if (leftIndent != null) { rPLReportSize = rPLParagraphPropsDef.HangingIndent; } } else if (flag) { if (rightIndent == null) { rightIndent = rPLParagraphPropsDef.RightIndent; } } else if (leftIndent == null) { leftIndent = rPLParagraphPropsDef.LeftIndent; } break; } case StyleWriterMode.Shared: iRPLStyle = m_textBox.ElementPropsDef.SharedStyle; rPLReportSize = rPLParagraphPropsDef.HangingIndent; leftIndent = rPLParagraphPropsDef.LeftIndent; rightIndent = rPLParagraphPropsDef.RightIndent; spaceBefore = rPLParagraphPropsDef.SpaceBefore; spaceAfter = rPLParagraphPropsDef.SpaceAfter; break; } if (m_currentListLevel > 0 && rPLReportSize != null && rPLReportSize.ToMillimeters() < 0.0) { rPLReportSize = null; } if (m_mode != Mode.ParagraphOnly) { FixIndents(ref leftIndent, ref rightIndent, ref spaceBefore, ref spaceAfter, rPLReportSize); bool flag2 = HTML5Renderer.IsWritingModeVertical(rPLTextBoxProps.Style); if (flag2) { WriteStyle(HTMLElements.m_paddingLeft, leftIndent); } else { WriteStyle(HTMLElements.m_marginLeft, leftIndent); } WriteStyle(HTMLElements.m_marginRight, rightIndent); WriteStyle(HTMLElements.m_marginTop, spaceBefore); if (flag2) { WriteStyle(HTMLElements.m_marginBottom, spaceAfter); } else { WriteStyle(HTMLElements.m_paddingBottom, spaceAfter); } } if (m_mode == Mode.ListOnly) { WriteStyle(HTMLElements.m_fontFamily, "Arial"); WriteStyle(HTMLElements.m_fontSize, "10pt"); } else if (rPLReportSize != null && rPLReportSize.ToMillimeters() < 0.0) { WriteStyle(HTMLElements.m_textIndent, rPLReportSize); } } if (style == null || (m_mode != Mode.All && m_mode != Mode.ParagraphOnly)) { return; } object obj = style[25]; if (obj != null || mode != 0) { RPLFormat.TextAlignments textAlignments = RPLFormat.TextAlignments.General; if (obj != null) { textAlignments = (RPLFormat.TextAlignments)obj; } if (textAlignments == RPLFormat.TextAlignments.General) { bool flag3 = HTML5Renderer.GetTextAlignForType(rPLTextBoxProps); if (HTML5Renderer.IsDirectionRTL(rPLTextBoxProps.Style)) { flag3 = ((!flag3) ? true : false); } WriteStream(HTMLElements.m_textAlign); if (flag3) { WriteStream(HTMLElements.m_rightValue); } else { WriteStream(HTMLElements.m_leftValue); } WriteStream(HTMLElements.m_semiColon); } else { WriteStyle(HTMLElements.m_textAlign, EnumStrings.GetValue(textAlignments), null); } } WriteStyle(HTMLElements.m_lineHeight, style[28]); }