From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期三, 22 六月 2022 11:22:18 +0800 Subject: [PATCH] 修改引用路径 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs | 375 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 375 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs new file mode 100644 index 0000000..07f6d9e --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/FrameLayoutControls/FrameRowControl.cs @@ -0,0 +1,375 @@ +锘縰sing System; +using System.Collections.Generic; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 鍋氭垚涓�涓猂owLayout鍨嬬殑FrameLayout + /// </summary> + public class FrameRowControl : FrameLayoutStatuControl + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 姝ゆ帶浠剁殑璇嗗埆涓婚敭(鑷畾涔夎缃殑) + /// </summary> + public string MainKeys = string.Empty; + /// <summary> + /// 宸﹀亸绉婚噺,鍙拡瀵瑰唴缃帶浠舵湁鏁�(杩欐槸涓�涓湡瀹炲��,榛樿涓嶅亸绉汇�傛鏁颁负鍚戝彸鍋忕Щ,璐熸暟涓哄悜宸﹀亸绉�) + /// </summary> + public int LeftOffset = 0; + /// <summary> + /// 鍙冲亸绉婚噺,鍙拡瀵瑰唴缃帶浠舵湁鏁�(杩欐槸涓�涓湡瀹炲��,榛樿涓嶅亸绉汇�傛鏁颁负鍚戝彸鍋忕Щ,璐熸暟涓哄悜宸﹀亸绉�) + /// </summary> + public int RightOffset = 0; + /// <summary> + /// 宸﹁竟鍥炬爣鎺т欢鐨勫ぇ灏� + /// </summary> + private int leftIconSize = 0; + /// <summary> + /// 鍙宠竟鍥炬爣鎺т欢鐨勫ぇ灏� + /// </summary> + private int rightIconSize = 0; + /// <summary> + /// 搴曠嚎鎺т欢 + /// </summary> + private NormalViewControl btnBottomLine = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍋氭垚涓�涓猂owLayout鍨嬬殑FrameLayout + /// </summary> + /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(銆愬垪琛ㄦ帶浠剁殑rowSpace/2銆戝嵆鍙�,涓嶆噦榛樿涓�0鍗冲彲)</param> + public FrameRowControl(int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) + { + this.Height = ControlCommonResourse.ListViewRowHeight; + this.Width = Application.CurrentWidth; + } + + #endregion + + #region 鈻� 娣诲姞搴曠嚎___________________________ + + /// <summary> + /// <para>娣诲姞搴曠嚎(濡傛灉宸﹁竟鏈夊浘鏍囷紝鍒欏厛娣诲姞鍥炬爣锛屽啀娣诲姞搴曠嚎)</para> + /// <para>瀹冪殑闀垮害涓猴細褰撳墠鎺т欢瀹藉害-宸﹀彸鍥哄畾闂磋窛-宸﹁竟鍥剧墖瀹藉害(濡傛灉鏈�)-鍙宠竟鐨勫亸绉婚噺</para> + /// </summary> + public virtual NormalViewControl AddBottomLine() + { + if (this.btnBottomLine != null) + { + //宸茬粡娣诲姞浜嗗簳绾� + return btnBottomLine; + } + int lineWidth = this.Width - ControlCommonResourse.XXLeft * 2 - LeftOffset - RightOffset; + int XX = ControlCommonResourse.XXLeft + LeftOffset; + if (leftIconSize > 0) + { + lineWidth = lineWidth - leftIconSize - Application.GetRealWidth(35); + XX = XX + leftIconSize + Application.GetRealWidth(35); + } + this.btnBottomLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false); + btnBottomLine.X = XX; + btnBottomLine.Y = this.Height - ControlCommonResourse.BottomLineHeight; + btnBottomLine.BackgroundColor = UserCenterColor.Current.ButtomLine; + base.AddChidren(btnBottomLine); + + return btnBottomLine; + } + + #endregion + + #region 鈻� 娣诲姞宸﹁竟Caption____________________ + + /// <summary> + /// 娣诲姞宸﹁竟Caption(濡傛灉鏈夊浘鏍囷紝鍒欏厛娣诲姞鍥炬爣锛屽啀娣诲姞Caption) + /// </summary> + /// <param name="i_caption">鍐呭</param> + /// <param name="i_width">瀹藉害</param> + /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> + /// <returns></returns> + public NormalViewControl AddLeftCaption(string i_caption, int i_width, bool real = true) + { + if (real == true) + { + i_width = Application.GetRealWidth(i_width); + } + var contr = this.AddLeftCaption(i_caption, i_width, this.Height, false); + this.AddChidren(contr, ChidrenBindMode.BindEvent); + if (chidrenYaxis != 0) + { + contr.Y += chidrenYaxis; + } + + return contr; + } + + /// <summary> + /// 娣诲姞宸﹁竟Caption,姝ゆ柟娉曚笉浼氫富鍔ㄦ坊鍔犲埌鐖舵帶浠朵腑(濡傛灉鏈夊浘鏍囷紝鍒欏厛娣诲姞鍥炬爣锛屽啀娣诲姞Caption) + /// </summary> + /// <param name="i_caption">鍐呭</param> + /// <param name="i_width">瀹藉害</param> + /// <param name="i_height">楂樺害</param> + /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> + /// <returns></returns> + public NormalViewControl AddLeftCaption(string i_caption, int i_width, int i_height, bool real = true) + { + int XX = ControlCommonResourse.XXLeft + LeftOffset; + if (this.leftIconSize > 0) + { + XX += this.leftIconSize + Application.GetRealWidth(35); + } + var btnCaption = new NormalViewControl(i_width, i_height, real); + btnCaption.X = XX; + + btnCaption.Text = i_caption; + + return btnCaption; + } + + #endregion + + #region 鈻� 娣诲姞宸﹁竟杈撳叆妗哶____________________ + + /// <summary> + /// 娣诲姞宸﹁竟杈撳叆妗�(濡傛灉鏈夊浘鏍囷紝鍒欏厛娣诲姞鍥炬爣锛屽啀娣诲姞杈撳叆妗�) + /// </summary> + /// <param name="i_txtValue">鍒濆鍐呭</param> + /// <param name="i_width">瀹藉害</param> + /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> + /// <returns></returns> + public TextInputControl AddLeftInput(string i_txtValue, int i_width, bool real = true) + { + if (real == true) + { + i_width = Application.GetRealWidth(i_width); + } + int XX = ControlCommonResourse.XXLeft + LeftOffset; + if (this.leftIconSize > 0) + { + XX += this.leftIconSize + Application.GetRealWidth(35); + } + var contr = new TextInputControl(i_width, this.Height, false); + contr.Text = i_txtValue; + contr.X = XX; + + this.AddChidren(contr, ChidrenBindMode.NotBind); + if (chidrenYaxis != 0) + { + contr.Y += chidrenYaxis; + } + + return contr; + } + + #endregion + + #region 鈻� 娣诲姞宸﹁竟鍥炬爣_______________________ + + /// <summary> + /// 娣诲姞宸﹁竟鍥炬爣 + /// </summary> + /// <param name="i_Iconsize">鍥炬爣澶у皬</param> + /// <param name="i_IconPath">鍥炬爣鍦板潃</param> + /// <returns></returns> + public IconViewControl AddLeftIcon(int i_Iconsize = 81, string i_IconPath = null) + { + var btnIcon = new IconViewControl(i_Iconsize); + btnIcon.X = ControlCommonResourse.XXLeft + LeftOffset; + btnIcon.Gravity = Gravity.CenterVertical; + if (i_IconPath != null) + { + btnIcon.UnSelectedImagePath = i_IconPath; + } + this.AddChidren(btnIcon, ChidrenBindMode.BindEvent); + if (chidrenYaxis != 0) + { + btnIcon.Y += chidrenYaxis; + } + + this.leftIconSize = btnIcon.IconSize; + return btnIcon; + } + + #endregion + + #region 鈻� 娣诲姞鍚戝彸鐨勫浘鏍嘷____________________ + + /// <summary> + /// 娣诲姞鍚戝彸鐨勫浘鏍� + /// </summary> + public IconViewControl AddRightArrow() + { + var btnRight = new IconViewControl(58); + btnRight.Gravity = Gravity.CenterVertical; + btnRight.X =this.Width - btnRight.IconSize - ControlCommonResourse.XXLeft + RightOffset; + btnRight.UnSelectedImagePath = "Item/RightNext.png"; + this.AddChidren(btnRight, ChidrenBindMode.BindEvent); + + if (chidrenYaxis != 0) + { + btnRight.Y += chidrenYaxis; + } + + this.rightIconSize = btnRight.Width; + + return btnRight; + } + + /// <summary> + /// 娣诲姞鏈�鍙宠竟鐨勭┖鐧藉浘鐗囨帶浠� + /// </summary> + /// <param name="i_width">鎺т欢绌哄害(闈炵湡瀹炲��)</param> + /// <param name="i_height">鎺т欢楂樺害(闈炵湡瀹炲��)</param> + /// <returns></returns> + 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(); + //澶嶅悎鎺т欢闇�瑕佺壒娈婂鐞� + this.ChangedChidrenBindMode(btnContr, ChidrenBindMode.BindEvent); + if (RightOffset != 0) + { + btnContr.X += RightOffset; + } + + this.rightIconSize = this.GetPictrueRealSize(i_width); + if (chidrenYaxis != 0) + { + 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 + + #region 鈻� 娣诲姞鏈�鍙崇殑鏄剧ず鏂囨湰_________________ + + /// <summary> + /// 娣诲姞鏈�鍙崇殑鏄剧ず鏂囨湰(濡傛灉鍙宠竟鏈夊浘鏍囩殑璇�,鍏堟坊鍔犲浘鏍囧悗,鍐嶆坊鍔犺繖涓枃鏈�) + /// </summary> + /// <param name="i_text"></param> + /// <param name="i_width"></param> + /// <param name="real"></param> + /// <returns></returns> + public NormalViewControl AddMostRightView(string i_text, int i_width, bool real = true) + { + if (real == true) + { + i_width = Application.GetRealWidth(i_width); + } + var btnContr = AddMostRightView(i_text, i_width, this.Height, false); + this.AddChidren(btnContr, ChidrenBindMode.BindEvent); + if (chidrenYaxis != 0) + { + btnContr.Y += chidrenYaxis; + } + + 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 = i_height; + btnContr.TextAlignment = TextAlignment.CenterRight; + btnContr.TextColor = UserCenterColor.Current.TextGrayColor1; + btnContr.Text = i_text; + + return btnContr; + } + + #endregion + + #region 鈻� 娣诲姞涓婇儴鐨勬樉绀烘枃鏈琠________________ + + /// <summary> + /// 娣诲姞涓婇儴鐨勬樉绀烘枃鏈�(濡傛灉鏈夊浘鏍囷紝鍒欏厛娣诲姞鍥炬爣锛屽啀娣诲姞鏂囨湰) + /// </summary> + /// <param name="i_caption">鍐呭</param> + /// <param name="i_width">瀹藉害</param> + /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> + /// <returns></returns> + public NormalViewControl AddTopView(string i_caption, int i_width, bool real = true) + { + if (real == true) + { + i_width = Application.GetRealWidth(i_width); + } + var contr = this.AddLeftCaption(i_caption, i_width, Application.GetRealHeight(60), false); + contr.TextSize = 15; + //褰撴寚瀹氬疄闄呭潗鏍囨椂,杩欓噷闇�瑕佺殑鍋忕Щ閲忎负2鍊� + contr.Y = Application.GetRealHeight(12) + this.chidrenYaxis * 2; + this.AddChidren(contr, ChidrenBindMode.BindEvent); + + return contr; + } + + #endregion + + #region 鈻� 娣诲姞涓嬮儴鐨勬樉绀烘枃鏈琠________________ + + /// <summary> + /// 娣诲姞涓嬮儴鐨勬樉绀烘枃鏈�(濡傛灉鏈夊浘鏍囷紝鍒欏厛娣诲姞鍥炬爣锛屽啀娣诲姞鏂囨湰) + /// </summary> + /// <param name="i_caption">鍐呭</param> + /// <param name="i_width">瀹藉害</param> + /// <param name="real">鏄惁璁$畻鐪熷疄鍊�</param> + /// <returns></returns> + public NormalViewControl AddBottomView(string i_caption, int i_width, bool real = true) + { + if (real == true) + { + i_width = Application.GetRealWidth(i_width); + } + var contr = this.AddLeftCaption(i_caption, i_width, Application.GetRealHeight(50), false); + //褰撴寚瀹氬疄闄呭潗鏍囨椂,杩欓噷闇�瑕佺殑鍋忕Щ閲忎负2鍊� + contr.Y = Application.GetRealHeight(72) + this.chidrenYaxis * 2; + contr.TextSize = 12; + contr.TextColor = UserCenterColor.Current.TextGrayColor1; + this.AddChidren(contr, ChidrenBindMode.BindEvent); + + return contr; + } + + #endregion + } +} -- Gitblit v1.8.0