Ejemplo n.º 1
0
        public void UpdateControllerBoxes(LayoutFarm.UI.UIBox box)
        {
            //move controller here
            controllerBox1.SetLocationAndSize(box.Left - 5, box.Top - 5,
                                              box.Width + 10, box.Height + 10);
            controllerBox1.Visible   = true;
            controllerBox1.TargetBox = box;


            {
                //left-top
                UIControllerBox ctrlBox = _boxLeftTop;
                ctrlBox.SetLocationAndSize(box.Left - 5, box.Top - 5, 5, 5);
                ctrlBox.TargetBox = box;
                ctrlBox.Visible   = true;
            }
            {
                //right-top
                UIControllerBox ctrlBox = _boxRightTop;
                ctrlBox.SetLocationAndSize(box.Left + box.Width, box.Top - 5, 5, 5);
                ctrlBox.TargetBox = box;
                ctrlBox.Visible   = true;
            }
            {
                //left-bottom
                UIControllerBox ctrlBox = _boxLeftBottom;
                ctrlBox.SetLocationAndSize(box.Left - 5, box.Top + box.Height, 5, 5);
                ctrlBox.TargetBox = box;
                ctrlBox.Visible   = true;
            }
            {
                //right-bottom
                UIControllerBox ctrlBox = _boxRightBottom;
                ctrlBox.SetLocationAndSize(box.Left + box.Width, box.Top + box.Height, 5, 5);
                ctrlBox.TargetBox = box;
                ctrlBox.Visible   = true;
            }
        }
Ejemplo n.º 2
0
        public void UpdateControllerBoxes(LayoutFarm.UI.AbstractRectUI targetBox)
        {
            //move controller here
            _centralBox.SetLocationAndSize(
                targetBox.Left - 5, targetBox.Top - 5,
                targetBox.Width + 10, targetBox.Height + 10);
            _centralBox.Visible   = true;
            _centralBox.TargetBox = targetBox;
            //------------
            //corners
            //------------
            {
                //left-top
                UIControllerBox ctrlBox = _boxLeftTop;
                ctrlBox.SetLocationAndSize(targetBox.Left - 5, targetBox.Top - 5, 5, 5);
                ctrlBox.TargetBox = targetBox;
                ctrlBox.Visible   = true;
            }
            {
                //right-top
                UIControllerBox ctrlBox = _boxRightTop;
                ctrlBox.SetLocationAndSize(targetBox.Left + targetBox.Width, targetBox.Top - 5, 5, 5);
                ctrlBox.TargetBox = targetBox;
                ctrlBox.Visible   = true;
            }
            {
                //left-bottom
                UIControllerBox ctrlBox = _boxLeftBottom;
                ctrlBox.SetLocationAndSize(targetBox.Left - 5, targetBox.Top + targetBox.Height, 5, 5);
                ctrlBox.TargetBox = targetBox;
                ctrlBox.Visible   = true;
            }
            {
                //right-bottom
                UIControllerBox ctrlBox = _boxRightBottom;
                ctrlBox.SetLocationAndSize(targetBox.Left + targetBox.Width, targetBox.Top + targetBox.Height, 5, 5);
                ctrlBox.TargetBox = targetBox;
                ctrlBox.Visible   = true;
            }


            //------------
            //mid-edges
            //------------
            {
                //left
                UIControllerBox ctrlBox = _midLeftSide;
                ctrlBox.SetLocationAndSize(targetBox.Left - 5, (targetBox.Top - 5) + (targetBox.Height / 2), 5, 5);
                ctrlBox.TargetBox = targetBox;
                ctrlBox.Visible   = true;
            }
            {
                //right
                UIControllerBox ctrlBox = _midRightSide;
                ctrlBox.SetLocationAndSize(targetBox.Left + targetBox.Width, targetBox.Top - 5 + (targetBox.Height / 2), 5, 5);
                ctrlBox.TargetBox = targetBox;
                ctrlBox.Visible   = true;
            }
            {
                //top
                UIControllerBox ctrlBox = _midTop;
                ctrlBox.SetLocationAndSize(targetBox.Left - 5 + (targetBox.Width / 2), targetBox.Top - 5, 5, 5);
                ctrlBox.TargetBox = targetBox;
                ctrlBox.Visible   = true;
            }
            {
                // bottom
                UIControllerBox ctrlBox = _midBottom;
                ctrlBox.SetLocationAndSize(targetBox.Left + (targetBox.Width / 2), targetBox.Bottom, 5, 5);
                ctrlBox.TargetBox = targetBox;
                ctrlBox.Visible   = true;
            }
            OnUpdateShape();
        }