tzy
2021-05-14 0fa1534827bd21d763216550d11006fc1441c6cb
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,9 +370,19 @@
        /// <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>
        /// <param name="i_size"></param>
        /// <returns></returns>
        public int GetPictrueRealSize(int i_size)
        {
            return Application.GetRealWidth(i_size);
        }
        /// <summary>
@@ -376,16 +404,6 @@
                row++;
            }
            return row;
        }
        /// <summary>
        /// 计算图片的真实高宽度
        /// </summary>
        /// <param name="i_size"></param>
        /// <returns></returns>
        public int GetPictrueRealSize(int i_size)
        {
            return Application.GetRealWidth(i_size);
        }
        #endregion