public TextObject(string text, bool bold, bool italic, bool underline, float fontSize, string fontName, Color forgroundColor, Color backgroundColor , TextBorderStyle borderStyle)
 {
     Text = text;
     Bold = bold;
     Italic = italic;
     Underline = underline;
     FontSize = fontSize;
     FontName = fontName;
     ForegroundColor = forgroundColor;
     BackgroundColor = backgroundColor;
     BorderStyle = borderStyle;
 }
示例#2
0
 public TextObject(string text, bool bold, bool italic, bool underline, float fontSize, string fontName, Color forgroundColor, Color backgroundColor, TextBorderStyle borderStyle)
 {
     Text            = text;
     Bold            = bold;
     Italic          = italic;
     Underline       = underline;
     FontSize        = fontSize;
     FontName        = fontName;
     ForegroundColor = forgroundColor;
     BackgroundColor = backgroundColor;
     BorderStyle     = borderStyle;
 }
 private void tightFitBackgroundToolStripMenuItem_Click(object sender, EventArgs e)
 {
     borderStyle = TextBorderStyle.Tight;
 }
        private void TextEditor_Load(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(TextObject.Text))
            {
                TextObject = DefaultTextobject;
            }

            var i = 0;
            var selectedIndex = 0;
            foreach (var oneFontFamily in FontFamily.Families)
            {
                FontName.Items.Add(oneFontFamily.Name);
                if (TextObject.FontName == oneFontFamily.Name)
                {
                    selectedIndex = i;
                }
                i++;
            }

            FontName.SelectedIndex = selectedIndex;

            FontSize.Text = TextObject.FontSize.ToString();

            FontBold.Checked = TextObject.Bold;
            FontItalic.Checked = TextObject.Italic;
            borderStyle = TextObject.BorderStyle;

            textBox.ForeColor = UiTools.RgbOnlyColor(TextObject.ForegroundColor);
            textBox.BackColor = UiTools.RgbOnlyColor(TextObject.BackgroundColor);

            TextBackgroundColor = TextObject.BackgroundColor;
            TextForegroundColor = TextObject.ForegroundColor;
            textBox.Text = TextObject.Text;

            initialized = true;
            UpdateTextCharacteristics();
        }
 private void smallBorderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     borderStyle = TextBorderStyle.Small;
 }
 private void noBackgroundToolStripMenuItem_Click(object sender, EventArgs e)
 {
     borderStyle = TextBorderStyle.None;
 }
 private void largerBoarderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     borderStyle = TextBorderStyle.Medium;
 }
        public static TextObject Create(string text, bool bold, bool italic, bool underline, float fontSize, string fontName, Color forgroundColor, Color backgroundColor, TextBorderStyle borderStyle)
        {
            TextObject temp = new TextObject();

            temp.Text            = text;
            temp.Bold            = bold;
            temp.Italic          = italic;
            temp.Underline       = underline;
            temp.FontSize        = fontSize;
            temp.FontName        = fontName;
            temp.ForegroundColor = forgroundColor;
            temp.BackgroundColor = backgroundColor;
            temp.BorderStyle     = borderStyle;
            return(temp);
        }
示例#9
0
 private void largerBoarderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     borderStyle = TextBorderStyle.Medium;
 }
示例#10
0
 private void smallBorderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     borderStyle = TextBorderStyle.Small;
 }
示例#11
0
 private void tightFitBackgroundToolStripMenuItem_Click(object sender, EventArgs e)
 {
     borderStyle = TextBorderStyle.Tight;
 }
示例#12
0
 private void noBackgroundToolStripMenuItem_Click(object sender, EventArgs e)
 {
     borderStyle = TextBorderStyle.None;
 }