Exemple #1
0
        public void ToolHotKeysDown(object sender, KeyEventArgs e)
        {
            Console.WriteLine(e.KeyCode);
            if (e.KeyCode == System.Windows.Forms.Keys.ControlKey)
            {
                multiselectProcess = true;
            }

            else if (e.KeyCode == System.Windows.Forms.Keys.I)
            {
                if (memberGroup.Count() > 0)
                {
                    this.objIntersect();
                    GroupShape groupObject = new GroupShape();
                    foreach (DrawingObject obj in memberGroup)
                    {
                        groupObject.addMember(obj);
                    }

                    groupObject.ChangeState(EditingState.GetInstance());
                    this.canvas.AddDrawingObject(groupObject);
                    this.currentObject = groupObject;
                }
            }
        }
Exemple #2
0
 public void ToolMouseDown(object sender, MouseEventArgs e)
 {
     this.xInitial = e.X;
     this.yInitial = e.Y;
     if (currentObject != null && !multiselectProcess)
     {
         currentObject.ChangeState(StaticState.GetInstance());
     }
     foreach (DrawingObject obj in this.canvas.getListDrawingObject().Reverse <DrawingObject>())
     {
         if (obj.intersect(e.Location))
         {
             if (!multiselectProcess)
             {
                 memberGroup.Clear();
             }
             else
             {
                 if (!memberGroup.Any() && this.currentObject != null)
                 {
                     memberGroup.Add(this.currentObject);
                 }
                 memberGroup.Add(obj);
             }
             this.currentObject = obj;
             obj.ChangeState(EditingState.GetInstance());
             break;
         }
     }
 }