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/4-PersonalCenter/PirDevice/View/Buttons.cs | 100 ++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 88 insertions(+), 12 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs index 633bf36..139d2a6 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs @@ -62,6 +62,83 @@ /// <summary> /// 鍔ㄦ�佸姞杞芥寜閽垪琛� /// </summary> + /// <param name="vv">鐖舵帶浠�</param> + /// <param name="list">鏁版嵁鍒楄〃</param> + /// <param name="action">鍥炶皟</param> + /// <param name="if_bool">琛ㄧず鏄惁鏄剧ず鍒犻櫎鍥炬爣</param> + public void AddButton2(VerticalScrolViewLayout vv, List<Entity.AttributesStatus> list, Action<Entity.AttributesStatus> action, bool if_bool) + { + //瀹氫箟涓�涓彉閲忚褰曡鏁� + int sum = 0; + if (list.Count % 3 == 0) + { + sum = list.Count / 3; + } + else + { + sum = list.Count / 3 + 1; + } + //璁$畻鍔犺浇鍑烘潵鐨勬暟鎹渶瑕佺殑楂樺害 + int h = 16 + sum * (16 + 44) + 104 + 76; + int line = 0; + //鎸夐挳鐨勭埗鎺т欢 + var FLayout = new FrameLayout + { + Height = Application.GetRealWidth(h), + }; + vv.AddChidren(FLayout); + for (int i = 1, j = 0; i <= list.Count; i++, j++) + { + var nameObj = list[i - 1]; + //鎸夐挳 + var buttonNameBtn = new Button + { + + Y = Application.GetRealHeight(16 + line * (16 + 44)), + X = Application.GetRealWidth(16 + (16 + 104) * j), + Width = Application.GetRealWidth(104), + Height = Application.GetRealHeight(44), + Text = nameObj.value, + TextSize = TextSize.text16, + TextColor = CSS.CSS_Color.textColor, + TextAlignment = TextAlignment.Center, + Radius = (uint)Application.GetRealHeight(18), + BorderWidth = 1, + BorderColor = CSS.CSS_Color.textCancelColor, + }; + FLayout.AddChidren(buttonNameBtn); + //鍒犻櫎鍥炬爣 + var delIconBtn = new Button + { + UnSelectedImagePath = "PirIcon/delbuton.png", + Y = Application.GetRealHeight(12 + line * (16 + 44)), + X = Application.GetRealWidth((16 + 92) + (104 + 16) * j), + Width = Application.GetRealWidth(16), + Height = Application.GetRealWidth(16), + Tag = nameObj, + }; + if (if_bool) + { + FLayout.AddChidren(delIconBtn); + } + //鍒犻櫎鍥炬爣鐨勭偣鍑讳簨浠� + delIconBtn.MouseUpEventHandler += (sender, e) => + { + var obj = delIconBtn.Tag as Entity.AttributesStatus; + action(obj); + }; + if (i % 3 == 0) + { + //婊′竴琛岄噸缃甹=0鍊�; + j = -1; + line += 1; + } + + } + } + /// <summary> + /// 鍔ㄦ�佸姞杞芥寜閽垪琛� + /// </summary> /// <param name="FLayout">鐖舵帶浠�</param> /// <param name="action">鍥炶皟</param> /// <param name="sum">澶氬皯涓狥rameLayout鎺т欢</param> @@ -188,14 +265,14 @@ break; case 5: { - iconPath = "PirIcon/dvd.png"; - deviceNameIndex = StringId.dvd; + iconPath = "PirIcon/projector.png"; + deviceNameIndex = StringId.touyingyi; } break; case 6: { - iconPath = "PirIcon/projector.png"; - deviceNameIndex = StringId.touyingyi; + iconPath = "PirIcon/dvd.png"; + deviceNameIndex = StringId.dvd; } break; case 7: @@ -233,29 +310,28 @@ case 3: { //椋庢墖 - // type = "fan-" + SPK.ElectricFan; + type = "fan-" + SPK.FanIr; } break; case 4: { //鏈洪《鐩� - // type = "set_top_box-" + SPK.ElectricTV; + type = "set_top_box-" + SPK.StbIr; } break; case 5: { - //褰辩鏈� - // type = "dvd-" + SPK.ElectricTV; + //鎶曞奖浠� + type = "projector-" + SPK.PjtIr; } break; case 6: { - //鎶曞奖浠� - // type = "projector-" + SPK.ElectricTV; + //褰辩鏈� + type = "dvd-" + SPK.DvDIr; + } break; - - } return type; } -- Gitblit v1.8.0