From db45c85a6ddebc5018b32a9d9dc04f839db3fa76 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期二, 28 九月 2021 15:59:34 +0800 Subject: [PATCH] 组合调光 --- HDL_ON/UI/UI2/2-Classification/FunctionPage.cs | 139 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 138 insertions(+), 1 deletions(-) diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs index 74fe7e8..9430eb5 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs @@ -42,7 +42,19 @@ { Action action = () => { - var skipView = new AddLightScene(new List<Function>(), new Scene() { sceneType = SceneType.LightScene }); + + Action<Scene > refreshAction = (outScene) => { + if (outScene != null) + { + functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); + + var sceneRow = new SceneControlZone(outScene); + functionListView.AddChidren(sceneRow); + sceneRow.LoadView(); + } + }; + + var skipView = new AddLightScene(new List<Function>(), new Scene() { sceneType = SceneType.LightScene }, refreshAction); MainPage.BasePageView.AddChidren(skipView); skipView.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; @@ -97,6 +109,17 @@ if (titleId == StringId.Lights) { functionList.AddRange(FunctionList.List.GetLightList()); + var lightScene = FunctionList.List.scenes.FindAll((obj) => obj.sceneType == SceneType.LightScene); + + foreach (var scene in lightScene) + { + functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) }); + + var sceneRow = new SceneControlZone(scene); + functionListView.AddChidren(sceneRow); + sceneRow.LoadView(); + } + } else if (titleId == StringId.AC) { @@ -182,6 +205,120 @@ } + ///// <summary> + ///// 鍔犺浇鍔熻兘绫诲瀷鎺у埗鍗$墖 + ///// </summary> + //public void LoadSceneRow(Scene scene) + //{ + // var bodyDiv = new FrameLayout() + // { + // Gravity = Gravity.CenterHorizontal, + // Width = Application.GetRealWidth(343), + // Height = Application.GetRealHeight(116), + // Radius = (uint)Application.GetMinRealAverage(12), + // BorderColor = 0x00FFFFFF, + // BorderWidth = 1, + // BackgroundColor = CSS_Color.MainBackgroundColor, + // Tag = "Scene-" + scene.sid + // }; + // functionListView.AddChidren(bodyDiv); + + // var btnIcon = new Button() + // { + // X = Application.GetRealWidth(10), + // Y = Application.GetRealHeight(15), + // Width = Application.GetRealWidth(32), + // Height = Application.GetRealWidth(32), + // }; + // bodyDiv.AddChidren(btnIcon); + + // var btnName = new Button() + // { + // X = Application.GetRealWidth(8 + 10 + 32), + // Y = Application.GetRealHeight(10), + // Width = Application.GetRealWidth(200), + // Height = Application.GetRealHeight(24), + // Text = scene.name, + // TextAlignment = TextAlignment.CenterLeft, + // TextColor = CSS_Color.FirstLevelTitleColor, + // TextSize = CSS_FontSize.TextFontSize, + // }; + // bodyDiv.AddChidren(btnName); + + // var btnFromFloor = new Button() + // { + // X = Application.GetRealWidth(8 + 10 + 32), + // Y = Application.GetRealHeight(10 + 24), + // Width = Application.GetRealWidth(200), + // Height = Application.GetRealHeight(18), + // Text = scene.GetRoomListName(), + // TextAlignment = TextAlignment.CenterLeft, + // TextColor = CSS_Color.PromptingColor1, + // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + // }; + // bodyDiv.AddChidren(btnFromFloor); + + // var btnCollectionIcon = new Button() + // { + // X = Application.GetRealWidth(299), + // Y = Application.GetRealHeight(10), + // Width = Application.GetMinRealAverage(40), + // Height = Application.GetMinRealAverage(40), + // SelectedImagePath = "Collection/CollectionIcon.png", + // UnSelectedImagePath = "Collection/CollectionGrayIcon.png", + // IsSelected = scene.collect + // }; + // bodyDiv.AddChidren(btnCollectionIcon); + + // btnIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png"; + // if (scene.sceneType == SceneType.MovieScene) + // { + // var movieIcon = new Button() + // { + // X = Application.GetRealWidth(52), + // Y = Application.GetRealHeight(14), + // Width = Application.GetRealWidth(16), + // Height = Application.GetRealWidth(16), + // UnSelectedImagePath = "FunctionIcon/Scene/MovieMark.png", + // }; + // bodyDiv.AddChidren(movieIcon); + // btnName.X = Application.GetRealWidth(52 + 16); + // } + // //鍔犺浇鍦烘櫙鎺у埗浜嬩欢 + // LoadEvent_ControlScene(btnName, btnFromFloor, bodyDiv, scene); + + // LoadEvent_FunctionCollection(btnCollectionIcon, scene); + //} + + + ///// <summary> + ///// 鍔犺浇鍔熻兘鏀惰棌鎸夐挳浜嬩欢 + ///// </summary> + //void LoadEvent_FunctionCollection(Button btnCollectionIcon, Scene scene) + //{ + // btnCollectionIcon.MouseUpEventHandler += (sender, e) => + // { + // btnCollectionIcon.IsSelected = scene.collect = !btnCollectionIcon.IsSelected; + // scene.CollectScene(); + // }; + //} + ///// <summary> + ///// 鍔犺浇鍦烘櫙鎺у埗浜嬩欢 + ///// </summary> + //void LoadEvent_ControlScene(Button btnName, Button btnFromFloor, FrameLayout bodyDiv, Scene scene) + //{ + // EventHandler<MouseEventArgs> upEvent = (sender, e) => { + // DriverLayer.Control.Ins.ControlScene(scene); + // string msg = scene.name + Language.StringByID(StringId.AlreadyOpened); + // new PublicAssmebly().TipMsgAutoClose(msg, false); + // }; + // btnName.MouseUpEventHandler = upEvent; + // btnFromFloor.MouseUpEventHandler = upEvent; + // bodyDiv.MouseUpEventHandler = upEvent; + //} + + + /// <summary> /// 浣忓畢鍒楄〃鐐瑰嚮浜嬩欢 /// </summary> -- Gitblit v1.8.0