Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the VGRichText class.
 /// Clone Constructor. Creates new text that is
 /// identical to the given <see cref="VGText"/>.
 /// </summary>
 /// <param name="oldText">Text element to clone.</param>
 private VGRichText(VGRichText oldText)
     : base(
         oldText.ShapeDrawAction,
         oldText.Pen,
         oldText.Brush,
         oldText.Font,
         oldText.FontColor,
         oldText.Bounds,
         oldText.StyleGroup,
         oldText.Name,
         oldText.ElementGroup,
         oldText.Sound)
 {
     this.RebuildUnderlyingRichTextBox();
     this.richTextBox.Rtf = oldText.RtfToDraw;
     this.textLength      = this.richTextBox.TextLength;
 }
Exemple #2
0
    /// <summary>
    /// Starts new textual shape by setting the <see cref="VGRichText"/>
    /// in the <see cref="newShape"/> field.
    /// Then calls <see cref="StartCreation(Cursor)"/>.
    /// </summary>
    /// <param name="text">The <see cref="VGRichText"/> to be added to the <see cref="Picture"/></param>
    public void NewRtfTextStart(VGRichText text)
    {
      Point position = this.Location;
      position.Offset(
        (int)((this.Width / 2) - (text.Size.Width / 2)),
        (int)((this.Height / 2) - (text.Size.Height / 2)));

      text.Location = position;
      this.newShape = text;

      this.StartCreation(CustomCursors.Text);
    }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the VGRichText class.
 /// Clone Constructor. Creates new text that is
 /// identical to the given <see cref="VGText"/>.
 /// </summary>
 /// <param name="oldText">Text element to clone.</param>
 private VGRichText(VGRichText oldText)
   : base(
   oldText.ShapeDrawAction,
   oldText.Pen,
   oldText.Brush,
   oldText.Font,
   oldText.FontColor,
   oldText.Bounds,
   oldText.StyleGroup,
   oldText.Name,
   oldText.ElementGroup,
   oldText.Sound)
 {
   this.RebuildUnderlyingRichTextBox();
   this.richTextBox.Rtf = oldText.RtfToDraw;
   this.textLength = this.richTextBox.TextLength;
 }