Пример #1
0
 public TextLine(int x, int y, int width, string data, TextAligment aligment = TextAligment.Center) : base(x, y, width, 1)
 {
     if (data.Length > width)
     {
         this.data = data.Substring(0, width);
     }
     else
     {
         this.data = data;
     }
     this.aligment = aligment;
     ClearObjectSpace();
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <c>MTextFormattingOptions</c> class
 /// </summary>
 /// <param name="style">Current style of the <see cref="MText">multiline text</see> entity.</param>
 public MTextFormattingOptions(TextStyle style)
 {
     this.bold                 = false;
     this.italic               = false;
     this.overline             = false;
     this.underline            = false;
     this.color                = null;
     this.fontName             = null;
     this.aligment             = TextAligment.Default;
     this.heightFactor         = 1.0;
     this.obliqueAngle         = 0.0;
     this.characterSpaceFactor = 1.0;
     this.widthFactor          = 1.0;
     this.style                = style;
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <c>MTextFormattingOptions</c> class
 /// </summary>
 /// <param name="style">Current style of the <see cref="MText">multiline text</see> entity.</param>
 public MTextFormattingOptions(TextStyle style)
 {
     this.bold = false;
     this.italic = false;
     this.overline = false;
     this.underline = false;
     this.color = null;
     this.fontName = null;
     this.aligment = TextAligment.Default;
     this.heightFactor = 1.0;
     this.obliqueAngle = 0.0;
     this.characterSpaceFactor = 1.0;
     this.widthFactor = 1.0;
     this.style = style;
 }
Пример #4
0
        void DrawCaption(Graphics g, string title, TextAligment ta, int yoffset, int xoffset)
        {
            int x = 0;

            switch (ta)
            {
            case TextAligment.Left:
                x = xoffset;
                break;

            case TextAligment.Right:
                x = (int)(Width - xoffset - g.MeasureString(TopTitle, Font).Width);
                break;

            case TextAligment.Center:
                x = ((int)(Width - g.MeasureString(TopTitle, Font).Width) - xoffset) / 2;
                break;
            }

            g.DrawString(title, Font, new SolidBrush(ForeColor), x, yoffset);
        }
Пример #5
0
 private static void WriteText(string str, TextAligment textAligment)
 {
     Console.WriteLine("Lygiuotė: " + textAligment);
 }