From 7df40c4d000b5424bc11d4a6b9c3332dfe661c67 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期二, 24 三月 2020 10:22:43 +0800
Subject: [PATCH] 2020-03-24-1
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/TopRightMenuControl.cs | 79 +++++++++++++++++++++++++--------------
1 files changed, 50 insertions(+), 29 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/TopRightMenuControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/TopRightMenuControl.cs
index 0a8b19e..b53b1c9 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/TopRightMenuControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/TopRightMenuControl.cs
@@ -39,21 +39,31 @@
/// <summary>
/// 鍋氭垚涓�涓瓨鍦ㄤ簬鍙充笂瑙掔殑鑿滃崟鎺т欢
/// </summary>
- /// <param name="i_RowCount">涓�鍏辨湁鍑犺</param>
- /// <param name="i_width">杩欎釜鑿滃崟鏈夊瀹�</param>
+ /// <param name="i_RowCount">涓�鍏辨湁鍑犺(涓嶅惈鏍囬)</param>
+ /// <param name="i_widthType">杩欎釜鑿滃崟鐨勫搴︽ā寮�,鐩墠鍙敮鎸�
+ /// <para>1: 395瀹藉害</para>
+ /// <para>2: 449瀹藉害</para>
+ /// </param>
/// <param name="titleText">鏍囬鏂囨湰(濡傛灉涓嶄负绌�,鑿滃崟妯″紡鍙樻洿涓烘嫢鏈夋爣棰樼殑妯″紡)</param>
- public TopRightMenuControl(int i_RowCount, int i_width = 395, string titleText = null)
+ public TopRightMenuControl(int i_RowCount, int i_widthType, string titleText = null)
{
this.RowCount = i_RowCount;
- this.RowWidth = i_width;
+ if (i_widthType == 1)
+ {
+ this.RowWidth = 395;
+ }
+ else if (i_widthType == 2)
+ {
+ this.RowWidth = 449;
+ }
//鍒濆鍖栫敾闈㈢殑鎺т欢
- this.InitFormControl(titleText);
+ this.InitFormControl(titleText, i_widthType);
}
/// <summary>
/// 鍒濆鍖栫敾闈㈢殑鎺т欢
/// </summary>
- private void InitFormControl(string titleText)
+ private void InitFormControl(string titleText, int i_widthType)
{
this.BackgroundColor = UserCenterColor.Current.DialogBackColor;
this.MouseUpEventHandler += (sender2, e2) =>
@@ -66,44 +76,54 @@
//鏈�澶ф樉绀�5涓�
int rowCount = this.RowCount > 5 ? 5 : this.RowCount;
- //妗屽竷
- var frameTable = new FrameLayoutControl(false);
- frameTable.X = Application.GetRealWidth(662 - (RowWidth - 395));
- frameTable.Y = Application.GetRealHeight(158 + 15 + 1);
- frameTable.Width = Application.GetRealWidth(RowWidth);
+ if (titleText != null)
+ {
+ //449瀹藉害鐨勬椂鍊欙紝鍗充娇鏄庣粏宸茬粡瓒呰繃浜�5涓紝浣嗘槸杩樻槸鍙互+1鐨�,鍥犱负杩欎釜妯″紡澶氫簡涓�寮犲浘鐗�
+ if (rowCount < 5 || i_widthType == 2)
+ {
+ //鑿滃崟+1
+ rowCount++;
+ }
+ }
+
+ //鑳屾櫙
+ var frameBack = new FrameLayout();
+ frameBack.X = Application.GetRealWidth(662 - (RowWidth - 395));
+ frameBack.Y = Application.GetRealHeight(161);
+ frameBack.Width = Application.GetRealWidth(RowWidth);
+ frameBack.Height = Application.GetRealHeight(RowHeight * rowCount + 16);
+ frameBack.BackgroundImagePath = "MenuGroud/TopRightMenu" + i_widthType + "_" + rowCount + ".png";
+ this.AddChidren(frameBack);
+
+ var frameTable = new FrameLayout();
+ frameTable.Y = Application.GetRealHeight(16);
frameTable.Height = Application.GetRealHeight(RowHeight * rowCount);
- frameTable.BackgroundColor = UserCenterColor.Current.White;
- frameTable.BorderColor = UserCenterColor.Current.Transparent;
- frameTable.RadiusEx = 6;
- this.AddChidren(frameTable);
+ frameBack.AddChidren(frameTable);
if (titleText != null)
{
- var btnTitle = new NormalViewControl(frameTable.Width - Application.GetRealWidth(81), Application.GetRealHeight(58), false);
+ var btnTitle = new NormalViewControl(frameBack.Width - Application.GetRealWidth(81), Application.GetRealHeight(58), false);
btnTitle.X = Application.GetRealWidth(81);
- btnTitle.Y = Application.GetRealHeight(58);
+ btnTitle.Y = Application.GetRealHeight(58 + 16);
btnTitle.Text = titleText;
frameTable.AddChidren(btnTitle);
}
//鍒楄〃鎺т欢
this.listView = new VerticalListControl();
- listView.Height = frameTable.Height;
- if (rowCount == 5 && titleText != null)
+ listView.Radius = (uint)Application.GetRealHeight(17);
+ if (titleText != null)
{
- //杩炲甫鏍囬,鍙兘鏄剧ず5琛�
- listView.Height = frameTable.Height - Application.GetRealHeight(RowHeight);
+ //鎷ユ湁鏍囬
listView.Y = Application.GetRealHeight(RowHeight);
+ listView.Height = frameTable.Height - Application.GetRealHeight(RowHeight);
}
- listView.Radius = frameTable.Radius;
+ else
+ {
+ //娌℃湁鏍囬
+ listView.Height = frameTable.Height;
+ }
frameTable.AddChidren(listView);
-
- //涓夎褰㈠浘鏍�
- var btnTriangle = new PicViewControl(31, 15);
- btnTriangle.X = Application.GetRealWidth(980);
- btnTriangle.Y = Application.GetRealHeight(159);
- btnTriangle.UnSelectedImagePath = "Item/UpperTriangle.png";
- this.AddChidren(btnTriangle);
}
#endregion
@@ -196,6 +216,7 @@
if (btnText != null)
{
btnText.TextColor = select == true ? UserCenterColor.Current.TextColor1 : UserCenterColor.Current.TextGrayColor1;
+ btnText.IsBold = select;
}
//鍓嶅洖閫夋嫨鐨勮彍鍗曚负null,鎴栬�呮槸鐩稿悓鐨勪笢瑗�,鍒欎笉澶勭悊
if (this.oldRowFrame == null || this.oldRowFrame.MainKeys == frame.MainKeys)
--
Gitblit v1.8.0