From f8283c8ebef3e0af8bd990c3e86cc9d010ba528e Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期二, 01 八月 2023 16:37:33 +0800 Subject: [PATCH] 2023年08月01日16:37:16 --- HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs | 228 ++++++++++++++++++++++++++++++-------------------------- 1 files changed, 121 insertions(+), 107 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs index 7a34586..0400c94 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/TypeMultiFramLayout.cs @@ -8,97 +8,113 @@ private uint UpBackgroundColor = 0x00000000; private uint DownBackgroundColor = 0xff454635; - public TypeMultiFramLayout() - { - this.BackgroundColor = MusicColor.ViewColor; - this.Height = Application.GetRealHeight(40); - this.Radius = (uint)Application.GetRealHeight(20); - } - - Button btnLeftImage = new Button + /// <summary> + /// 澶氫釜绫诲瀷瀹瑰櫒 + /// </summary> + public FrameLayout multiFramLayout = new FrameLayout { - X = Application.GetRealWidth(16), + BackgroundColor = MusicColor.ViewColor, + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(311), + Height = Application.GetRealHeight(40), + Radius = (uint)Application.GetRealHeight(20), + }; + + + + public FrameLayout leftFramLayout = new FrameLayout + { + X = Application.GetRealWidth(16), + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(139), + Height = Application.GetRealHeight(23), + Radius = (uint)Application.GetRealHeight(20), + + }; + + + public Button btnBottonLeftImage = new Button + { Width = Application.GetRealWidth(16), Height = Application.GetRealWidth(16), - UnSelectedImagePath = "AksIcon/yingku.png", + UnSelectedImagePath = "AksIcon/shixuqi.png", Gravity = Gravity.CenterVertical, - Name = "btnLeftImage", + Name = "btnBottonLeftImage", }; - Button btnName1 = new Button + + public Button btnBottonName = new Button { - Width = Application.GetRealWidth(32), + Width = Application.GetRealWidth(100), Height = Application.GetRealHeight(23), + TextID = StringId.shixuqi, TextSize = TextSize.Text16, TextColor = MusicColor.TextColor, - TextAlignment = TextAlignment.Center, + TextAlignment = TextAlignment.CenterLeft, Gravity = Gravity.CenterVertical, IsMoreLines = true, - Name = "btnName", }; - Button btnRightImage = new Button + + + public FrameLayout lineFramLayout = new FrameLayout + { + BackgroundColor = MusicColor.TextColor, + Y = Application.GetRealHeight(10), + Width = Application.GetRealWidth(1), + Height = Application.GetRealHeight(20), + }; + + + + public FrameLayout rightFramLayout = new FrameLayout + { + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(138), + Height = Application.GetRealHeight(23), + Radius = (uint)Application.GetRealHeight(20), + + }; + + + public Button btnBottonRightImage = new Button { Width = Application.GetRealWidth(16), Height = Application.GetRealWidth(16), - UnSelectedImagePath = "AksIcon/yingkunext.png", - Gravity = Gravity.CenterVertical, - Name = "btnRightImage", + UnSelectedImagePath = "AksIcon/xuanze.png", + Gravity = Gravity.CenterRight, }; - public void AddBtnLeftImage() + public Button btnBottonRightName = new Button { - this.AddChidren(btnLeftImage); + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(23), + TextID = StringId.bofangqi, + TextSize = TextSize.Text16, + TextColor = MusicColor.TextColor, + TextAlignment = TextAlignment.CenterRight, + Gravity = Gravity.CenterVertical, + IsMoreLines = true, + }; + + + public void AddView(FrameLayout layout) + { + layout.AddChidren(multiFramLayout); + multiFramLayout.AddChidren(leftFramLayout); + leftFramLayout.AddChidren(btnBottonLeftImage); + leftFramLayout.AddChidren(btnBottonName); + multiFramLayout.AddChidren(lineFramLayout); + multiFramLayout.AddChidren(rightFramLayout); + rightFramLayout.AddChidren(btnBottonRightImage); + rightFramLayout.AddChidren(btnBottonRightName); + btnBottonName.X = btnBottonLeftImage.Right + Application.GetRealWidth(4); + lineFramLayout.X = leftFramLayout.Right; + rightFramLayout.X = lineFramLayout.Right; + btnBottonRightName.X = btnBottonLeftImage.Right + Application.GetRealWidth(4); } - public void AddBtnName(int gap = 4) - { - if (this.IsAddBtn(btnLeftImage)) - { - btnName1.X = btnLeftImage.Right + Application.GetRealWidth(gap); - } - - //if (btnName.GetTextWidth() < btnName.Width) - //{ - // btnName.Width = btnName.GetTextWidth(); - //} - this.AddChidren(btnName1); - } - - public void AddBtnRightImage(int gap = 8) - { - - if (this.IsAddBtn(btnName1)) - { - btnRightImage.X = btnName1.Right + Application.GetRealWidth(gap); - if (gap == 8) - { - btnRightImage.Width = Application.GetRealWidth(5); - btnRightImage.Height = Application.GetRealHeight(8); - } - - } - this.AddChidren(btnRightImage); - } - - - - - public Button GetBtnLeftImage() - { - return btnLeftImage; - } - - public Button GetBtnName() - { - return btnName1; - } - - public Button GetBtnRightImage() - { - return btnRightImage; - } public void SetClickUpBackgroundColor(uint backgroundColor) { @@ -112,63 +128,61 @@ } /// <summary> - /// 浜嬩欢鐩戝惉鏂规硶 + /// 搴忔椂鍣ㄧ被鍨嬪鍣� /// </summary> - /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄;绗簩涓槸鍥炬爣瀵硅薄;绗笁涓槸鐘舵�佸璞�</param> - public void SetClickListener(Action<FrameLayout, Button, Button, Button> action) + /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄</param> + public void SetLeftFlClickListener(Action<FrameLayout> action) { EventHandler<MouseEventArgs> UpClick = (sender, e) => { - this.BackgroundColor = this.UpBackgroundColor; - action?.Invoke(this, btnLeftImage, btnName1, btnRightImage); + leftFramLayout.BackgroundColor = this.UpBackgroundColor; + //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� }; - this.MouseUpEventHandler += UpClick; - btnLeftImage.MouseUpEventHandler += UpClick; - btnName1.MouseUpEventHandler += UpClick; - btnRightImage.MouseUpEventHandler += UpClick; + leftFramLayout.MouseUpEventHandler += UpClick; + btnBottonLeftImage.MouseUpEventHandler += UpClick; + btnBottonName.MouseUpEventHandler += UpClick; + EventHandler<MouseEventArgs> DownClick = (sender, e) => { //鎸変笅鍘绘敼鍙樿儗鏅鑹� - this.BackgroundColor = this.DownBackgroundColor; + leftFramLayout.BackgroundColor = this.DownBackgroundColor; + action?.Invoke(leftFramLayout); }; - this.MouseDownEventHandler += DownClick; - btnLeftImage.MouseDownEventHandler += DownClick; - btnName1.MouseDownEventHandler += DownClick; - btnRightImage.MouseDownEventHandler += DownClick; + leftFramLayout.MouseDownEventHandler += DownClick; + btnBottonLeftImage.MouseDownEventHandler += DownClick; + btnBottonName.MouseDownEventHandler += DownClick; } + /// <summary> - /// 鍦ㄧ埗甯冨眬鏌ユ壘瀛愭帶浠舵槸鍚﹀瓨鍦� + /// 鎾斁鍣ㄧ被鍨嬪鍣� /// </summary> - /// <param name="btn">鏌ユ壘瀵硅薄</param> - /// <returns>瀛樺湪涓簍rue,鍚﹀垯涓篺alse</returns> - private bool IsAddBtn(View btn) + /// <param name="action">鍥炶皟(绗竴涓槸鐖剁被瀵硅薄</param> + public void SetRightFlClickListener(Action<FrameLayout> action) { - - if (this.ChildrenCount <= 0 || btn == null) + EventHandler<MouseEventArgs> UpClick = (sender, e) => { - return false; - } - for (int i = 0; i < this.ChildrenCount; i++) + rightFramLayout.BackgroundColor = this.UpBackgroundColor; + + //寮硅捣鏉ヨ繕鍘熻儗鏅鑹� + }; + rightFramLayout.MouseUpEventHandler += UpClick; + btnBottonRightImage.MouseUpEventHandler += UpClick; + btnBottonRightName.MouseUpEventHandler += UpClick; + + + EventHandler<MouseEventArgs> DownClick = (sender, e) => { - View view = this.GetChildren(i); - if (view == null) - { - continue; - } - if (view is Button) - { - if (view.Name == btn.Name) - { - return true; - } - } - - } - return false; - + //鎸変笅鍘绘敼鍙樿儗鏅鑹� + rightFramLayout.BackgroundColor = this.DownBackgroundColor; + action?.Invoke(rightFramLayout); + }; + rightFramLayout.MouseDownEventHandler += DownClick; + btnBottonRightImage.MouseDownEventHandler += DownClick; + btnBottonRightName.MouseDownEventHandler += DownClick; } + } -- Gitblit v1.8.0