From eda3fb873e59544ff36301b51e05aef64f87b0f9 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 27 八月 2021 13:21:21 +0800 Subject: [PATCH] Merge branch 'newBranch1' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into newBranch1 --- HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 102 insertions(+), 15 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs index ac37f82..da2a973 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs @@ -61,8 +61,8 @@ /// </summary> public Button btn_subtract = new Button { - Width = Application.GetMinRealAverage(24), - Height = Application.GetMinRealAverage(24), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), X = Application.GetRealWidth(26), Y = Application.GetRealHeight(118), UnSelectedImagePath = "LogicIcon/-.png", @@ -72,22 +72,22 @@ /// </summary> public Button btn_subtract_click = new Button { - Width = Application.GetMinRealAverage(24+20), + Width = Application.GetMinRealAverage(24 + 20), Height = Application.GetMinRealAverage(24), - X = Application.GetRealWidth(26-20), + X = Application.GetRealWidth(26 - 20), Y = Application.GetRealHeight(118), }; public DiyImageSeekBar seekBarVol = new DiyImageSeekBar { Y = Application.GetRealHeight(103),//杩涘害鏉$埗鎺т欢Y鍧愭爣 - X = Application.GetRealWidth(62-10),//杩涘害鏉鍧愭爣 - SeekBarPadding=Application.GetRealHeight(10),//杩涘害鏉″疄闄呴暱搴�=244-12*2(鍐呰竟璺�); + X = Application.GetRealWidth(62 - 10),//杩涘害鏉鍧愭爣 + SeekBarPadding = Application.GetRealHeight(10),//杩涘害鏉″疄闄呴暱搴�=244-10*2(鍐呰竟璺�); Width = Application.GetRealWidth(240),//杩涘害鏉$殑闀垮害 Height = Application.GetRealHeight(54),//杩涘害鏉$埗鎺т欢楂樺害 IsProgressTextShow = true,//鏄剧ず鐧惧垎姣� IsClickable = true,//杩涘害鏉℃槸鍚︽粦鍔� - ProgressBarColor =CSS.CSS_Color.textConfirmColor,//閫変腑杩涘害鏉¢鑹� + ProgressBarColor = CSS.CSS_Color.textConfirmColor,//閫変腑杩涘害鏉¢鑹� ThumbImagePath = "LogicIcon/point.png",//杩涘害鏉℃寜閽浘鏍� ThumbImageHeight = Application.GetRealHeight(54),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級 ProgressTextColor = CSS.CSS_Color.textColor, @@ -99,8 +99,8 @@ /// </summary> public Button btn_add = new Button { - Width = Application.GetMinRealAverage(24), - Height = Application.GetMinRealAverage(24), + Width = Application.GetRealWidth(24), + Height = Application.GetRealWidth(24), X = Application.GetRealWidth(294), Y = Application.GetRealHeight(118), UnSelectedImagePath = "LogicIcon/+.png", @@ -111,17 +111,28 @@ /// </summary> public Button btn_add_click = new Button { - Width = Application.GetMinRealAverage(24+20), + Width = Application.GetMinRealAverage(24 + 20), Height = Application.GetMinRealAverage(24), X = Application.GetRealWidth(294), Y = Application.GetRealHeight(118), }; + + + /// <summary> /// View鐨勬柟娉� /// </summary> - /// <param name="fLayout"></param> - public void FLayoutView(FrameLayout fLayout) + /// <param name="frame">鐖舵帶浠�</param> + /// <param name="titleName">鏍囬鍚嶇О</param> + /// <param name="stateValue">涔嬪墠鐘舵�佸��</param> + /// <param name="action">杩斿洖鍥炶皟</param> + public void FLayoutView(FrameLayout frame, string titleName,string stateValue, Action<string> action) { + FrameLayout fLayout = new FrameLayout + { + BackgroundColor = CSS.CSS_Color.viewTrans60lucence, + }; + frame.AddChidren(fLayout); fLayout.AddChidren(frameLayout); frameLayout.AddChidren(btnTitle); frameLayout.AddChidren(btnCancel); @@ -131,15 +142,91 @@ frameLayout.AddChidren(seekBarVol); frameLayout.AddChidren(btn_add); frameLayout.AddChidren(btn_add_click); + btnTitle.Text = titleName; + //绗竴涓彉鍖栬褰曢�変腑鍊� + int brightnesValue = 0; + if (stateValue != "") + { + try + { + //杩涙潵鐨勭姸鎬� + brightnesValue = int.Parse(stateValue.Replace("%", "")); + seekBarVol.Progress = brightnesValue; + } + catch { } + } + //鈥旂偣鍑讳簨浠� + btn_subtract_click.MouseUpEventHandler += (sender2, e2) => + { + if (brightnesValue > 0) + { + brightnesValue -= 1; + seekBarVol.Progress = brightnesValue; + } + }; + //+鐐瑰嚮浜嬩欢 + btn_add_click.MouseUpEventHandler += (sende2, e2) => + { + if (brightnesValue < 100) + { + brightnesValue += 1; + seekBarVol.Progress = brightnesValue; - ////鐣岄潰鐐瑰嚮浜嬩欢 - fLayout.MouseUpEventHandler += (sender, e1) => + } + }; + //杩涘害鏉℃粦鍔ㄧ偣鍑讳簨浠� + EventHandler<int> progressclick = (sender2, e2) => + { + brightnesValue = seekBarVol.Progress; + }; + seekBarVol.OnProgressChangedEvent += progressclick; + seekBarVol.OnStopTrackingTouchEvent += progressclick; + //鍙栨秷鐐瑰嚮浜嬩欢 + btnCancel.MouseUpEventHandler += (sender, e1) => { //绉婚櫎fLayout鐣岄潰 fLayout.RemoveFromParent(); }; - //鍙栨秷鐐瑰嚮浜嬩欢 + //纭畾鐐瑰嚮浜嬩欢 + btnConfirm.MouseUpEventHandler += (sender, e1) => + { + //if (brightnesValue == 0) + //{ + // return; + //} + action(brightnesValue.ToString()); + //绉婚櫎fLayout鐣岄潰 + fLayout.RemoveFromParent(); + }; + } + + + + + ///// <summary> + ///// View鐨勬柟娉� + ///// </summary> + ///// <param name="fLayout"></param> + //public void FLayoutView(FrameLayout fLayout) + //{ + // fLayout.AddChidren(frameLayout); + // frameLayout.AddChidren(btnTitle); + // frameLayout.AddChidren(btnCancel); + // frameLayout.AddChidren(btnConfirm); + // frameLayout.AddChidren(btn_subtract); + // frameLayout.AddChidren(btn_subtract_click); + // frameLayout.AddChidren(seekBarVol); + // frameLayout.AddChidren(btn_add); + // frameLayout.AddChidren(btn_add_click); + // //鍙栨秷鐐瑰嚮浜嬩欢 + // btnCancel.MouseUpEventHandler += (sender, e1) => + // { + // //绉婚櫎fLayout鐣岄潰 + // fLayout.RemoveFromParent(); + // }; + + //} } } -- Gitblit v1.8.0