Example #1
0
    public override void Initial(ModelElement parent, object dat = null)
    {
        model = ModelManagerUI.CloneModel("baseUI", "layout");
        base.Initial(parent, dat);
        view = HotReflection.ComponentReflection <View>(model);
        var area = view.Layout.MainContent;

        area.AddContent("page0");
        var d       = area.AddArea(DockpanelArea.Dock.Down, 0.3f);
        var context = d.AddContent("page1");

        d.model.parent.GetComponent <ImageElement>().color = Color.red;
        var one = d.AddArea(DockpanelArea.Dock.Right, 0.4f);

        context = one.AddContent("page2");
        //context.LoadPopWindow<GridTestWindow>();///无法跨域继承
        //d.Refresh();

        one.model.parent.GetComponent <ImageElement>().color = Color.green;
        var top = area.AddArea(DockpanelArea.Dock.Top, 0.2f);

        top.AddContent("page3");

        top.model.parent.GetComponent <ImageElement>().color = Color.yellow;
        var l = top.AddArea(DockpanelArea.Dock.Left, 0.4f);

        l.model.parent.GetComponent <ImageElement>().color = Color.blue;
        l.control.headDock = TabControl.HeadDock.Down;

        context = l.AddContent("page5");
        //context.LoadPopWindow<GridTestWindow2>();///无法跨域继承
        //l.Refresh();
        view.Last.Click = (o, e) => { LoadPage <TestPageH>(); };
        view.Next.Click = (o, e) => { LoadPage <DrawPageH>(); };
    }
Example #2
0
 public override void Initial(ModelElement parent, object dat = null)
 {
     model = ModelManagerUI.CloneModel("baseUI", "tab");
     base.Initial(parent, dat);
     view = HotReflection.ComponentReflection <View>(model);
     view.col.AddContent(ModelElement.CreateNew("test"), "test");
     view.col.AddContent(ModelElement.CreateNew("testB"), "testB");
 }
Example #3
0
    public override void Initial(ModelElement parent, object dat = null)
    {
        model = ModelManagerUI.CloneModel("baseUI", "scrollex");
        base.Initial(parent, dat);
        view = HotReflection.ComponentReflection <View>(model);
        List <ScrollYExtand.DataTemplate> datas = new List <ScrollYExtand.DataTemplate>();

        ScrollYExtand.DataTemplate tmp = new ScrollYExtand.DataTemplate();
        tmp.Title = "test1";
        List <string> list = new List <string>();

        for (int i = 0; i < 22; i++)
        {
            list.Add("tttt" + i.ToString());
        }
        tmp.Hide = true;
        tmp.Data = list;
        datas.Add(tmp);

        tmp       = new ScrollYExtand.DataTemplate();
        tmp.Title = "test2";
        list      = new List <string>();
        for (int i = 0; i < 11; i++)
        {
            list.Add("tttt" + i.ToString());
        }
        tmp.Hide = true;
        tmp.Data = list;
        datas.Add(tmp);

        tmp       = new ScrollYExtand.DataTemplate();
        tmp.Title = "test3";
        list      = new List <string>();
        for (int i = 0; i < 7; i++)
        {
            list.Add("tttt" + i.ToString());
        }
        tmp.Hide = true;
        tmp.Data = list;
        datas.Add(tmp);

        view.scroll.BindingData = datas;
        view.scroll.SetTitleUpdate(TitleUpdate, (o) => { return(HotReflection.ComponentReflection <TitleItem>(o)); });
        view.scroll.SetItemUpdate(ItemUpdate, (o) => { return(HotReflection.ComponentReflection <SubItem>(o)); });
        view.scroll.Refresh();

        List <string> rr = new List <string>();

        for (int i = 0; i < 33; i++)
        {
            rr.Add(i.ToString());
        }
        view.Dropdown.BindingData = rr;

        view.Last.Click = (o, e) => { LoadPage <DrawPageH>(); };
        view.Next.Click = (o, e) => { LoadPage <AniTestPageH>(); };
    }
Example #4
0
 public override void Initial(ModelElement parent, object dat = null)
 {
     model = ModelManagerUI.CloneModel("baseUI", "anitest");
     base.Initial(parent, dat);
     view = HotReflection.ComponentReflection <View>(model);
     view.rocker.Rocking = Rocking;
     view.rocker.Radius  = 100;
     view.render.LoadAsync(() => new RolePageH(), null);
     view.Last.Click = (o, e) => { LoadPage <ScrollExTestPageH>(); };
     view.Next.Click = (o, e) => { LoadPage <TestPageH>(); };
 }
Example #5
0
    public override void Initial(ModelElement parent, object dat = null)
    {
        model = ModelManagerUI.CloneModel("baseUI", "asd");
        // view =LoadUI<View>("baseUI","asd");
        base.Initial(parent, dat);
        view = HotReflection.ComponentReflection <View>(model);
        //model.SetParent(UIPage.Root);
        // var view = model.ComponentReflection<View>();

        TreeViewNode node = new TreeViewNode();

        node.content = "root";
        for (int i = 0; i < 10; i++)
        {
            TreeViewNode son = new TreeViewNode();
            son.content = i.ToString() + "tss";
            node.child.Add(son);
            for (int j = 0; j < 6; j++)
            {
                TreeViewNode r = new TreeViewNode();
                r.content = j.ToString() + "sdfsdf";
                son.child.Add(r);
            }
        }
        view.TreeView.nodes = node;
        view.TreeView.Refresh();
        view.Log.TipString = "input";

        List <int> testData = new List <int>();

        for (int i = 0; i < 166; i++)
        {
            testData.Add(i);
        }
        view.ScrollX.scroll.BindingData = testData;
        view.ScrollX.scroll.SetItemUpdate((o, e, i) => { Item it = o as Item;  it.Text.text = i.ToString(); }, (o) => { return(HotReflection.ComponentReflection <Item>(o)); });
        view.ScrollX.scroll.Refresh();

        view.ScrollY.scroll.BindingData = testData;
        view.ScrollY.scroll.SetItemUpdate((o, e, i) => { Item it = o as Item; it.Text.text = i.ToString(); }, (o) => { return(HotReflection.ComponentReflection <Item>(o)); });
        view.ScrollY.scroll.Refresh();

        view.Scroll.BindingData = testData;
        view.Scroll.Column      = 16;
        view.Scroll.SetItemUpdate((o, e, i) => { Item it = o as Item; it.Text.text = i.ToString(); }, (o) => { return(HotReflection.ComponentReflection <Item>(o)); });
        view.Scroll.Refresh();
        view.Last.Click = (o, e) => { LoadPage <AniTestPageH>(); };
        view.Next.Click = (o, e) => { LoadPage <LayoutTestPageH>(); };
    }
Example #6
0
 public override void Initial(ModelElement parent, object dat = null)
 {
     model = ModelManagerUI.CloneModel("baseUI", "drawing");
     base.Initial(parent, dat);
     view = HotReflection.ComponentReflection <View>(model);
     view.Palette.TemplateChanged = view.Palette.ColorChanged = (o) => {
         view.draw.BrushColor = o.SelectColor;
         view.color.color     = o.SelectColor;
     };
     view.sizeS.OnValueChanged = (o) => {
         float a = o.Percentage * 78;
         a += 2;
         view.draw.BrushSize = a;
         view.tip.text       = "画笔尺寸:" + a.ToString();
     };
     view.mod0.Click = (o, e) => { view.draw.drawModel = Paint.DrawModel.Brush; };
     view.mod1.Click = (o, e) => { view.draw.drawModel = Paint.DrawModel.Scale; };
     view.mod2.Click = (o, e) => { view.draw.drawModel = Paint.DrawModel.Rotate; };
     view.Last.Click = (o, e) => { LoadPage <LayoutTestPageH>(); };
     view.Next.Click = (o, e) => { LoadPage <ScrollExTestPageH>(); };
 }