/// <summary> /// Applies the specified <c>fourSideSetting</c> into <c>target</c> property for all four sides /// </summary> /// <param name="setting">The setting.</param> /// <param name="target">The target.</param> public void apply(fourSideSetting setting, styleFourSideParameter target) { this[styleSideDirection.bottom, target] = setting.bottom; this[styleSideDirection.top, target] = setting.top; this[styleSideDirection.left, target] = setting.left; this[styleSideDirection.right, target] = setting.right; }
/// <summary> /// Primenjuje default podesavanja /// </summary> public override void deploySize() { height = Console.WindowHeight; width = Console.WindowWidth; padding = new fourSideSetting(0, 0); margin = new fourSideSetting(0, 0); }
/// <summary> /// konstruktor za jednolinijsko podesavanje /// </summary> /// <param name="__width"></param> /// <param name="__leftRightMargin"></param> /// <param name="__leftRightPadding"></param> public textFormatSetupBase(Int32 __width, Int32 __leftRightMargin, Int32 __leftRightPadding) : base(__width, 1) { _width = __width; _margin = new fourSideSetting(__leftRightMargin, 0); _padding = new fourSideSetting(__leftRightPadding, 0); autoHeight(true, 1); }
public void apply(dialogScreenBase dialog, IPlatform platform) { dialog.padding = new fourSideSetting(2, 2); dialog.blending = layerBlending.transparent; dialog.width = platform.width; dialog.height = platform.height; fourSideSetting margin = new fourSideSetting(10); switch (size) { case dialogSize.messageBox: margin.top = 5; margin.left = 5; margin.right = 5; break; case dialogSize.mediumBox: margin.top = 2; //dialog.height = 16; margin.left = 5; margin.right = 5; break; case dialogSize.fullScreenBox: margin.top = 0; //dialog.height = 22; margin.left = 5; margin.right = 5; break; } switch (style) { case dialogStyle.blueDialog: dialog.foreColor = platformColorName.Cyan; dialog.backColor = platformColorName.DarkBlue; dialog.marginDecoration = "#"; break; case dialogStyle.greenDialog: dialog.foreColor = platformColorName.White; dialog.backColor = platformColorName.DarkGreen; dialog.marginDecoration = "#"; break; default: case dialogStyle.redDialog: dialog.foreColor = platformColorName.White; dialog.backColor = platformColorName.Red; dialog.marginDecoration = "#"; break; } dialog.margin = margin; //dialog.margin = new imbACE.Core.primitives.fourSideSetting(margin, platform.height - dialog.height); }
/// <summary> /// Konstruktor za dvodimenziono podesavanje /// </summary> /// <param name="__width"></param> /// <param name="__height"></param> /// <param name="__leftRightMargin"></param> /// <param name="__topBottomMargin"></param> /// <param name="__leftRightPadding"></param> /// <param name="__topBottomPadding"></param> public textFormatSetupBase(Int32 __width, Int32 __height, Int32 __leftRightMargin, Int32 __topBottomMargin, Int32 __leftRightPadding, Int32 __topBottomPadding) : base(__width, __height) { //width = __width; //height = __height; margin = new fourSideSetting(__leftRightMargin, __topBottomMargin); padding = new fourSideSetting(__leftRightPadding, __topBottomPadding); autoHeight(true, 1); }
/// <summary> /// Initializes a new instance of the <see cref="styleTheme"/> class. /// </summary> /// <param name="h1Size">Size of the h1.</param> /// <param name="pSize">Size of the p.</param> /// <param name="margin">The margin.</param> /// <param name="padding">The padding.</param> /// <param name="pageFontName">Name of the page font.</param> /// <param name="headingFontName">Name of the heading font.</param> public styleTheme(aceBaseColorSetEnum colorSet, Int32 h1Size, Int32 pSize, fourSideSetting margin, fourSideSetting padding, aceFont pageFontName, aceFont headingFontName = aceFont.none) { palletes = new acePaletteProvider(colorSet.getSetOfColors()); textShotProvider = new styleTextShotProvider(this); styleContainerProvider = new styleContainerShotProvider(this); borderProvider = new styleBorderProvider(this); styler = new stylerForRange(this); zoneMain = new cursorZone(80, 2, 2); cMain = new cursor(zoneMain, textCursorMode.scroll, textCursorZone.innerZone, "themeCursor"); body = new stylePage(); //body.maxSize fontForText = new styleTextFont(pageFontName); fontForHeadings = new styleTextFont(headingFontName); fontSize = new styleTextSizeSet(h1Size, pSize, margin, padding); }
/// <summary> /// Automatically recalculates sizes /// </summary> /// <param name="sizeForH1">Size of the biggest text heading</param> /// <param name="sizeForText">Size of normal test (i.e. paragraph)</param> /// <param name="H1Margin">Margin of the biggest text heading</param> /// <param name="H1Padding">Padding of H1</param> internal void deploy(Int32 sizeForH1, Int32 sizeForText, fourSideSetting H1Margin, fourSideSetting H1Padding) { Int32 dif = (sizeForH1 - sizeForText); hFactor = factor - factorExtra; step = Math.Floor((Decimal)dif / hFactor); Decimal stepMargin = Math.Floor((Decimal)H1Margin.topAndBottom / hFactor); Decimal stepPadding = Math.Floor((Decimal)H1Padding.topAndBottom / hFactor); headingSizes.Add(sizeForH1); headingMargins.Add(H1Margin); headingPaddings.Add(H1Padding); for (var i = 0; i < (factor); i++) { headingSizes.Add(sizeForH1 - (Int32)(i * step)); headingMargins.Add(H1Margin.getResized(-(Int32)(stepMargin * i), 0)); headingPaddings.Add(H1Padding.getResized(-(Int32)(stepPadding * i), 0)); } textSize = headingSizes[(int)styleTextSizeEnum.regular]; smallText = headingSizes[(int)styleTextSizeEnum.smaller]; }
internal void processRole(appendRole __role, appendType __type, styleTheme theme) { role = __role; type = __type; Int32 sizeKWidth = 8; Int32 sizeKHeight = 1; themeCodeName = theme.getCodeName(); var sizeEnum = imbStringMarkdownExtensions.getTextSizeEnum(__type); var size = theme.fontSize.headingSizes[sizeEnum.ToInt32()]; fourSideSetting margin = theme.fontSize.headingMargins[sizeEnum.ToInt32()]; fourSideSetting padding = theme.fontSize.headingPaddings[sizeEnum.ToInt32()]; sizeAndBorder.apply(margin, styleFourSideParameter.margin); sizeAndBorder.apply(padding, styleFourSideParameter.padding); String roleName = role.ToString(); aligment = textCursorZoneCorner.Left; if (roleName.StartsWith("merged")) { doWrapText = true; doCallForMerge = true; } if (roleName.StartsWith("section")) { doWrapText = true; } if (roleName.EndsWith("Head")) { aligment = textCursorZoneCorner.center; sizeAndBorder.bottom.type = styleBorderType.Thin; } if (roleName.EndsWith("Foot")) { aligment = textCursorZoneCorner.Left; sizeAndBorder.top.type = styleBorderType.Thin; } switch (role) { case appendRole.none: break; case appendRole.mergedHead: break; case appendRole.mergedContent: break; case appendRole.mergedFoot: break; case appendRole.sectionHead: break; case appendRole.sectionContent: break; case appendRole.sectionFoot: break; case appendRole.majorHeading: break; case appendRole.minorHeading: break; case appendRole.paragraph: break; case appendRole.remark: break; case appendRole.tableHead: sizeAndBorder.top.type = styleBorderType.Double; doWrapText = true; doCallForMerge = true; break; case appendRole.tableColumnHead: doWrapText = true; break; case appendRole.tableColumnFoot: sizeAndBorder.top.type = styleBorderType.Dotted; break; case appendRole.tableCellValue: break; case appendRole.tableCellAnnotation: sizeAndBorder.top.type = styleBorderType.Dotted; sizeAndBorder.bottom.type = styleBorderType.Dotted; break; case appendRole.tableCellNovalue: break; case appendRole.tableBetween: sizeAndBorder.top.type = styleBorderType.Dotted; sizeAndBorder.bottom.type = styleBorderType.Dotted; break; case appendRole.tableFoot: sizeAndBorder.bottom.type = styleBorderType.Double; break; case appendRole.i_container: break; case appendRole.i_margin: sizeKHeight = 1; sizeKWidth = 1; break; case appendRole.i_line: break; default: break; } minSize = new styleSize(size * sizeKWidth, size * sizeKHeight); minSize.width += sizeAndBorder.left.padding + sizeAndBorder.right.padding; minSize.height += sizeAndBorder.top.padding + sizeAndBorder.bottom.padding; }
/// <summary> /// Automatically recalculats /// </summary> /// <param name="sizeForH1">Size of the biggest text heading</param> /// <param name="sizeForText">Size of normal test (i.e. paragraph)</param> /// <param name="H1Margin">Margin of the biggest text heading</param> /// <param name="H1Padding">Padding of H1</param> public styleTextSizeSet(Int32 sizeForH1, Int32 sizeForText, fourSideSetting H1Margin, fourSideSetting H1Padding) { deploy(sizeForH1, sizeForText, H1Margin, H1Padding); }