예제 #1
0
 public EditText(LayerText layer, LayerText.TextCell cellToEdit, string newText, Font newFont, Color newColor, StringAlignment newAlignment)
 {
     mTextLayer    = layer;
     mTextCell     = cellToEdit;
     mOldText      = cellToEdit.Text;
     mNewText      = newText;
     mOldFont      = cellToEdit.Font;
     mNewFont      = newFont;
     mOldColor     = cellToEdit.FontColor;
     mNewColor     = newColor;
     mOldAlignment = cellToEdit.TextAlignment;
     mNewAlignment = newAlignment;
 }
예제 #2
0
        public EditTextForm(LayerText.TextCell textCell)
        {
            InitializeComponent();

            if (textCell != null)
            {
                // text font
                mEditedFont = textCell.Font;
                // color
                changeColor(textCell.FontColor);
                // text alignement
                if (textCell.TextAlignment == StringAlignment.Near)
                {
                    alignLeftButton_Click(null, null);
                }
                else if (textCell.TextAlignment == StringAlignment.Center)
                {
                    alignCenterButton_Click(null, null);
                }
                else
                {
                    alignRightButton_Click(null, null);
                }
                // the text itself
                this.textBox.Text = textCell.Text;
            }
            else
            {
                // text font
                mEditedFont = Properties.Settings.Default.DefaultTextFont;
                // color
                changeColor(Properties.Settings.Default.DefaultTextColor);
                // text alignement
                alignCenterButton_Click(null, null);
                // the text itself
                this.textBox.Text = BlueBrick.Properties.Resources.TextEnterText;
                this.textBox.SelectAll();
            }

            // text box font
            this.labelSize.Text = mEditedFont.Size.ToString();
            this.textBox.Font   = new Font(mEditedFont.FontFamily, FONT_SIZE_FOR_EDITION, mEditedFont.Style);
        }
예제 #3
0
        private int mTextCellIndex           = -1; // this index is for the redo, to add the text at the same place, start with -1 to add it at the end of the list (so on top of the other texts)

        public AddText(LayerText layer, string textToAdd, Font font, Color color, StringAlignment alignment, PointF position)
        {
            mTextLayer         = layer;
            mTextCell          = new LayerText.TextCell(textToAdd, font, color, alignment);
            mTextCell.Position = position;
        }