From f759dc1e6f49c53733eafda82207c85af18f9931 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 28 五月 2020 15:46:54 +0800
Subject: [PATCH] 2020-05-28-1

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs |   72 +++++++++++++++++++++++++-----------
 1 files changed, 50 insertions(+), 22 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
index 6427e96..160b6c3 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs
@@ -17,7 +17,7 @@
         private bool m_CanClick = true;
         /// <summary>
         /// 璁剧疆鑳藉惁瑙︾偣鍑讳簨浠�
-        /// </summary>
+        /// </summary>
         public bool CanClick
         {
             get { return m_CanClick; }
@@ -58,6 +58,23 @@
 
         #endregion
 
+        #region 鈻� 閲嶅啓褰摜鐨勫睘鎬____________________
+
+        /// <summary>
+        /// 閲嶅啓Text灞炴��
+        /// </summary>
+        public new string Text
+        {
+            //鍏堣繖涔堝紕鍏堝惂
+            get { return base.Text == null ? string.Empty : base.Text; }
+            set
+            {
+                base.Text = value == null ? string.Empty : value;
+            }
+        }
+
+        #endregion
+
         #region 鈻� 鍒濆鍖朹____________________________
 
         /// <summary>
@@ -82,8 +99,8 @@
         /// <summary>
         /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�)
         /// </summary>
-        /// <param name="i_Width">瀹藉害</param>
-        /// <param name="i_Height">楂樺害</param>
+        /// <param name="i_Width">瀹藉害</param>
+        /// <param name="i_Height">楂樺害</param>
         /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
         public void InitSize(int i_Width, int i_Height, bool real = true)
         {
@@ -91,50 +108,50 @@
             {
                 i_Width = Application.GetRealWidth(i_Width);
                 i_Height = Application.GetRealHeight(i_Height);
-            }
-            this.Height = i_Height;
+            }
+            this.Height = i_Height;
             this.Width = i_Width;
         }
 
         /// <summary>
         /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�)
         /// </summary>
-        /// <param name="i_Width">瀹藉害</param>
+        /// <param name="i_Width">瀹藉害</param>
         /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
         public void InitSize(int i_Width, bool real = false)
         {
             if (real == true)
             {
                 i_Width = Application.GetRealWidth(i_Width);
-            }
-
-            this.Height = ControlCommonResourse.NormalControlHeight;
+            }
+
+            this.Height = ControlCommonResourse.NormalControlHeight;
             this.Width = i_Width;
         }
 
         /// <summary>
         /// 鍒濆鍖栧浘鏍囨帶浠跺ぇ灏�(浠ュ钩鍧囧�艰繘琛岀湡瀹炴暟鍊艰绠�)
         /// </summary>
-        /// <param name="i_Width">瀹藉害</param>
-        /// <param name="i_Height">楂樺害</param>
+        /// <param name="i_Width">瀹藉害</param>
+        /// <param name="i_Height">楂樺害</param>
         /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
         public void InitIconSize(int i_Width, int i_Height, bool real = true)
         {
             if (real == true)
             {
-                i_Width = Application.GetMinRealAverage(i_Width);
-                i_Height = Application.GetMinRealAverage(i_Height);
-            }
-
-            this.Height = i_Height;
+                i_Width = this.GetPictrueRealSize(i_Width);
+                i_Height = this.GetPictrueRealSize(i_Height);
+            }
+
+            this.Height = i_Height;
             this.Width = i_Width;
         }
 
         /// <summary>
         /// 鍒濆鍖栧浘鐗囨帶浠跺ぇ灏�
         /// </summary>
-        /// <param name="i_Width">瀹藉害</param>
-        /// <param name="i_Height">楂樺害</param>
+        /// <param name="i_Width">瀹藉害</param>
+        /// <param name="i_Height">楂樺害</param>
         /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param>
         public void InitPictrueSize(int i_Width, int i_Height, bool real = true)
         {
@@ -142,9 +159,9 @@
             {
                 i_Width = HdlControlLogic.Current.GetPictrueRealSize(i_Width);
                 i_Height = HdlControlLogic.Current.GetPictrueRealSize(i_Height);
-            }
-
-            this.Height = i_Height;
+            }
+
+            this.Height = i_Height;
             this.Width = i_Width;
         }
 
@@ -164,7 +181,8 @@
                 this.MouseUpEventHandler -= ButtonBase_MouseUpEventHandler;
                 return;
             }
-            if (CanClick == true)
+            //2020.05.14杩藉姞IsFormAdding:鐣岄潰杩樺湪鍔犺浇涓�,涓嶈兘鍐嶇偣鍑�
+            if (CanClick == true && ControlCommonResourse.IsFormAdding == false)
             {
                 //Log鍑哄姏
                 this.WriteLog(0);
@@ -319,6 +337,16 @@
 #endif
         }
 
+        /// <summary>
+        /// 璁$畻鍥剧墖鐨勭湡瀹為珮瀹藉害
+        /// </summary>
+        /// <param name="i_size"></param>
+        /// <returns></returns>
+        public int GetPictrueRealSize(int i_size)
+        {
+            return HdlControlLogic.Current.GetPictrueRealSize(i_size);
+        }
+
         #endregion
 
         #region 鈻� Log鍑哄姏____________________________

--
Gitblit v1.8.0