Example #1
0
 public void Execute()
 {
     ActiveCanvas.DeselectAllShapes();
     foreach (Shape SelectedShape in AllShape)
     {
         ActiveCanvas.RemoveDrawnShape(SelectedShape);
     }
     ActiveCanvas.AddDrawnShape(GroupShape);
     GroupShape.Select();
 }
Example #2
0
 public void ToolMouseDown(object Sender, MouseEventArgs Event)
 {
     ActiveCanvas.DeselectAllShapes();
     if (Event.Button == MouseButtons.Left)
     {
         XPoint         = Event.X;
         YPoint         = Event.Y;
         this.LineShape = new Line(new System.Drawing.Point(Event.X, Event.Y))
         {
             Endpoint = new System.Drawing.Point(Event.X, Event.Y)
         };
         ActiveCanvas.AddDrawnShape(this.LineShape);
         LineShape.Select();
     }
 }
Example #3
0
        public void ToolMouseDown(object Sender, MouseEventArgs Event)
        {
            XPoint = Event.X;
            YPoint = Event.Y;

            if (Event.Button == MouseButtons.Left)
            {
                this.SelectionArea = new Selection(Event.X, Event.Y);
                this.ActiveCanvas.AddDrawnShape(this.SelectionArea);
            }
            else if (Event.Button == MouseButtons.Right)
            {
                bool IntersectShape = false;
                if (SelectedShapes != null)
                {
                    foreach (Shape SelectedShape in SelectedShapes)
                    {
                        if (SelectedShape.Intersect(Event.X, Event.Y))
                        {
                            IntersectShape = true;
                            break;
                        }
                    }
                }

                if (!IntersectShape)
                {
                    SelectedShapes = new List <Shape>();
                    ActiveCanvas.DeselectAllShapes();
                    Shape SelectedShape = ActiveCanvas.GetShapeAt(Event.X, Event.Y);
                    if (SelectedShape != null)
                    {
                        SelectedShape.Select();
                        SelectedShapes.Add(SelectedShape);
                        IntersectShape = true;
                    }
                }

                if (IntersectShape)
                {
                    this.MovementTrace = new MovementLine(new System.Drawing.Point(Event.X, Event.Y))
                    {
                        Endpoint = new System.Drawing.Point(Event.X, Event.Y)
                    };
                    ActiveCanvas.AddDrawnShape(this.MovementTrace);
                }
            }
        }
Example #4
0
 public void Execute()
 {
     LineShape          = new Line(new System.Drawing.Point(xStartpoint, yStartpoint));
     LineShape.Endpoint = new System.Drawing.Point(xEndpoint, yEndpoint);
     ActiveCanvas.AddDrawnShape(LineShape);
 }
Example #5
0
 public void Execute()
 {
     ActiveCanvas.AddDrawnShape(LineShape);
 }