/// <summary> /// Instancira sekciju i renderuje background u skladu sa podesavanjima /// </summary> /// <param name="__height"></param> /// <param name="__width"></param> /// <param name="__leftRightMargin"></param> /// <param name="__leftRightPadding"></param> public textSection(int __height, int __width, int __leftRightMargin, int __leftRightPadding) : base(__height, __width, __leftRightMargin, __leftRightPadding) { height = __height; cursor = new textCursor(this, textCursorMode.fixedZone, textCursorZone.innerZone); cursor.moveToCorner(textCursorZoneCorner.UpLeft); //cursor.toTopLeftCorner(); styles[textSectionLineStyleName.content].deploy(this); var bg = writeBackground(contentLines, true); }
/// <summary> /// #1 Generise sadrzaj /// </summary> private void render(ITextLayoutContentProvider source, IPlatform platform) { platform.setColors(source.foreColor, source.backColor, source.doInverseColors); List <String> lns = source.getContent().ToList(); textCursor cursor = new textCursor(platform, textCursorMode.fixedZone, textCursorZone.outterZone); if (source is smartInfoLineSection) { string[] cnt = source.getContent(); platform.render(cnt[0], 0, source.margin.top); return; } switch (source.blending) { case layerBlending.background: cursor.switchToZone(textCursorZone.outterZone); cursor.moveToCorner(textCursorZoneCorner.UpLeft); foreach (String ln in lns) { platform.render(ln, 0, cursor.y); cursor.nextLine(); //target.write(cursor, ln, -1, true); //target.write(ln, cursor.x, true, layer.target.width, true); } break; case layerBlending.semitransparent: cursor = new textCursor(source, textCursorMode.fixedZone, textCursorZone.outterZone); cursor.switchToZone(textCursorZone.innerBoxedZone); cursor.moveToCorner(textCursorZoneCorner.UpLeft); for (Int32 i = 0; i < source.innerBoxedHeight; i++) { cursor.moveLineTo(i); String cur = source.select(cursor, source.innerBoxedHeight, true); platform.render(cur, 0, cursor.y); } //lns = lns.GetRange(source.innerBoxedTopPosition, source.innerBoxedHeight); //cursor.moveLineTo(source.innerBoxedTopPosition); //cursor.switchToZone(enums.textCursorZone.innerBoxedZone); //cursor.moveToCorner(textCursorZoneCorner.UpLeft); foreach (String ln in lns) { platform.render(ln, 0, cursor.y); //target.write(cursor, ln, -1, true); // target.write(cursor, ln, -1, true); //ln, 0, true, source.width, true); } break; case layerBlending.transparent: // lns = lns.GetRange(source.innerBoxedTopPosition, source.innerBoxedHeight); cursor = new textCursor(source, textCursorMode.fixedZone, textCursorZone.innerBoxedZone); cursor.switchToZone(textCursorZone.innerBoxedZone); cursor.moveToCorner(textCursorZoneCorner.UpLeft); for (Int32 i = source.innerBoxedTopPosition; i < source.innerBoxedBottomPosition; i++) { cursor.y = i; //cursor.x = String cur = source.select(cursor, source.innerBoxedWidth, false); platform.render(cur, cursor.x, cursor.y); } break; case layerBlending.hidden: break; } platform.setColorsBack(); //platform.setColors(platformColorName.none); }