示例#1
0
        public void ToolMouseDown(object sender, MouseEventArgs e)
        {
            /*this.xInitial = e.X;
            *  this.yInitial = e.Y;*/
            this.move          = new MoveCommand();
            this.move.xInitial = e.X;
            this.move.yInitial = e.Y;
            this.move.xInit    = e.X;
            this.move.yInit    = e.Y;

            if (e.Button == MouseButtons.Left && canvas != null)
            {
                canvas.DeselectAllObjects();
                Debug.WriteLine("Memanggil method SelectObjectAt pada Panel(DefaultPanel) melalui SelectionTool.cs..");
                //selectedObject = canvas.SelectObjectAt(e.X, e.Y);
                this.move.selectedObject = canvas.SelectObjectAt(e.X, e.Y);
                this.rectangle           = canvas.GetRectangleObjectAt(e.X, e.Y);
                if (this.move.selectedObject != null)
                {
                    canvas.GetButton(this.move.selectedObject.ID);
                    //selectedBtnObject = canvas.SelectButtonObjectByID(selectedObject.ID);
                    this.move.selectedBtnObject = canvas.SelectButtonObjectByID(this.move.selectedObject.ID);
                }
                Debug.WriteLine("Sudah selesai menjalankan method SelectObjectAt pada Panel(DefaultPanel) melalui SelectionTool.cs..");
            }
        }