public override void Initial(ModelElement parent, object dat = null) { model = ModelManagerUI.CloneModel("baseUI", "layout"); base.Initial(parent, dat); view = model.ComponentReflection <View>(); 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 <TestPage>(); }; view.Next.Click = (o, e) => { LoadPage <DrawPage>(); }; }
public override void Initial(ModelElement parent, object dat = null) { model = ModelManagerUI.CloneModel("baseUI", "layout"); base.Initial(parent, dat); view = model.ComponentReflection <View>(); var area = view.Layout.MainArea; area.auxiliary.AddContent("page0"); var d = area.AddArea(LayoutArea.Dock.Down, 0.3f); var context = d.auxiliary.AddContent("page1"); d.model.GetComponent <ImageElement>().color = Color.red; var one = d.AddArea(LayoutArea.Dock.Right, 0.4f); context = one.auxiliary.AddContent("page2"); context.LoadPopWindow <GridTestWindow>(); d.auxiliary.Refresh(); one.model.GetComponent <ImageElement>().color = Color.green; var top = area.AddArea(LayoutArea.Dock.Top, 0.2f); top.auxiliary.AddContent("page3"); top.model.GetComponent <ImageElement>().color = Color.yellow; var l = top.AddArea(LayoutArea.Dock.Left, 0.4f); l.model.GetComponent <ImageElement>().color = Color.blue; l.auxiliary.headDock = LayoutAuxiliary.HeadDock.Down; context = l.auxiliary.AddContent("page5"); context.LoadPopWindow <GridTestWindow2>(); l.auxiliary.Refresh(); }
public T LoadUI <T>(string asset, string name) where T : class, new() { model = ModelManagerUI.CloneModel(asset, name); T t = new T(); ModelManagerUI.LoadToGame(model, t); return(t); }
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"); }
public override void Initial(ModelElement parent, object dat = null) { model = ModelManagerUI.CloneModel("baseUI", "scrollex"); base.Initial(parent, dat); view = model.ComponentReflection <View>(); 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 <TitleItem, ScrollYExtand.DataTemplate>(TitleUpdate); view.scroll.SetItemUpdate <SubItem, string>(ItemUpdate); 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 <DrawPage>(); }; view.Next.Click = (o, e) => { LoadPage <ChatBoxPage>(); }; }
public override void Initial(ModelElement parent, object dat = null) { model = ModelManagerUI.CloneModel("baseUI", "gif"); base.Initial(parent, dat); view = model.ComponentReflection <View>(); ThreadMission.InvokeToMain(LoadGif, null); view.Last.Click = (o, e) => { LoadPage <AniTestPage>(); }; view.Next.Click = (o, e) => { LoadPage <TestPage>(); }; }
public override void Initial(ModelElement parent, UIBase ui, object obj = null) { model = ModelManagerUI.CloneModel("baseUI", "Menu"); base.Initial(parent, ui, obj); view = model.ComponentReflection <View>(); view.Menu.Click = (o, e) => { UIMenu.Instance.HideMenu(); Context.Cmd("menu", e); }; }
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>(); }; }
public override void Initial(ModelElement parent, object dat = null) { model = ModelManagerUI.CloneModel("baseUI", "anitest"); base.Initial(parent, dat); view = model.ComponentReflection <View>(); view.rocker.Rocking = Rocking; view.rocker.Radius = 100; view.render.LoadAsync <RolePage>(null); view.Last.Click = (o, e) => { LoadPage <ShareImagePage>(); }; view.Next.Click = (o, e) => { LoadPage <ShowGifPage>(); }; }
public override void Initial(ModelElement parent, object dat = null) { model = ModelManagerUI.CloneModel("baseUI", "shareimg"); base.Initial(parent, dat); view = model.ComponentReflection <View>(); view.head.Click = (o, e) => { Debug.Log("head click"); }; view.body.Click = (o, e) => { Debug.Log("body click"); }; view.weapon.Click = (o, e) => { Debug.Log("weapon click"); }; view.Last.Click = (o, e) => { LoadPage <ChatBoxPage>(); }; view.Next.Click = (o, e) => { LoadPage <AniTestPage>(); }; }
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>(); }; }
public override void Initial(ModelElement parent, UIPage ui, object obj = null) { model = ModelManagerUI.CloneModel("baseUI", "gridscroll"); base.Initial(parent, ui, obj); view = model.ComponentReflection <View>(); List <int> testData = new List <int>(); for (int i = 0; i < 44; i++) { testData.Add(i); } view.Scroll.BindingData = testData; view.Scroll.SetItemUpdate <Item, int>((o, e, i) => { o.Text.text = i.ToString(); }); view.Scroll.Refresh(); }
public override void LoadTestPage() { Application.targetFrameRate = 60; #if UNITY_IPHONE || UNITY_ANDROID //Scale.DpiScale = true; #endif //UIPage.LoadPage<DrawPage>(); //UIPage.LoadPage<LayoutTestPage>(); //UIPage.LoadPage<TestPage>(); win = new WinForm("tool"); win.SetCanvas(canvas.transform as RectTransform); win.BindingCamera(camera, canvas); var page = win.AddNode("page"); var model = ModelManagerUI.CloneModel("baseUI", "testpage"); view = new View(); ModelManagerUI.LoadToGame(model, view); model.SetParent(page); view.but.Click = (o, e) => { Debug.Log("click is ok"); }; }
public override void Initial(ModelElement parent, object dat = null) { model = ModelManagerUI.CloneModel("baseUI", "drawing"); base.Initial(parent, dat); view = model.ComponentReflection <View>(); 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; }; }
public override void Initial(ModelElement parent, HotFix.UIPage ui, object obj = null) { model = ModelManagerUI.CloneModel("baseUI", "gridscroll"); base.Initial(parent, ui, obj); view = model.ComponentReflection <View>(); List <int> testData = new List <int>(); for (int i = 0; i < 33; i++) { testData.Add(i); } view.Scroll.BindingData = testData; view.Scroll.SetItemUpdate <Item, int>((o, e, i) => { o.Text.text = i.ToString(); }); view.Scroll.Refresh(); view.Scroll.eventCall.Click = (o, e) => { if (e.IsRightButtonUp) { HotFix.UIMenu.Instance.ShowMenu <TestMenu>(this, e.CanPosition); } }; }