From d78515ac4ac8cf4a1785d9df18058d6724f12b79 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 14 一月 2021 19:34:59 +0800
Subject: [PATCH] 合并xm2021-01-13  wjc2021-02-06

---
 ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs |   63 +++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs
index 22423a0..5a685c9 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApDirection1Form.cs
@@ -33,25 +33,42 @@
 
             //鍥剧墖
             var framePic = new FrameLayout();
-            framePic.Width = this.GetPictrueRealSize(392);
-            framePic.Height = this.GetPictrueRealSize(259);
+            framePic.Width = this.GetPictrueRealSize(386);
+            framePic.Height = this.GetPictrueRealSize(255);
             framePic.Gravity = Gravity.CenterHorizontal;
-            framePic.Y = Application.GetRealHeight(426);
+            framePic.Y = Application.GetRealHeight(228);
             framePic.BackgroundImagePath = "Gateway/WirelessApDirection.png";
             bodyFrameLayout.AddChidren(framePic);
 
-            //璇峰厛闀挎寜HID/WCFG鎸夐敭澶ф5绉抺0}鐩村埌绯荤粺鎸囩ず鐏父浜畕0}缃戝叧杩涘叆AP妯″紡鐑偣
-            string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg1).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
-            int yy = framePic.Bottom + Application.GetRealHeight(291);
+            //缃戝叧涓婄數閰嶇綉
+            var btnTitle = new NormalViewControl(300, 60, true);
+            btnTitle.TextID = R.MyInternationalizationString.uGatewayPowerDistributionNetwork;
+            btnTitle.X = Application.GetRealWidth(75);
+            btnTitle.Y = framePic.Bottom + Application.GetRealHeight(213);
+            btnTitle.IsBold = true;
+            btnTitle.TextSize = 14;
+            bodyFrameLayout.AddChidren(btnTitle);
+
+            //1.涓婄數,绯荤粺鍚姩(绯荤粺鎸囩ず鐏疭YS 7绉掑悗浜捣,鎸佺画50绉掑父浜�)
+            //2.缃戝叧杩炴帴灞�鍩熺綉(SYS 3绉掑懆鏈熼棯鐑�,鐏厜鍋忔殫,鎸佺画20绉�)
+            //3.缃戝叧寤虹珛WI-FI鐑偣(SYS 5绉掑懆鏈熼棯鐑�,鐏厜鍙樹寒)
+            //4.缃戝叧寤虹珛鐑偣鎴愬姛
+            //5.鐐瑰嚮涓嬩竴姝�
+            string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddWirelessApGatewayMsg1).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
+            int YY = btnTitle.Bottom + Application.GetRealHeight(23);
             foreach (var msg in ArryMsg)
             {
-                var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
-                btnMsg.Text = msg;
-                btnMsg.Y = yy;
-                btnMsg.TextAlignment = TextAlignment.Center;
-                btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
-                bodyFrameLayout.AddChidren(btnMsg);
-                yy = btnMsg.Bottom;
+                var btnMsg1 = new NormalViewControl(942, 60, true);
+                btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor1;
+                btnMsg1.TextSize = 12;
+                btnMsg1.Text = msg;
+                btnMsg1.Y = YY;
+                btnMsg1.X = Application.GetRealWidth(75);
+                btnMsg1.IsMoreLines = true;
+                btnMsg1.Height = Application.GetRealHeight(60) * this.GetRowCountByTextLength(btnMsg1, 942);
+                bodyFrameLayout.AddChidren(btnMsg1);
+
+                YY = btnMsg1.Bottom;
             }
 
             //鏌ョ湅甯姪
@@ -73,6 +90,26 @@
             };
         }
 
+        /// <summary>
+        /// 鏍规嵁鏂囨湰闀垮害,鑾峰彇琛屾暟
+        /// </summary>
+        /// <param name="btnContr"></param>
+        /// <param name="i_width"></param>
+        /// <returns></returns>
+        private int GetRowCountByTextLength(NormalViewControl btnContr, int i_width)
+        {
+            int realWidth = btnContr.GetRealWidthByText();
+            int myWidth = Application.GetRealWidth(i_width);
+
+            int row = realWidth / myWidth;
+            int value = realWidth % myWidth;
+            if (value > 8)
+            {
+                row++;
+            }
+            return row;
+        }
+
         #endregion
     }
 }

--
Gitblit v1.8.0