From 3bedb23993745f97e5870eca160c9f00c053c44c Mon Sep 17 00:00:00 2001
From: JLChen <jlchen@JLChendeMac.local>
Date: 星期五, 14 五月 2021 18:55:30 +0800
Subject: [PATCH] 实现门锁的UI

---
 HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs |   66 +++++++++++++++++++++++++++++++--
 1 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs b/HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs
index 31bdbe3..381bc86 100644
--- a/HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs
+++ b/HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs
@@ -124,7 +124,35 @@
             btnTilte.TextSize = UI.CSS.CSS_FontSize.HeadlineFontSize;
             btnTilte.TextColor = UI.CSS.CSS_Color.FirstLevelTitleColor;
             topFrameLayout.AddChidren(btnTilte);
-            topFrameLayout.AddTag("txtTitle", btnTilte);
+            topFrameLayout.AddTag("txtTitle", btnTilte);
+#if DEBUG
+            btnTilte.MouseLongEventHandler += (sender, e) =>
+            {
+
+                var form = new BottomMenuSelectControl(3);
+                form.AddMenu("鍒囨崲涓轰腑鏂�", () =>
+                {
+                    Language.CurrentLanguage = "Chinese";
+                    //娓呴櫎鍏ㄩ儴鎺т欢
+                    this.ClearBodyFrame();
+                    //鎵цShowForm()鏂规硶瀹炵幇閲嶆柊鍔犺浇
+                    this.LoadShowFormMethod(this.m_parameter);
+                });
+                form.AddMenu("鍒囨崲涓鸿嫳鏂�", () =>
+                {
+                    Language.CurrentLanguage = "English";
+                    //娓呴櫎鍏ㄩ儴鎺т欢
+                    this.ClearBodyFrame();
+                    //鎵цShowForm()鏂规硶瀹炵幇閲嶆柊鍔犺浇
+                    this.LoadShowFormMethod(this.m_parameter);
+                });
+                form.AddMenu("鏌ョ湅鏈湴鏂囦欢", () =>
+                {
+                    var form2 = new HideOptionDirectoryListForm();
+                    form2.AddForm();
+                });
+            };
+#endif
         }
 
         #endregion
@@ -290,7 +318,7 @@
         #region 鈻� 娣诲姞鍒楄〃娑堟伅鏄剧ず鎺т欢_______________
 
         /// <summary>
-        /// 娣诲姞鍒楄〃娑堟伅鏄剧ず鎺т欢,杩斿洖鐨勬槸鏈�鍚庝竴涓帶浠剁殑搴曢儴鍧愭爣
+        /// 娣诲姞鍒楄〃娑堟伅鏄剧ず鎺т欢,杩斿洖鐨勬槸鏈�鍚庝竴涓帶浠剁殑搴曢儴鍧愭爣(娌$湅鎳傝繖涓嚱鏁板墠,璇峰嬁浣跨敤)
         /// </summary>
         /// <param name="frameTable">妗屽竷瀹瑰櫒鎺т欢</param>
         /// <param name="i_msg">鏄剧ず鐨勬秷鎭�(鎹㈣璇蜂娇鐢ㄣ�恵0}銆戣繘琛屽垎鍓�)</param>
@@ -303,12 +331,37 @@
         /// <para>娉細闄や簡鏂板缓杩欎釜鍑芥暟鐨勫紑鍙戣�呬互澶栵紝閮戒笉寤鸿鎶婅繖涓�间笉璁剧疆涓簍rue</para>
         /// <para>璇存槑锛氫互鏈�闀跨殑鎺т欢鐨刋杞翠负鍩哄噯,鎵�鏈夋帶浠剁殑X杞撮兘鍙樻垚涓�鑷�</para>
         /// </param>
+        /// <param name="i_width">鏂囨湰瀹藉害,鐪熷疄鍊�,褰撲负-1鏃�,鍐呴儴鑷姩璁$畻</param>
         /// <returns></returns>
         public int AddListMsgControls(FrameLayout frameTable, string i_msg, int i_fontSize, uint i_fontColor, int i_height,
-            int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false)
+            int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false, int i_width = -1)
         {
             var listMsg = i_msg.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
-            int defultWidth = this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2;
+            int defultWidth = 0;
+            if (this.bodyFrameLayout != null)
+            {
+                defultWidth = i_width == -1 ? this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2 : i_width;
+            }
+            else
+            {
+                defultWidth = i_width == -1 ? frameTable.Width - HdlControlResourse.XXLeft * 2 : i_width;
+            }
+
+            //濡傛灉鍙槸涓�琛岀殑鏃跺��
+            bool isMoreLine = false;
+            if (listMsg.Length == 1)
+            {
+                var btnTemp = new ButtonCtrBase();
+                btnTemp.TextSize = i_fontSize;
+                btnTemp.Text = i_msg;
+                int rowCount = btnTemp.GetRealRowCountByText(defultWidth);
+                //瀹冪殑楂樺害鐢辫鏁板喅瀹�(鐞嗚涓婂簲璇ラ兘鏄�1琛�,杩欓噷鍋氱壒娈婂鐞嗚�屽凡)
+                if (rowCount > 1)
+                {
+                    i_height = i_height * rowCount;
+                    isMoreLine = true;
+                }
+            }
 
             var listContr = new List<NormalViewControl>();
             int minXX = 10086;//鎺т欢闆嗗悎鏈�灏忕殑X杞�
@@ -322,6 +375,11 @@
                 btnMsg.TextColor = i_fontColor;
                 btnMsg.TextSize = i_fontSize;
                 btnMsg.Text = strMsg;
+                if (isMoreLine == true)
+                {
+                    //鍙互鎹㈣
+                    btnMsg.IsMoreLines = isMoreLine;
+                }
 
                 //鐗规畩澶勭悊
                 if (special == true && alignment == TextAlignment.Center)

--
Gitblit v1.8.0