/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRegion( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, newBounds, newStyleGroup, newName, newElementGroup, null) { this.region = new Region(); this.region.MakeEmpty(); this.region.Union(newBounds); }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGBrowser class. /// </summary> /// <param name="newShapeDrawAction"><see cref="ShapeDrawAction"/> for the bounds.</param> /// <param name="newBrowserURL"><see cref="Uri"/> for the browser start location</param> /// <param name="newBrowseDepth">The number of links the user is allowed to follow, /// including backward links.</param> /// <param name="newPen">Pen to use</param> /// <param name="newBrush">Brush for drawing</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="position">TopLeft text position</param> /// <param name="size">Size of the clipping rectangle.</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGBrowser( ShapeDrawAction newShapeDrawAction, string newBrowserURL, int newBrowseDepth, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, PointF position, SizeF size, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, new RectangleF(position, size), newStyleGroup, newName, newElementGroup, null) { this.InitializeFields(); this.BrowserURL = newBrowserURL; this.BrowseDepth = newBrowseDepth; }
/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newBounds">bounding rectangle</param> public VGRegion(ShapeDrawAction newShapeDrawAction, Brush newBrush, RectangleF newBounds) : base(newShapeDrawAction, newBrush, newBounds) { this.region = new Region(); this.region.MakeEmpty(); this.region.Union(newBounds); }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGRichText class. /// </summary> /// <param name="newShapeDrawAction"><see cref="ShapeDrawAction"/> for the bounds.</param> /// <param name="newRtf">string to display</param> /// <param name="newTransparency">A flag indicating a transparent background if true.</param> /// <param name="newPen">Pen to use</param> /// <param name="newBrush">Brush for drawing</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="position">TopLeft text position</param> /// <param name="size">Size of the clipping rectangle.</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRichText( ShapeDrawAction newShapeDrawAction, string newRtf, bool newTransparency, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, PointF position, SizeF size, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, new RectangleF(position, size), newStyleGroup, newName, newElementGroup, null) { this.RebuildUnderlyingRichTextBox(); this.richTextBox.Rtf = newRtf; this.textLength = this.richTextBox.TextLength; }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGLine class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> public VGLine(ShapeDrawAction newShapeDrawAction, Pen newPen) : base(newShapeDrawAction, newPen) { this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/////////////////////////////////////////////////////////////////////////////// // Defining Constants // /////////////////////////////////////////////////////////////////////////////// #region CONSTANTS #endregion //CONSTANTS /////////////////////////////////////////////////////////////////////////////// // Defining Variables, Enumerations, Events // /////////////////////////////////////////////////////////////////////////////// #region FIELDS #endregion //FIELDS /////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGScrollImage class. /// When newShapeDrawAction is set to None, only the image will /// be drawn, with Edge an additional border is drawn, /// with fill an additional (hopefully transparent) fill is drawn over the image. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both, None</param> /// <param name="newPen">Pen for additional borderline.</param> /// <param name="newBrush">Brush for additional fills.</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="newImageFile">filename without path</param> /// <param name="newPath">path to image file</param> /// <param name="newLayout"><see cref="ImageLayout"/> of the image</param> /// <param name="newAlpha">The transparency alpha for this image.0=transparent,1=opaque</param> /// <param name="newCanvas"><see cref="Size"/> of the owning original canvas</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGScrollImage( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, string newImageFile, string newPath, ImageLayout newLayout, float newAlpha, Size newCanvas, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, newImageFile, newPath, newLayout, newAlpha, newCanvas, newStyleGroup, newName, newElementGroup, false) { }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGFlash class. /// </summary> /// <param name="newShapeDrawAction"><see cref="ShapeDrawAction"/> for the bounds.</param> /// <param name="newFilename">Filename of the flash movie without path</param> /// <param name="newPath">Path to the flash movie.</param> /// <param name="newPen">Pen to use</param> /// <param name="newBrush">Brush for drawing</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="position">TopLeft text position</param> /// <param name="size">Size of the clipping rectangle.</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGFlash( ShapeDrawAction newShapeDrawAction, string newFilename, string newPath, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, PointF position, SizeF size, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, new RectangleF(position, size), newStyleGroup, newName, newElementGroup, null) { this.IntializeFields(); this.Filepath = newPath; this.Filename = newFilename; }
/// <summary> /// Initializes a new instance of the VGLine class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="pt1">first point</param> /// <param name="pt2">second point</param> public VGLine(ShapeDrawAction newShapeDrawAction, Pen newPen, PointF pt1, PointF pt2) : base(newShapeDrawAction, newPen) { this.firstPoint = pt1; this.secondPoint = pt2; this.Bounds = this.GetBounds(); this.pointsAreSet = true; }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGArrow class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> public VGArrow(ShapeDrawAction newShapeDrawAction, Pen newPen) : base(newShapeDrawAction, newPen) { this.InitializeDefaults(); this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Brush newBrush, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGArrow class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="pt1">first point</param> /// <param name="pt2">second point</param> public VGArrow(ShapeDrawAction newShapeDrawAction, Pen newPen, PointF pt1, PointF pt2) : base(newShapeDrawAction, newPen) { this.InitializeDefaults(); this.firstPoint = pt1; this.secondPoint = pt2; this.Bounds = this.GetBounds(); this.pointsAreSet = true; }
/// <summary> /// Initializes a new instance of the VGPolyline class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGPolyline( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Path = new GraphicsPath(); }
/// <summary> /// Initializes a new instance of the VGSharp class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGSharp( ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGRectangle class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRectangle( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Bounds = Rectangle.Empty; }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGRectangle class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRectangle( ShapeDrawAction newShapeDrawAction, Brush newBrush, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRegion( ShapeDrawAction newShapeDrawAction, Brush newBrush, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newStyleGroup, newName, newElementGroup) { this.region = new Region(); this.region.MakeEmpty(); }
/////////////////////////////////////////////////////////////////////////////// // Methods and Eventhandling for Background tasks // /////////////////////////////////////////////////////////////////////////////// #region BACKGROUNDWORKER #endregion //BACKGROUNDWORKER /////////////////////////////////////////////////////////////////////////////// // Inherited methods // /////////////////////////////////////////////////////////////////////////////// #region OVERRIDES #endregion //OVERRIDES /////////////////////////////////////////////////////////////////////////////// // Methods for doing main class job // /////////////////////////////////////////////////////////////////////////////// #region METHODS /// <summary> /// This method updates the edge and fill properties of the rich text /// with the given values /// </summary> /// <param name="newShapeDrawAction">The new <see cref="ShapeDrawAction"/></param> /// <param name="brush">The new <see cref="Brush"/> for the fill.</param> private void UpdateShapeProperties(ShapeDrawAction newShapeDrawAction, Brush brush) { this.rtbInstruction.BackColor = Color.Transparent; this.rtbInstruction.BackgroundImage = Properties.Resources.CheckBoard; if ((newShapeDrawAction & ShapeDrawAction.Fill) == ShapeDrawAction.Fill) { this.FillBackground(brush); } this.Refresh(); }
/// <summary> /// Initializes a new instance of the VGLine class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGLine( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/// <summary> /// Initializes a new instance of the VGSharp class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGSharp( ShapeDrawAction newShapeDrawAction, Pen newPen, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newFont, newFontColor, newBounds, newStyleGroup, newName, newElementGroup) { }
private void SetDrawAction(ShapeDrawAction value) { switch (value) { case ShapeDrawAction.None: chbDrawName.Checked = false; chbDrawEdge.Checked = false; chbDrawFill.Checked = false; break; case ShapeDrawAction.Edge: chbDrawName.Checked = false; chbDrawEdge.Checked = true; chbDrawFill.Checked = false; break; case ShapeDrawAction.Fill: chbDrawName.Checked = false; chbDrawEdge.Checked = false; chbDrawFill.Checked = true; break; case ShapeDrawAction.EdgeAndFill: chbDrawName.Checked = false; chbDrawEdge.Checked = true; chbDrawFill.Checked = true; break; case ShapeDrawAction.Name: chbDrawName.Checked = true; chbDrawEdge.Checked = false; chbDrawFill.Checked = false; break; case ShapeDrawAction.NameAndEdge: chbDrawName.Checked = true; chbDrawEdge.Checked = true; chbDrawFill.Checked = false; break; case ShapeDrawAction.NameAndFill: chbDrawName.Checked = true; chbDrawEdge.Checked = false; chbDrawFill.Checked = true; break; case ShapeDrawAction.NameEdgeFill: chbDrawName.Checked = true; chbDrawEdge.Checked = true; chbDrawFill.Checked = true; break; } }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newFont, newFontColor, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRegion( ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newBounds, newStyleGroup, newName, newElementGroup) { this.region = new Region(); this.region.MakeEmpty(); this.region.Union(newBounds); }
/// <summary> /// Initializes a new instance of the VGPolyline class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="pts">Point list that constitutes polyline</param> public VGPolyline(ShapeDrawAction newShapeDrawAction, Pen newPen, PointF[] pts) : base(newShapeDrawAction, newPen) { this.Path = new GraphicsPath(); if (pts.Length >= 2) { this.Path.AddLines(pts); } else if (pts.Length == 1) { this.FirstPt = pts[0]; } }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRegion( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newBrush, newBounds, newStyleGroup, newName, newElementGroup) { this.region = new Region(); this.region.MakeEmpty(); this.region.Union(newBounds); }
/// <summary> /// Initializes a new instance of the VGLine class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="pt1">first point</param> /// <param name="pt2">second point</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGLine( ShapeDrawAction newShapeDrawAction, Pen newPen, PointF pt1, PointF pt2, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.firstPoint = pt1; this.secondPoint = pt2; this.Bounds = this.GetBounds(); this.pointsAreSet = true; }
/// <summary> /// Initializes a new instance of the VGArrow class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGArrow( ShapeDrawAction newShapeDrawAction, Pen newPen, Font newFont, Color newFontColor, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newFont, newFontColor, newStyleGroup, newName, newElementGroup) { this.InitializeDefaults(); this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the ShapePropertiesChangedEventArgs class. /// </summary> /// <param name="newDrawAction">New <see cref="ShapeDrawAction"/> that should be used.</param> /// <param name="newPen">new <see cref="Pen"/> for the element.</param> /// <param name="newBrush">new <see cref="Brush"/> for the element.</param> /// <param name="newFont">new <see cref="Font"/> for the element.</param> /// <param name="newFontColor">new font <see cref="Color"/> for the element.</param> /// <param name="newName">new elements name.</param> /// <param name="newAlignment">new elements <see cref="VGAlignment"/>.</param> public ShapePropertiesChangedEventArgs( ShapeDrawAction newDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, string newName, VGAlignment newAlignment) { this.drawAction = newDrawAction; this.pen = newPen; this.brush = newBrush; this.font = newFont; this.fontColor = newFontColor; this.name = newName; this.newFontAlignment = newAlignment; }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGImage class. /// When newShapeDrawAction is set to None, only the image will /// be drawn, with Edge an additional border is drawn, /// with fill an additional (hopefully transparent) fill is drawn over the image. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both, None</param> /// <param name="newPen">Pen for additional borderline.</param> /// <param name="newBrush">Brush for additional fills.</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="newImageFile">filename without path</param> /// <param name="newPath">path to image file</param> /// <param name="newLayout"><see cref="ImageLayout"/> of the image</param> /// <param name="newAlpha">The transparency alpha for this image.0=transparent,1=opaque</param> /// <param name="newCanvas"><see cref="Size"/> of the owning original canvas</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> /// <param name="withoutImageInMemoryCreation">Omits internal image creation during /// construction.</param> public VGImage( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, string newImageFile, string newPath, ImageLayout newLayout, float newAlpha, Size newCanvas, VGStyleGroup newStyleGroup, string newName, string newElementGroup, bool withoutImageInMemoryCreation) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, RectangleF.Empty, newStyleGroup, newName, newElementGroup, null) { this.filename = newImageFile; this.Filepath = newPath; this.canvas = newCanvas; this.alpha = newAlpha; if (!withoutImageInMemoryCreation) { if (!this.CreateInternalImage()) { return; } var unit = new GraphicsUnit(); this.Bounds = this.Image.GetBounds(ref unit); } this.layout = newLayout; this.InitTransparencyMatrix(); }
/// <summary> /// Get current <see cref="ShapeDrawAction"/> /// according to checkbox selections in shape design panel. /// </summary> /// <returns>A <see cref="ShapeDrawAction"/> that should be used for /// the current element.</returns> private ShapeDrawAction GetDrawAction() { ShapeDrawAction newShapeDrawAction = ShapeDrawAction.None; if (chbDrawName.Checked) { newShapeDrawAction |= ShapeDrawAction.Name; } if (chbDrawEdge.Checked) { newShapeDrawAction |= ShapeDrawAction.Edge; } if (chbDrawFill.Checked) { newShapeDrawAction |= ShapeDrawAction.Fill; } return(newShapeDrawAction); }
/// <summary> /// Initializes a new instance of the VGPolyline class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="pts">Point list that constitutes polyline</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGPolyline( ShapeDrawAction newShapeDrawAction, Pen newPen, PointF[] pts, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Path = new GraphicsPath(); if (pts.Length >= 2) { this.Path.AddLines(pts); } else if (pts.Length == 1) { this.FirstPt = pts[0]; } }
/// <summary> /// Initializes a new instance of the VGPolyline class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGPolyline( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, RectangleF.Empty, newStyleGroup, newName, newElementGroup, null) { this.Path = new GraphicsPath(); }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">Bounds of element</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGElement( ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) { this.InitStandards(); this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.shapeDrawAction = newShapeDrawAction; this.pen = newPen == null ? null : (Pen)newPen.Clone(); this.Bounds = newBounds; }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for text and fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">Bounds of element</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> /// <param name="newSound">The <see cref="AudioFile"/> to play with this element.</param> public VGElement( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup, AudioFile newSound) { this.InitStandards(); this.pen = newPen == null ? null : (Pen)newPen.Clone(); this.Brush = newBrush == null ? null : (Brush)newBrush.Clone(); this.Bounds = newBounds; this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.Font = newFont == null ? null : (Font)newFont.Clone(); this.FontColor = newFontColor; this.shapeDrawAction = newShapeDrawAction; if (newSound != null) { this.Sound = (AudioFile)newSound.Clone(); } }
/// <summary> /// Virtual. An override should reset this shape to default values. /// This base class implementation resets the base class fields. /// </summary> public virtual void Reset() { this.TextAlignment = VGAlignment.Center; this.Brush = DefaultBrush; this.Font = DefaultFont; this.FontColor = DefaultFontColor; this.Visible = true; this.GrabHandles.Clear(); this.styleGroup = VGStyleGroup.None; this.isInEditMode = false; this.Modified = false; this.location = new PointF(0, 0); this.ModifierKeys = Keys.None; this.pen = DefaultPen; this.shapeDrawAction = ShapeDrawAction.Edge; this.size = new SizeF(100, 100); this.name = string.Empty; }
/// <summary> /// Initializes a new instance of the VGArrow class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGArrow( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.InitializeDefaults(); this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, newBounds, newStyleGroup, newName, newElementGroup, null) { }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for text and fills</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGElement( ShapeDrawAction newShapeDrawAction, Brush newBrush, VGStyleGroup newStyleGroup, string newName, string newElementGroup) { this.InitStandards(); this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.shapeDrawAction = newShapeDrawAction; this.Brush = newBrush == null ? null : (Brush)newBrush.Clone(); }
/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> public VGRegion(ShapeDrawAction newShapeDrawAction, Brush newBrush) : base(newShapeDrawAction, newBrush) { this.region = new Region(); this.region.MakeEmpty(); }
/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> public VGRegion(ShapeDrawAction newShapeDrawAction, Pen newPen) : base(newShapeDrawAction, newPen) { this.region = new Region(); this.region.MakeEmpty(); }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGElement( ShapeDrawAction newShapeDrawAction, Pen newPen, Font newFont, Color newFontColor, VGStyleGroup newStyleGroup, string newName, string newElementGroup) { this.InitStandards(); this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.Font = newFont == null ? null : (Font)newFont.Clone(); this.FontColor = newFontColor; this.shapeDrawAction = newShapeDrawAction; this.pen = newPen == null ? null : (Pen)newPen.Clone(); }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for text and fills</param> public VGElement(ShapeDrawAction newShapeDrawAction, Brush newBrush) { this.InitStandards(); this.shapeDrawAction = newShapeDrawAction; this.Brush = newBrush == null ? null : (Brush)newBrush.Clone(); }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for text and fills</param> /// <param name="newBounds">Bounds of element</param> public VGElement(ShapeDrawAction newShapeDrawAction, Brush newBrush, RectangleF newBounds) { this.InitStandards(); this.shapeDrawAction = newShapeDrawAction; this.Brush = newBrush == null ? null : (Brush)newBrush.Clone(); this.Bounds = newBounds; }
/// <summary> /// Initializes a new instance of the VGLine class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGLine( ShapeDrawAction newShapeDrawAction, Pen newPen, Font newFont, Color newFontColor, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newFont, newFontColor, newStyleGroup, newName, newElementGroup) { this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> public VGElement(ShapeDrawAction newShapeDrawAction, Pen newPen) { this.InitStandards(); this.shapeDrawAction = newShapeDrawAction; this.pen = newPen == null ? null : (Pen)newPen.Clone(); }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">Bounds of element</param> public VGElement(ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds) { this.InitStandards(); this.shapeDrawAction = newShapeDrawAction; this.pen = newPen == null ? null : (Pen)newPen.Clone(); this.Bounds = newBounds; }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for text and fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">Bounds of element</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGElement( ShapeDrawAction newShapeDrawAction, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) { this.InitStandards(); this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.shapeDrawAction = newShapeDrawAction; this.Brush = newBrush == null ? null : (Brush)newBrush.Clone(); this.Font = newFont == null ? null : (Font)newFont.Clone(); this.FontColor = newFontColor; this.Bounds = newBounds; }