From 63900e8f92ea0c781e57da006099fc034b3661c0 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期二, 31 十二月 2019 16:48:16 +0800 Subject: [PATCH] 2019-12-31-02 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs | 49 ++++++++++++++++++++++--------------------------- 1 files changed, 22 insertions(+), 27 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 4319b59..36c8452 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/ButtonBase.cs @@ -35,6 +35,14 @@ /// 鎺т欢鐨勭偣鍑讳簨浠�(姝や簨浠惰璁ゅ彲涓烘墽琛屾寜閽寜涓嬩簨浠讹紝鍙桟anClick灞炴�ф帶鍒�) /// </summary> public Action<Button, MouseEventArgs> ButtonClickEvent = null; + /// <summary> + /// 搴曢儴闃村奖鎺т欢1 + /// </summary> + private Button btnBottomShadowView1 = null; + /// <summary> + /// 搴曢儴闃村奖鎺т欢2 + /// </summary> + private Button btnBottomShadowView2 = null; #endregion @@ -133,13 +141,11 @@ } catch (Exception ex) { - //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け - var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); + //鍑虹幇鏈煡閿欒 + var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError)); alert.Show(); //Log鍑哄姏 - string msg = ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); - HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); } } } @@ -220,30 +226,19 @@ int byteLength = 0; for (int i = 0; i < i_text.Length; i++) { - int length = Encoding.UTF8.GetBytes(i_text[i].ToString()).Length; - if (length == 1) - { - //鑻辨枃 - byteLength += length; - continue; - } - //涓枃(鏆傛椂鐢ㄤ腑鏂囧搴�) - byteLength += Encoding.GetEncoding("gb2312").GetBytes(i_text[i].ToString()).Length; + byteLength += Encoding.UTF8.GetBytes(i_text[i].ToString()).Length; + //int length = Encoding.UTF8.GetBytes(i_text[i].ToString()).Length; + //if (length == 1) + //{ + // //鑻辨枃 + // byteLength += length; + // continue; + //} + ////涓枃(鏆傛椂鐢ㄤ腑鏂囧搴�) + //byteLength += Encoding.GetEncoding("gb2312").GetBytes(i_text[i].ToString()).Length; } int realWidth = byteLength * (int)textSize; - return Application.GetRealWidth(realWidth); - } - - /// <summary> - /// 娣诲姞搴曢儴闃村奖鐗规晥(纭繚鎷ユ湁鐖舵帶浠跺悗鎵嶈皟鐢�) - /// </summary> - public void AddBottomShadow() - { - var btnShadow = new PicViewControl(this.Width, Application.GetMinRealAverage(45), false); - btnShadow.X = this.X; - btnShadow.Y = this.Bottom - 1; - btnShadow.UnSelectedImagePath = "Item/BottomShadow.png"; - this.Parent.AddChidren(btnShadow); + return Application.GetRealWidth(realWidth + 20); } #endregion -- Gitblit v1.8.0