/// <summary> /// <see cref="VectorGraphics.Canvas.PictureModifiable.ShapeDoubleClick"/> event handler of the /// <see cref="VectorGraphics.Canvas.PictureModifiable"/> <see cref="designPicture"/>. /// Calls the detailed stimuli dialogs for the clicked element. /// </summary> /// <param name="sender"> /// Source of the event. /// </param> /// <param name="e"> /// A <see cref="ShapeEventArgs"/> with the selected shape. /// </param> private void PicPreviewShapeDoubleClick(object sender, ShapeEventArgs e) { if (e.Shape is VGText) { var text = (VGText)e.Shape; var dlg = new TextDialog { NewText = text }; if (dlg.ShowDialog() == DialogResult.OK) { VGText modifiedText = dlg.NewText; ((VGText)this.designPicture.SelectedElement).StringToDraw = modifiedText.StringToDraw; ((VGText)this.designPicture.SelectedElement).Alignment = modifiedText.Alignment; ((VGText)this.designPicture.SelectedElement).TextFont = modifiedText.TextFont; ((VGText)this.designPicture.SelectedElement).TextFontColor = modifiedText.TextFontColor; ((VGText)this.designPicture.SelectedElement).LineSpacing = modifiedText.LineSpacing; this.UpdateSelectedElementAndPropertyControl(modifiedText); } } else if (e.Shape is VGRichText) { var text = (VGRichText)e.Shape; var dlg = new RichTextDialog(); dlg.NewRichText = text; if (dlg.ShowDialog() == DialogResult.OK) { VGRichText modifiedText = dlg.NewRichText; ((VGRichText)this.designPicture.SelectedElement).RtfToDraw = modifiedText.RtfToDraw; this.UpdateSelectedElementAndPropertyControl(modifiedText); } } else if (e.Shape is VGImage) { var image = (VGImage)e.Shape; var dlg = new ImageDialog(); dlg.NewImage = image; if (dlg.ShowDialog() == DialogResult.OK) { VGImage modifiedImage = dlg.NewImage; ((VGImage)this.designPicture.SelectedElement).Filename = modifiedImage.Filename; ((VGImage)this.designPicture.SelectedElement).Filepath = modifiedImage.Filepath; ((VGImage)this.designPicture.SelectedElement).Layout = modifiedImage.Layout; ((VGImage)this.designPicture.SelectedElement).CreateInternalImage(); this.UpdateSelectedElementAndPropertyControl(modifiedImage); } } else if (e.Shape.StyleGroup != VGStyleGroup.AOI_TARGET) { var dlg = new ShapeDialog(); dlg.NewShape = e.Shape; if (dlg.ShowDialog() == DialogResult.OK) { this.UpdateSelectedElementAndPropertyControl(dlg.NewShape); } } else if (e.Shape.StyleGroup == VGStyleGroup.AOI_TARGET) { this.tctStandards.SelectedTab = this.tbpTargets; } this.designPicture.Invalidate(); }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="Button"/> <see cref="btnInstruction"/>. /// Shows a <see cref="TextDialog"/> to define a textual /// instruction that is added to all imported slides. /// </summary> /// <param name="sender">Source of the event.</param> /// <param name="e">An empty <see cref="EventArgs"/></param> private void btnInstruction_Click(object sender, EventArgs e) { TextDialog dlg = new TextDialog(); if (dlg.ShowDialog() == DialogResult.OK) { VGText text = dlg.NewText; this.cbbDesignedItem.Items.Add(text); this.cbbDesignedItem.SelectedItem = text; } }
/// <summary> /// This method opens a <see cref="TextDialog" /> to create a new /// <see cref="VGText" /> item on the slide. /// </summary> private void OpenNewInstructionDialog() { var dlg = new TextDialog(); if (dlg.ShowDialog() == DialogResult.OK) { this.designPicture.NewTextStart(dlg.NewText); } }