Inheritance: UIElement, IScrollable, IBoxElement
Ejemplo n.º 1
0
 public override void SetSize(int width, int height)
 {
     base.SetSize(width, height);
     if (this.targetUI != null)
     {
         this.TargetBox = this.targetUI;
     }
 }
Ejemplo n.º 2
0
 public override void SetSize(int width, int height)
 {
     base.SetSize(width, height);
     if (this.targetUI != null)
     {
         this.TargetBox = this.targetUI;
     }
 }
Ejemplo n.º 3
0
 public void SetSize(int w, int h)
 {
     UI.UIBox box = uiElem as UI.UIBox;
     if (box == null)
     {
         return;
     }
     box.SetSize(w, h);
 }
Ejemplo n.º 4
0
        public void SetLocation(int left, int top)
        {
            UI.UIBox box = uiElem as UI.UIBox;
            if (box == null)
            {
                return;
            }

            box.SetLocation(left, top);
        }
Ejemplo n.º 5
0
        public FreeSpacesController(UIBox owner)
            : base(owner, SpaceConcept.NineSpaceFree)
        {
            spaces[L] = InitSpace(SpaceName.Left);
            spaces[R] = InitSpace(SpaceName.Right);
            spaces[T] = InitSpace(SpaceName.Top);
            spaces[B] = InitSpace(SpaceName.Bottom);
            spaces[C] = InitSpace(SpaceName.Center);

            spaces[LT] = InitSpace(SpaceName.LeftTop);
            spaces[RT] = InitSpace(SpaceName.RightTop);
            spaces[RB] = InitSpace(SpaceName.RightBottom);
            spaces[LB] = InitSpace(SpaceName.LeftBottom);
        }
Ejemplo n.º 6
0
        public NinespaceController(UIBox owner, SpaceConcept initConcept)
        {
            this.myOwner          = owner;
            this.dockSpaceConcept = initConcept;
            switch (initConcept)
            {
            case SpaceConcept.NineSpaceFree:
            case SpaceConcept.NineSpace:
            {
                spaces = new SpacePart[9];
            } break;

            default:
            {
                spaces = new SpacePart[5];
            } break;
            }
            this.sizeH = owner.Height;
            this.sizeW = owner.Width;
        }
Ejemplo n.º 7
0
 public NinespaceController(UIBox owner, SpaceConcept initConcept)
 {
     this.myOwner = owner;
     this.dockSpaceConcept = initConcept;
     switch (initConcept)
     {
         case SpaceConcept.NineSpaceFree:
         case SpaceConcept.NineSpace:
             {
                 spaces = new SpacePart[9];
             }
             break;
         default:
             {
                 spaces = new SpacePart[5];
             }
             break;
     }
     this.sizeH = owner.Height;
     this.sizeW = owner.Width;
 }
Ejemplo n.º 8
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.º 9
0
 public DzSetBoundsAction(UIBox box, Rectangle oldBounds, Rectangle newBounds)
 {
     this.dzBox = box;
     this.oldBounds = oldBounds;
     this.newBounds = newBounds;
 }
Ejemplo n.º 10
0
 public void HistoryRecordDzElementNewBounds(UIBox dzBox, Rectangle oldRect, Rectangle newRect)
 {
     this.dzCommandHistory.AddAction(new DzSetBoundsAction(dzBox, oldRect, newRect));
 }
Ejemplo n.º 11
0
 //-----------------------------------------------------------------------------------------------
 public void HistoryRecordDzElementNewPosition(UIBox dzBox, Point oldPoint, Point newPoint)
 {
     this.dzCommandHistory.AddAction(new DzSetLocationAction(dzBox, oldPoint, newPoint));
 }
Ejemplo n.º 12
0
 public UIHolderBox WrapWithHolderBox(int x, int y, UIBox uibox)
 {
     //create holder ui
     var box1 = new UIHolderBox(uibox.Width + 10, uibox.Height + 10);
     uibox.SetLocation(5, 5);
     box1.AddChild(uibox);
     box1.SetLocation(x, y);
     box1.TargetBox = uibox;
     SetupActiveBoxProperties(box1);
     userBoxes.Add(box1);
     return box1;
 }
Ejemplo n.º 13
0
 public UIHolderBox AddExternalControl(int x, int y, UIBox uibox)
 {
     //create holder ui
     var box1 = new UIHolderBox(uibox.Width + 10, uibox.Height + 10);
     uibox.SetLocation(5, 5);
     box1.AddChild(uibox);
     box1.SetLocation(x, y);
     box1.TargetBox = uibox;
     SetupActiveBoxProperties(box1);
     viewport.AddContent(box1);
     userBoxes.Add(box1);
     return box1;
 }
Ejemplo n.º 14
0
 public DzSetLocationAction(UIBox box, Point oldPoint, Point newPoint)
 {
     this.dzBox = box;
     this.oldPoint = oldPoint;
     this.newPoint = newPoint;
 }
Ejemplo n.º 15
0
 public void ReleaseTarget()
 {
     this.TargetBox          = null;
     this.MasterSelectionSet = null;
 }
Ejemplo n.º 16
0
 public DockSpacesController(UIBox owner, SpaceConcept initConcept)
     : base(owner, initConcept)
 {
     this.myOwner = owner;
     switch (initConcept)
     {
         case SpaceConcept.TwoSpaceHorizontal: //top-bottom
             {
                 spaces[L] = InitSpace(SpaceName.Left);
                 spaces[R] = InitSpace(SpaceName.Right);
             }
             break;
         case SpaceConcept.TwoSpaceVertical: //left-right
             {
                 spaces[T] = InitSpace(SpaceName.Top);
                 spaces[B] = InitSpace(SpaceName.Bottom);
             }
             break;
         case SpaceConcept.ThreeSpaceHorizontal:
             {
                 //left-center-right 
                 spaces[L] = InitSpace(SpaceName.Left);
                 spaces[C] = InitSpace(SpaceName.Center);
                 spaces[R] = InitSpace(SpaceName.Right);
             }
             break;
         case SpaceConcept.ThreeSpaceVertical:
             {
                 //top-center-bottom                        
                 spaces[T] = InitSpace(SpaceName.Top);
                 spaces[C] = InitSpace(SpaceName.Center);
                 spaces[B] = InitSpace(SpaceName.Bottom);
             }
             break;
         case SpaceConcept.FourSpace:
             {
                 spaces[FOURSPACE_LT] = InitSpace(SpaceName.LeftTop);
                 spaces[FOURSPACE_RT] = InitSpace(SpaceName.RightTop);
                 spaces[FOURSPACE_RB] = InitSpace(SpaceName.RightBottom);
                 spaces[FOURSPACE_LB] = InitSpace(SpaceName.LeftBottom);
             }
             break;
         case SpaceConcept.FiveSpace:
             {
                 spaces[L] = InitSpace(SpaceName.Left);
                 spaces[R] = InitSpace(SpaceName.Right);
                 spaces[T] = InitSpace(SpaceName.Top);
                 spaces[B] = InitSpace(SpaceName.Bottom);
                 spaces[C] = InitSpace(SpaceName.Center);
             }
             break;
         case SpaceConcept.NineSpace:
         default:
             {
                 spaces[L] = InitSpace(SpaceName.Left);
                 spaces[R] = InitSpace(SpaceName.Right);
                 spaces[T] = InitSpace(SpaceName.Top);
                 spaces[B] = InitSpace(SpaceName.Bottom);
                 spaces[C] = InitSpace(SpaceName.Center);
                 spaces[LT] = InitSpace(SpaceName.LeftTop);
                 spaces[RT] = InitSpace(SpaceName.RightTop);
                 spaces[RB] = InitSpace(SpaceName.RightBottom);
                 spaces[LB] = InitSpace(SpaceName.LeftBottom);
             }
             break;
     }
 }
Ejemplo n.º 17
0
        public static void WriteElement(DzBoxSerializer writer, UIBox uiElement, string elemName)
        {
            uiElement.Walk(writer);
            //writer.BeginElement(elemName);
            ////collect bounds and attrs
            //writer.AddAttribute("left", uiElement.Left.ToString());
            //writer.AddAttribute("top", uiElement.Top.ToString());
            //writer.AddAttribute("width", uiElement.Width.ToString());
            //writer.AddAttribute("height", uiElement.Height.ToString());
            ////-------------------------------------------------------

            ////content
            //writer.EndElement();
        }
Ejemplo n.º 18
0
        public static void WriteCommon(DzBoxSerializer writer, UIBox uiElement)
        {
            //find element type
            //var elemType = uiElement.GetType();

            //writer.BeginElement(elemName);
            ////collect bounds and attrs
            //writer.AddAttribute("left", uiElement.Left.ToString());
            //writer.AddAttribute("top", uiElement.Top.ToString());
            //writer.AddAttribute("width", uiElement.Width.ToString());
            //writer.AddAttribute("height", uiElement.Height.ToString());
            ////-------------------------------------------------------

            ////content
            //writer.EndElement();
        }
Ejemplo n.º 19
0
 public void ReleaseTarget()
 {
     this.TargetBox = null;
     this.MasterSelectionSet = null;
 }
Ejemplo n.º 20
0
        public DockSpacesController(UIBox owner, SpaceConcept initConcept)
            : base(owner, initConcept)
        {
            this.myOwner = owner;
            switch (initConcept)
            {
            case SpaceConcept.TwoSpaceHorizontal:     //top-bottom
            {
                spaces[L] = InitSpace(SpaceName.Left);
                spaces[R] = InitSpace(SpaceName.Right);
            }
            break;

            case SpaceConcept.TwoSpaceVertical:     //left-right
            {
                spaces[T] = InitSpace(SpaceName.Top);
                spaces[B] = InitSpace(SpaceName.Bottom);
            }
            break;

            case SpaceConcept.ThreeSpaceHorizontal:
            {
                //left-center-right
                spaces[L] = InitSpace(SpaceName.Left);
                spaces[C] = InitSpace(SpaceName.Center);
                spaces[R] = InitSpace(SpaceName.Right);
            }
            break;

            case SpaceConcept.ThreeSpaceVertical:
            {
                //top-center-bottom
                spaces[T] = InitSpace(SpaceName.Top);
                spaces[C] = InitSpace(SpaceName.Center);
                spaces[B] = InitSpace(SpaceName.Bottom);
            }
            break;

            case SpaceConcept.FourSpace:
            {
                spaces[FOURSPACE_LT] = InitSpace(SpaceName.LeftTop);
                spaces[FOURSPACE_RT] = InitSpace(SpaceName.RightTop);
                spaces[FOURSPACE_RB] = InitSpace(SpaceName.RightBottom);
                spaces[FOURSPACE_LB] = InitSpace(SpaceName.LeftBottom);
            }
            break;

            case SpaceConcept.FiveSpace:
            {
                spaces[L] = InitSpace(SpaceName.Left);
                spaces[R] = InitSpace(SpaceName.Right);
                spaces[T] = InitSpace(SpaceName.Top);
                spaces[B] = InitSpace(SpaceName.Bottom);
                spaces[C] = InitSpace(SpaceName.Center);
            }
            break;

            case SpaceConcept.NineSpace:
            default:
            {
                spaces[L]  = InitSpace(SpaceName.Left);
                spaces[R]  = InitSpace(SpaceName.Right);
                spaces[T]  = InitSpace(SpaceName.Top);
                spaces[B]  = InitSpace(SpaceName.Bottom);
                spaces[C]  = InitSpace(SpaceName.Center);
                spaces[LT] = InitSpace(SpaceName.LeftTop);
                spaces[RT] = InitSpace(SpaceName.RightTop);
                spaces[RB] = InitSpace(SpaceName.RightBottom);
                spaces[LB] = InitSpace(SpaceName.LeftBottom);
            }
            break;
            }
        }