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);
        }
示例#2
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);
        }
示例#3
0
        static UIElement CloneImageBox(DesignBox dzBox)
        {
            UIHolderBox holderBox      = dzBox as UIHolderBox;
            var         originalImgBox = holderBox.TargetBox as LayoutFarm.CustomWidgets.ImageBox;
            var         newClone       = new UIHolderBox(holderBox.Width, holderBox.Height);

            newClone.BackColor = Color.White;
            var imgbox = new LayoutFarm.CustomWidgets.ImageBox(newClone.Width - 10, newClone.Height - 10);

            imgbox.ImageBinder = originalImgBox.ImageBinder;
            //clone content of text box

            newClone.SetCloneDelegate(CloneImageBox);
            newClone.SetSerializeDelegate(SerializeDzImageBox);
            newClone.AddChild(imgbox);
            newClone.TargetBox = imgbox;
            return(newClone);
        }
        static UIElement CloneTextBox(DesignBox dzBox)
        {
            UIHolderBox holderBox       = dzBox as UIHolderBox;
            var         originalTextBox = holderBox.TargetBox as LayoutFarm.CustomWidgets.TextBox;
            var         newClone        = new UIHolderBox(holderBox.Width, holderBox.Height);

            newClone.BackColor = Color.White;
            var textBox = new LayoutFarm.CustomWidgets.TextBox(newClone.Width - 10, newClone.Height - 10, true);

            textBox.BackgroundColor = Color.White;
            textBox.Text            = originalTextBox.Text;
            //clone content of text box

            newClone.SetCloneDelegate(CloneTextBox);
            newClone.SetSerializeDelegate(SerializeDzTextBox);
            newClone.AddChild(textBox);
            newClone.TargetBox = textBox;
            return(newClone);
        }
        public UIHolderBox AddNewImageBox(int x, int y, int w, int h, ImageBinder imgBinder)
        {
            //add new user box
            var box1 = new UIHolderBox(w, h);

            box1.BackColor = Color.White;
            box1.SetLocation(x, y);
            var imgBox = new LayoutFarm.CustomWidgets.ImageBox(imgBinder.Image.Width, imgBinder.Image.Height);

            imgBox.ImageBinder = imgBinder;
            box1.AddChild(imgBox);
            imgBox.SetLocation(10, 10);
            box1.TargetBox = imgBox;
            box1.SetSize(imgBinder.ImageWidth + 20, imgBinder.ImageHeight + 20);
            SetupActiveBoxProperties(box1);
            viewport.AddContent(box1);
            userBoxes.Add(box1);
            return(box1);
        }
        static UIElement CloneTextBox(DesignBox dzBox)
        {
            UIHolderBox holderBox = dzBox as UIHolderBox;
            var originalTextBox = holderBox.TargetBox as LayoutFarm.CustomWidgets.TextBox;
            var newClone = new UIHolderBox(holderBox.Width, holderBox.Height);
            newClone.BackColor = Color.White;
            var textBox = new LayoutFarm.CustomWidgets.TextBox(newClone.Width - 10, newClone.Height - 10, true);
            textBox.BackgroundColor = Color.White;
            textBox.Text = originalTextBox.Text;
            //clone content of text box 

            newClone.SetCloneDelegate(CloneTextBox);
            newClone.SetSerializeDelegate(SerializeDzTextBox);
            newClone.AddChild(textBox);
            newClone.TargetBox = textBox;
            return newClone;
        }
 public UIHolderBox AddNewImageBox(int x, int y, int w, int h, ImageBinder imgBinder)
 {
     //add new user box
     var box1 = new UIHolderBox(w, h);
     box1.BackColor = Color.White;
     box1.SetLocation(x, y);
     var imgBox = new LayoutFarm.CustomWidgets.ImageBox(imgBinder.Image.Width, imgBinder.Image.Height);
     imgBox.ImageBinder = imgBinder;
     box1.AddChild(imgBox);
     imgBox.SetLocation(10, 10);
     box1.TargetBox = imgBox;
     box1.SetSize(imgBinder.ImageWidth + 20, imgBinder.ImageHeight + 20);
     SetupActiveBoxProperties(box1);
     viewport.AddContent(box1);
     userBoxes.Add(box1);
     return box1;
 }
 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;
 }
 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;
 }
示例#10
0
        static UIElement CloneImageBox(DesignBox dzBox)
        {
            UIHolderBox holderBox = dzBox as UIHolderBox;
            var originalImgBox = holderBox.TargetBox as LayoutFarm.CustomWidgets.ImageBox;
            var newClone = new UIHolderBox(holderBox.Width, holderBox.Height);
            newClone.BackColor = Color.White;
            var imgbox = new LayoutFarm.CustomWidgets.ImageBox(newClone.Width - 10, newClone.Height - 10);
            imgbox.ImageBinder = originalImgBox.ImageBinder;
            //clone content of text box 

            newClone.SetCloneDelegate(CloneImageBox);
            newClone.SetSerializeDelegate(SerializeDzImageBox);
            newClone.AddChild(imgbox);
            newClone.TargetBox = imgbox;
            return newClone;
        }