From 6b7a07bcbe147be7ed64994c40bcc5b0a2042aae Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 05 七月 2021 11:23:35 +0800
Subject: [PATCH] 代码合并-温居城
---
HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs | 89 ++++++++++++++++++++++++++++----------------
1 files changed, 56 insertions(+), 33 deletions(-)
diff --git a/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs b/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
old mode 100755
new mode 100644
index 60c8d0a..0b0c63a
--- a/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
+++ b/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
@@ -62,7 +62,7 @@
#region 鈻� 閲嶅啓褰摜鐨勫睘鎬____________________
/// <summary>
- /// 閲嶅啓Text灞炴��
+ /// 閲嶅啓Text灞炴��(鏂囨湰涓湁{0}鐨勮瘽,浼氳嚜鍔ㄥ叏閮ㄦ浛鎹负鎹㈣绗�)
/// </summary>
public new string Text
{
@@ -70,7 +70,7 @@
get { return base.Text == null ? string.Empty : base.Text; }
set
{
- base.Text = value == null ? string.Empty : value;
+ base.Text = value == null ? string.Empty : value.Replace("{0}", "\r\n");
}
}
@@ -122,6 +122,38 @@
}
}
+ /// <summary>
+ /// 鑳屾櫙鑹�(閲嶅啓搴曞眰灞炴��)
+ /// </summary>
+ public new uint BackgroundColor
+ {
+ get { return base.BackgroundColor; }
+ set
+ {
+ //鍙湁涓嶄竴鏍�,鎵嶅彉鏇�
+ if (base.BackgroundColor != value)
+ {
+ base.BackgroundColor = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// 瀛椾綋棰滆壊(閲嶅啓搴曞眰灞炴��)
+ /// </summary>
+ public new uint TextColor
+ {
+ get { return base.TextColor; }
+ set
+ {
+ //鍙湁涓嶄竴鏍�,鎵嶅彉鏇�
+ if (base.TextColor != value)
+ {
+ base.TextColor = value;
+ }
+ }
+ }
+
#endregion
#region 鈻� 鍒濆鍖朹____________________________
@@ -163,20 +195,6 @@
i_Height = Application.GetRealHeight(i_Height);
}
this.Height = i_Height;
- this.Width = i_Width;
- }
-
- /// <summary>
- /// 鍒濆鍖栨帶浠跺ぇ灏�(涓嶄互骞冲潎鍊艰繘琛岀湡瀹炴暟鍊艰绠�)
- /// </summary>
- /// <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.Width = i_Width;
}
@@ -352,25 +370,9 @@
/// <returns></returns>
public int GetRealWidthByText()
{
- if (string.IsNullOrEmpty(this.Text) == true) { return Application.GetRealWidth(25); }
+ if (string.IsNullOrEmpty(this.Text) == true) { return Application.GetRealWidth(4); }
return base.GetTextWidth();
- }
-
- /// <summary>
- /// 鏍规嵁鏂囨湰,璁$畻瀹冮渶瑕佺殑鎬昏鏁�
- /// </summary>
- /// <returns></returns>
- public int GetRealRowCountByText()
- {
- //鍏堣幏鍙栧畠鐨勭湡瀹炲搴�
- int realWidth = this.GetRealWidthByText();
- int row = realWidth / this.Width;
- if (realWidth % this.Width > 0)
- {
- row++;
- }
- return row;
}
/// <summary>
@@ -383,6 +385,27 @@
return Application.GetRealWidth(i_size);
}
+ /// <summary>
+ /// 鏍规嵁鏂囨湰,璁$畻瀹冮渶瑕佺殑鎬昏鏁�
+ /// </summary>
+ /// <param name="i_width">褰撳�间负-1鏃�,闇�瑕佺埗鎺т欢,鐪熷疄鍊�</param>
+ /// <returns></returns>
+ public int GetRealRowCountByText(int i_width = -1)
+ {
+ if (i_width == -1)
+ {
+ i_width = this.Width;
+ }
+ //鍏堣幏鍙栧畠鐨勭湡瀹炲搴�
+ int realWidth = this.GetRealWidthByText();
+ int row = realWidth / i_width;
+ if (realWidth % i_width > 0)
+ {
+ row++;
+ }
+ return row;
+ }
+
#endregion
}
}
--
Gitblit v1.8.0