tzy
2021-05-14 0fa1534827bd21d763216550d11006fc1441c6cb
HDL_ON/UI/UI0-Stan/Controls/BottomControls/BottomItemEditorControl.cs
@@ -7,7 +7,7 @@
namespace HDL_ON.Stan
{
    /// <summary>
    /// 底部项目编辑控件
    /// 底部项目编辑控件(不需要加入父控件,AddRowMenu添加菜单)
    /// </summary>
    public class BottomItemEditorControl : BottomDialogCommon
    {
@@ -18,6 +18,10 @@
        /// </summary>
        public Action<int> FinishEvent = null;
        /// <summary>
        /// 点击确认时,是否关闭界面(当设置为false时,只能手动关闭)
        /// </summary>
        public bool CloseByConfirm = true;
        /// <summary>
        /// 列表控件
        /// </summary>
        private VerticalListControl listView = null;
@@ -27,7 +31,7 @@
        #region ■ 初始化_____________________________
        /// <summary>
        /// 有标题的弹窗型菜单编辑控件
        /// 有标题的弹窗型菜单编辑控件(不需要加入父控件,AddRowMenu添加菜单)
        /// </summary>
        /// <param name="i_RowCount">菜单行数(不含标题)</param>
        /// <param name="i_title">标题</param>
@@ -53,17 +57,18 @@
            //取消
            base.btnCancel.ButtonClickEvent += (sender, e) =>
            {
                base.Close();
                this.FinishEvent?.Invoke(0);
                this.FinishEvent = null;
                this.Close();
            };
            //确认
            base.btnConfirm.ButtonClickEvent += (sender, e) =>
            {
                base.Close();
                this.FinishEvent?.Invoke(1);
                this.FinishEvent = null;
                if (this.CloseByConfirm == true)
                {
                    this.Close();
                }
            };
            //列表控件
@@ -82,8 +87,9 @@
        /// </summary>
        /// <param name="i_textView">左边显示的文字</param>
        /// <param name="i_textValue">右边显示的值(</param>
        /// <param name="clickEvent">单击菜单执行的事件(参数为右边显示值的那个控件)</param>
        public void AddRowMenu(string i_textView, string i_textValue, Action<NormalViewControl> clickEvent)
        /// <param name="clickEvent">单击菜单执行的事件(参数1:左边标题控件,参数2:右边显示值的那个控件)</param>
        /// <param name="addRightArrow">是否添加右箭头</param>
        public void AddRowMenu(string i_textView, string i_textValue, Action<NormalViewControl, NormalViewControl> clickEvent, bool addRightArrow = true)
        {
            //先初始化控件
            this.InitControl();
@@ -101,21 +107,24 @@
            //行
            var rowContr = new FrameRowControl();
            rowContr.LeftOffset = Application.GetRealWidth(20) - HdlControlResourse.XXLeft;
            rowContr.RightOffset = - rowContr.LeftOffset;
            rowContr.RightOffset = -rowContr.LeftOffset;
            rowContr.Width = this.listView.Width;
            rowContr.Height = this.RowHeight;
            this.listView.AddChidren(rowContr);
            //显示文本
            var btnView = rowContr.AddLeftCaption(i_textView, 150);
            var btnView = rowContr.AddLeftCaption(i_textView, 300);
            btnView.Width = btnView.GetRealWidthByText();
            btnView.TextColor = CSS_Color.FirstLevelTitleColor;
            //添加右箭头
            rowContr.AddRightArrow();
            if (addRightArrow == true)
            {
                rowContr.AddRightArrow();
            }
            //添加右边的文本
            var btnValue = rowContr.AddMostRightView(i_textValue, 150);
            var btnValue = rowContr.AddMostRightView(i_textValue, 200);
            rowContr.ButtonClickEvent += (sender, e) =>
            {
                clickEvent?.Invoke(btnValue);
                clickEvent?.Invoke(btnView, btnValue);
            };
        }