HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-11-18 16604a593202f2f87adf71abd57d036fe7da3b52
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs
@@ -214,6 +214,7 @@
        public MostRightIconControl AddMostRightEmptyIcon(int i_width, int i_height)
        {
            var btnContr = new MostRightIconControl(i_width, i_height);
            btnContr.UseClickStatu = false;
            this.AddChidren(btnContr, ChidrenBindMode.NotBind);
            btnContr.InitControl();
            //复合控件需要特殊处理
@@ -226,10 +227,28 @@
            this.rightIconSize = Application.GetMinRealAverage(i_width);
            if (chidrenYaxis != 0)
            {
                btnContr.Y += chidrenYaxis;
                btnContr.btnIcon.Y += chidrenYaxis;
            }
            return btnContr;
        }
        #endregion
        #region ■ 添加右边的开关图标_________________
        /// <summary>
        /// 添加右边的开关图标
        /// </summary>
        /// <returns></returns>
        public MostRightIconControl AddMostRightSwitchIcon()
        {
            var btnSwitch = this.AddMostRightEmptyIcon(104, 63);
            this.ChangedChidrenBindMode(btnSwitch, ChidrenBindMode.NotBind);
            btnSwitch.UnSelectedImagePath = "Item/Switch2.png";
            btnSwitch.SelectedImagePath = "Item/Switch2Selected.png";
            return btnSwitch;
        }
        #endregion
@@ -249,12 +268,7 @@
            {
                i_width = Application.GetRealWidth(i_width);
            }
            var btnContr = new NormalViewControl(i_width, false);
            btnContr.X = this.Width - ControlCommonResourse.XXLeft - i_width - rightIconSize + RightOffset;
            btnContr.Height = this.Height;
            btnContr.TextAlignment = TextAlignment.CenterRight;
            btnContr.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnContr.Text = i_text;
            var btnContr = AddMostRightView(i_text, i_width, ControlCommonResourse.NormalControlHeight, false);
            this.AddChidren(btnContr, ChidrenBindMode.BindEventOnly);
            if (chidrenYaxis != 0)
            {
@@ -264,6 +278,31 @@
            return btnContr;
        }
        /// <summary>
        /// 添加最右的显示文本,此方法不会主动添加到父控件中(如果右边有图标的话,先添加图标后,再添加这个文本)
        /// </summary>
        /// <param name="i_caption">内容</param>
        /// <param name="i_width">宽度</param>
        /// <param name="i_height">高度</param>
        /// <param name="real">是否计算真实值</param>
        /// <returns></returns>
        public NormalViewControl AddMostRightView(string i_text, int i_width, int i_height, bool real = true)
        {
            if (real == true)
            {
                i_width = Application.GetRealWidth(i_width);
                i_height = Application.GetRealHeight(i_height);
            }
            var btnContr = new NormalViewControl(i_width, i_height, false);
            btnContr.X = this.Width - ControlCommonResourse.XXLeft - i_width - rightIconSize + RightOffset;
            btnContr.Height = this.Height;
            btnContr.TextAlignment = TextAlignment.CenterRight;
            btnContr.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnContr.Text = i_text;
            return btnContr;
        }
        #endregion
    }
}