Exemple #1
0
 /// <summary>
 /// 获取区域id
 /// </summary>
 /// <param name="area">区域实例</param>
 /// <returns></returns>
 public int GetAreaID(DockpanelArea area)
 {
     for (int i = 0; i < areas.Count; i++)
     {
         if (areas[i] == area)
         {
             return(i);
         }
     }
     return(-1);
 }
Exemple #2
0
        void InitialArea()
        {
            DockpanelArea area = new DockpanelArea(this);

            area.Left  = Left;
            area.Right = Right;
            area.Top   = Top;
            area.Down  = Down;
            MainArea   = area;
            area.SizeChanged();
        }
Exemple #3
0
        DockpanelArea AddDownArea(float y)
        {
            DockpanelArea area = new DockpanelArea(layout);
            var           line = AddHLine(y);

            area.SetLeftLine(Left);
            area.SetRightLine(Right);
            area.SetTopLine(line);
            area.SetDownLine(Down);
            SetDownLine(line);
            return(area);
        }
Exemple #4
0
        DockpanelArea AddRightArea(float x)
        {
            DockpanelArea area = new DockpanelArea(layout);
            var           line = AddVLine(x);

            area.SetLeftLine(line);
            area.SetRightLine(Right);
            area.SetTopLine(Top);
            area.SetDownLine(Down);
            SetRightLine(line);
            return(area);
        }
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="area">停靠面板区域实例</param>
 /// <param name="mod">停靠辅助区域模板</param>
 public void Initial(DockpanelArea area, UIElement mod)
 {
     dockArea          = area;
     model             = mod;
     docker            = mod.Find("Docker");
     tab               = mod.Find("TabControl");
     Cover             = mod.Find("Cover");
     control           = tab.composite as TabControl;
     Cover.activeSelf  = false;
     docker.activeSelf = false;
     InitialDocker();
 }
        public void Initial(DockpanelArea area, UIElement mod)
        {
            dockArea = area;
            model    = mod;
            var trans = mod.transform;

            docker  = trans.Find("Docker");
            tab     = trans.Find("TabControl").GetComponent <UIElement>();
            Cover   = trans.Find("Cover").GetComponent <UIElement>();
            control = tab.composite as TabControl;
            Cover.gameObject.SetActive(false);
            docker.gameObject.SetActive(false);
            InitialDocker();
        }
Exemple #7
0
 public void Initial(DockpanelArea area, ModelElement mod)
 {
     dockArea = area;
     model    = mod;
     docker   = model.Find("Docker");
     tab      = model.Find("TabControl");
     Cover    = model.Find("Cover");
     control  = new TabControl();
     control.Initial(tab);
     mod.SetParent(area.model);
     Cover.activeSelf  = false;
     docker.activeSelf = false;
     InitialDocker();
 }
        DockpanelArea AddDownArea(float r)
        {
            DockpanelArea area = new DockpanelArea(layout);

            layout.areas.Add(area);
            var line = AddHorizontalLine(r);

            area.SetLeftLine(Left);
            area.SetRightLine(Right);
            area.SetTopLine(line);
            area.SetDownLine(Down);
            SetDownLine(line);
            //UIElement.ResizeChild(model);
            return(area);
        }
        DockpanelArea AddRightArea(float r)
        {
            DockpanelArea area = new DockpanelArea(layout);

            layout.areas.Add(area);
            var line = AddVerticalLine(1 - r);

            area.SetLeftLine(line);
            area.SetRightLine(Right);
            area.SetTopLine(Top);
            area.SetDownLine(Down);
            SetRightLine(line);
            //UIElement.ResizeChild(model);
            return(area);
        }
        void InitialArea()
        {
            ModelElement m = new ModelElement();

            m.Load(AreaMod.ModData);
            DockpanelArea area = new DockpanelArea(this);

            area.Left  = Left;
            area.Right = Right;
            area.Top   = Top;
            area.Down  = Down;
            areas.Add(area);
            MainArea = area;
            area.SizeChanged();
        }
        DockpanelArea AddTopArea(float r)
        {
            DockpanelArea area = new DockpanelArea(layout);

            layout.areas.Add(area);
            var line = AddHorizontalLine(1 - r);

            area.SetLeftLine(Left);
            area.SetRightLine(Right);
            area.SetTopLine(Top);
            area.SetDownLine(line);
            SetTopLine(line);
            ModelElement.ScaleSize(model);
            return(area);
        }
        DockpanelArea AddLeftArea(float r)
        {
            DockpanelArea area = new DockpanelArea(layout);

            layout.areas.Add(area);
            var line = AddVerticalLine(r);

            area.SetLeftLine(Left);
            area.SetRightLine(line);
            area.SetTopLine(Top);
            area.SetDownLine(Down);
            SetLeftLine(line);
            ModelElement.ScaleSize(model);
            return(area);
        }
Exemple #13
0
 public LayoutAuxiliary(DockpanelArea area)
 {
     layoutArea = area;
     layout     = area.layout as DesignedDockPanel;
     model      = new ModelElement();
     model.Load(layout.Auxiliary.ModData);
     head              = model.Find("Head");
     panel             = head.GetComponent <LayoutElement>();
     headHigh          = head.data.sizeDelta.y;
     docker            = model.Find("Docker");
     docker.activeSelf = false;
     content           = model.Find("Content");
     model.SetParent(area.model);
     Item             = model.Find("Item");
     Item.activeSelf  = false;
     Cover            = model.Find("Cover");
     Cover.activeSelf = false;
     InitialDocker();
 }
 public void SetParent(DockpanelArea area)
 {
     dockArea = area;
     model.transform.SetParent(area.model.transform);
 }
Exemple #15
0
 /// <summary>
 /// 附属于某个停靠区域
 /// </summary>
 /// <param name="area">停靠区域</param>
 public void SetParent(DockpanelArea area)
 {
     dockArea = area;
     model.SetParent(area.model);
 }