From 3e8ab638052329c43b399213ceca04df2b27685b Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 14 八月 2023 17:38:52 +0800
Subject: [PATCH] 2023-08-14 17:38:47
---
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 158 insertions(+), 3 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
index cc6989e..aaec10b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
@@ -1,11 +1,13 @@
锘縰sing System;
using HDL_ON.UI.Music;
+using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
{
public class MenuFramLayout : BaseFramLayout
{
-
+ private uint UpBackgroundColor = 0x00000000;
+ private uint DownBackgroundColor = 0xff454635;
public const int widthFrameLayout = 180;
public const int heightFrameLayout = 180;
public const int cornerValue = 90;
@@ -16,6 +18,7 @@
this.Height = Application.GetMinRealAverage(height);
this.Radius = (uint)Application.GetRealHeight(cornerValue);
this.BackgroundColor = MusicColor.ViewColor;
+ this.Gravity = Gravity.CenterHorizontal;
}
Button btnTop = new Button
{
@@ -24,6 +27,7 @@
Width = Application.GetRealWidth(24),
Height = Application.GetRealHeight(20),
UnSelectedImagePath = "AksIcon/shang.png",
+ Name= "涓�",
};
Button btnBottom = new Button
{
@@ -32,6 +36,7 @@
Width = Application.GetRealWidth(24),
Height = Application.GetRealHeight(20),
UnSelectedImagePath = "AksIcon/xia.png",
+ Name = "涓�",
};
Button btnLeft = new Button
{
@@ -40,6 +45,7 @@
Width = Application.GetRealWidth(20),
Height = Application.GetRealHeight(24),
UnSelectedImagePath = "AksIcon/zuo.png",
+ Name = "宸�",
};
Button btnRight = new Button
@@ -49,6 +55,7 @@
Width = Application.GetRealWidth(20),
Height = Application.GetRealHeight(24),
UnSelectedImagePath = "AksIcon/you.png",
+ Name = "鍙�",
};
@@ -71,19 +78,167 @@
Height = Application.GetMinRealAverage(28),
Radius = (uint)Application.GetRealHeight(14),
BackgroundColor = MusicColor.SelectedColor,
+ Name= "纭畾"
};
public void AddView(FrameLayout layout)
{
- layout.AddChidren(this);
this.AddChidren(btnTop);
this.AddChidren(btnBottom);
this.AddChidren(btnLeft);
this.AddChidren(btnRight);
this.AddChidren(btnOkbj);
this.AddChidren(btnOk);
-
+ layout.AddChidren(this);
}
+
+ /// <summary>
+ /// 涓�
+ /// </summary>
+ /// <param name="action"></param>
+ public void SetTopClickListener(Action<KeypadEntity> action)
+ {
+ EventHandler<MouseEventArgs> UpClick = (sender, e) =>
+ {
+ //btnTop.BackgroundColor = this.UpBackgroundColor;
+ btnTop.IsSelected = false;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnTop.Name;
+ keypadEntity.keypad = "key_up";
+ action?.Invoke(keypadEntity);
+ //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+ };
+ btnTop.MouseUpEventHandler += UpClick;
+
+
+ EventHandler<MouseEventArgs> DownClick = (sender, e) =>
+ {
+ //鎸変笅鍘绘敼鍙樿儗鏅鑹�
+ btnTop.BackgroundColor = this.DownBackgroundColor;
+ };
+ btnTop.MouseDownEventHandler += DownClick;
+ }
+
+ /// <summary>
+ /// 涓�
+ /// </summary>
+ /// <param name="action"></param>
+ public void SetBottomClickListener(Action<KeypadEntity> action)
+ {
+ EventHandler<MouseEventArgs> UpClick = (sender, e) =>
+ {
+ //btnBottom.BackgroundColor = this.UpBackgroundColor;
+ btnBottom.IsSelected = false;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnBottom.Name;
+ keypadEntity.keypad = "key_down";
+ action?.Invoke(keypadEntity);
+ //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+ };
+ btnBottom.MouseUpEventHandler += UpClick;
+
+
+ EventHandler<MouseEventArgs> DownClick = (sender, e) =>
+ {
+ //鎸変笅鍘绘敼鍙樿儗鏅鑹�
+ btnBottom.BackgroundColor = this.DownBackgroundColor;
+ };
+ btnBottom.MouseDownEventHandler += DownClick;
+ }
+ /// <summary>
+ /// 宸�
+ /// </summary>
+ /// <param name="action"></param>
+ public void SetLeftClickListener(Action<KeypadEntity> action)
+ {
+ EventHandler<MouseEventArgs> UpClick = (sender, e) =>
+ {
+ //btnLeft.BackgroundColor = this.UpBackgroundColor;
+ btnLeft.IsSelected = false;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnLeft.Name;
+ keypadEntity.keypad = "key_left";
+ action?.Invoke(keypadEntity);
+ //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+ };
+ btnLeft.MouseUpEventHandler += UpClick;
+
+
+ EventHandler<MouseEventArgs> DownClick = (sender, e) =>
+ {
+ //鎸変笅鍘绘敼鍙樿儗鏅鑹�
+ btnLeft.BackgroundColor = this.DownBackgroundColor;
+ };
+ btnLeft.MouseDownEventHandler += DownClick;
+ }
+ /// <summary>
+ /// 鍙�
+ /// </summary>
+ /// <param name="action"></param>
+ public void SetRightClickListener(Action<KeypadEntity> action)
+ {
+ EventHandler<MouseEventArgs> UpClick = (sender, e) =>
+ {
+ //btnRight.BackgroundColor = this.UpBackgroundColor;
+ btnRight.IsSelected = false;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnRight.Name;
+ keypadEntity.keypad = "key_right";
+ action?.Invoke(keypadEntity);
+ //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+ };
+ btnRight.MouseUpEventHandler += UpClick;
+
+
+ EventHandler<MouseEventArgs> DownClick = (sender, e) =>
+ {
+ //鎸変笅鍘绘敼鍙樿儗鏅鑹�
+ btnRight.BackgroundColor = this.DownBackgroundColor;
+ };
+ btnRight.MouseDownEventHandler += DownClick;
+ }
+
+
+
+ /// <summary>
+ /// ok
+ /// </summary>
+ /// <param name="action"></param>
+ public void SetOkClickListener(Action<KeypadEntity> action)
+ {
+ EventHandler<MouseEventArgs> UpClick = (sender, e) =>
+ {
+ btnOk.BackgroundColor = MusicColor.SelectedColor;// this.UpBackgroundColor;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnOk.Name;
+ keypadEntity.keypad = "key_ok";
+ action?.Invoke(keypadEntity);
+ //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+ };
+ btnOk.MouseUpEventHandler += UpClick;
+
+
+ EventHandler<MouseEventArgs> DownClick = (sender, e) =>
+ {
+ //鎸変笅鍘绘敼鍙樿儗鏅鑹�
+ btnOk.BackgroundColor = this.DownBackgroundColor;
+ };
+ btnOk.MouseDownEventHandler += DownClick;
+ }
+
+ public void SetClickUpBackgroundColor(uint backgroundColor)
+ {
+ this.UpBackgroundColor = backgroundColor;
+
+ }
+
+ public void SetClickDownBackgroundColor(uint backgroundColor)
+ {
+ this.DownBackgroundColor = backgroundColor;
+ }
+
+
+
}
}
--
Gitblit v1.8.0