From 1cba5ec1959f9012c66f96254afb3206904ff671 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 25 三月 2021 13:27:01 +0800
Subject: [PATCH] 2021-3-25-1

---
 HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/View/Buttons.cs |   77 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 77 insertions(+), 0 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..6a79288 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>

--
Gitblit v1.8.0