From 38ee59a8404c1fa9385649f9690c8d671a5d95de Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期四, 31 八月 2023 19:00:22 +0800
Subject: [PATCH] 2023年08月31日19:00:14
---
HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs | 116 +++++++++++++++++++++++++++++++---------------------------
1 files changed, 62 insertions(+), 54 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
index 80ea0ac..0e3bf7b 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
@@ -1,65 +1,71 @@
锘縰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;
public MenuFramLayout(int width = widthFrameLayout, int height = heightFrameLayout)
{
- this.Width = Application.GetMinRealAverage(width);
- this.Height = Application.GetMinRealAverage(height);
+ this.Width = Application.GetRealWidth(width);
+ this.Height = Application.GetRealWidth(height);
this.Radius = (uint)Application.GetRealHeight(cornerValue);
this.BackgroundColor = MusicColor.ViewColor;
this.Gravity = Gravity.CenterHorizontal;
}
Button btnTop = new Button
{
- Y = Application.GetMinRealAverage(16),
- X = Application.GetMinRealAverage(78),
+ Y = Application.GetRealWidth(16),
+ X = Application.GetRealWidth(78),
Width = Application.GetRealWidth(24),
Height = Application.GetRealHeight(20),
UnSelectedImagePath = "AksIcon/shang.png",
+ SelectedImagePath = "AksIcon/shang_selected.png",
+ Name = "涓�",
};
Button btnBottom = new Button
{
- Y = Application.GetMinRealAverage(144),
- X = Application.GetMinRealAverage(78),
+ Y = Application.GetRealWidth(144),
+ X = Application.GetRealWidth(78),
Width = Application.GetRealWidth(24),
Height = Application.GetRealHeight(20),
UnSelectedImagePath = "AksIcon/xia.png",
+ SelectedImagePath = "AksIcon/xia_selected.png",
+ Name = "涓�",
};
Button btnLeft = new Button
{
- Y = Application.GetMinRealAverage(78),
- X = Application.GetMinRealAverage(16),
+ Y = Application.GetRealWidth(78),
+ X = Application.GetRealWidth(16),
Width = Application.GetRealWidth(20),
Height = Application.GetRealHeight(24),
UnSelectedImagePath = "AksIcon/zuo.png",
+ SelectedImagePath = "AksIcon/zuo_selected.png",
+ Name = "宸�",
};
Button btnRight = new Button
{
- Y = Application.GetMinRealAverage(78),
- X = Application.GetMinRealAverage(144),
+ Y = Application.GetRealWidth(78),
+ X = Application.GetRealWidth(144),
Width = Application.GetRealWidth(20),
Height = Application.GetRealHeight(24),
UnSelectedImagePath = "AksIcon/you.png",
+ SelectedImagePath = "AksIcon/you_selected.png",
+ Name = "鍙�",
};
Button btnOkbj = new Button
{
- Y = Application.GetMinRealAverage(52),
- X = Application.GetMinRealAverage(52),
- Width = Application.GetMinRealAverage(76),
- Height = Application.GetMinRealAverage(76),
+ Gravity=Gravity.Center,
+ Width = Application.GetRealWidth(76),
+ Height = Application.GetRealWidth(76),
Radius = (uint)Application.GetRealHeight(38),
BackgroundColor = MusicColor.WhiteColor,
@@ -67,12 +73,13 @@
};
Button btnOk = new Button
{
- Y = Application.GetMinRealAverage(76),
- X = Application.GetMinRealAverage(76),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
+ Gravity = Gravity.Center,
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
Radius = (uint)Application.GetRealHeight(14),
- BackgroundColor = MusicColor.SelectedColor,
+ BackgroundColor = 0xff1B2D4D,
+ SelectedBackgroundColor = MusicColor.SelectedColor,
+ Name = "纭畾"
};
public void AddView(FrameLayout layout)
@@ -84,6 +91,7 @@
this.AddChidren(btnOkbj);
this.AddChidren(btnOk);
layout.AddChidren(this);
+ //btnBottom.Y = btnOkbj.Bottom + Application.GetRealWidth(16);
}
@@ -91,13 +99,11 @@
/// 涓�
/// </summary>
/// <param name="action"></param>
- public void SetTopClickListener(Action<Button> action)
+ public void SetTopClickListener(Action<KeypadEntity> action)
{
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- //btnTop.BackgroundColor = this.UpBackgroundColor;
btnTop.IsSelected = false;
- action?.Invoke(btnTop);
//寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
};
btnTop.MouseUpEventHandler += UpClick;
@@ -106,7 +112,11 @@
EventHandler<MouseEventArgs> DownClick = (sender, e) =>
{
//鎸変笅鍘绘敼鍙樿儗鏅鑹�
- btnTop.BackgroundColor = this.DownBackgroundColor;
+ btnTop.IsSelected = true;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnTop.Name;
+ keypadEntity.keypad = "key_up";
+ action?.Invoke(keypadEntity);
};
btnTop.MouseDownEventHandler += DownClick;
}
@@ -115,13 +125,13 @@
/// 涓�
/// </summary>
/// <param name="action"></param>
- public void SetBottomClickListener(Action<Button> action)
+ public void SetBottomClickListener(Action<KeypadEntity> action)
{
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- //btnBottom.BackgroundColor = this.UpBackgroundColor;
btnBottom.IsSelected = false;
- action?.Invoke(btnBottom);
+
+
//寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
};
btnBottom.MouseUpEventHandler += UpClick;
@@ -129,8 +139,12 @@
EventHandler<MouseEventArgs> DownClick = (sender, e) =>
{
+ btnBottom.IsSelected = true;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnBottom.Name;
+ keypadEntity.keypad = "key_down";
+ action?.Invoke(keypadEntity);
//鎸変笅鍘绘敼鍙樿儗鏅鑹�
- btnBottom.BackgroundColor = this.DownBackgroundColor;
};
btnBottom.MouseDownEventHandler += DownClick;
}
@@ -138,13 +152,11 @@
/// 宸�
/// </summary>
/// <param name="action"></param>
- public void SetLeftClickListener(Action<Button> action)
+ public void SetLeftClickListener(Action<KeypadEntity> action)
{
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- //btnLeft.BackgroundColor = this.UpBackgroundColor;
btnLeft.IsSelected = false;
- action?.Invoke(btnLeft);
//寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
};
btnLeft.MouseUpEventHandler += UpClick;
@@ -152,8 +164,12 @@
EventHandler<MouseEventArgs> DownClick = (sender, e) =>
{
+ btnLeft.IsSelected = true;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnLeft.Name;
+ keypadEntity.keypad = "key_left";
+ action?.Invoke(keypadEntity);
//鎸変笅鍘绘敼鍙樿儗鏅鑹�
- btnLeft.BackgroundColor = this.DownBackgroundColor;
};
btnLeft.MouseDownEventHandler += DownClick;
}
@@ -161,13 +177,11 @@
/// 鍙�
/// </summary>
/// <param name="action"></param>
- public void SetRightClickListener(Action<Button> action)
+ public void SetRightClickListener(Action<KeypadEntity> action)
{
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- //btnRight.BackgroundColor = this.UpBackgroundColor;
btnRight.IsSelected = false;
- action?.Invoke(btnRight);
//寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
};
btnRight.MouseUpEventHandler += UpClick;
@@ -176,7 +190,11 @@
EventHandler<MouseEventArgs> DownClick = (sender, e) =>
{
//鎸変笅鍘绘敼鍙樿儗鏅鑹�
- btnRight.BackgroundColor = this.DownBackgroundColor;
+ btnRight.IsSelected = true;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnRight.Name;
+ keypadEntity.keypad = "key_right";
+ action?.Invoke(keypadEntity);
};
btnRight.MouseDownEventHandler += DownClick;
}
@@ -187,12 +205,11 @@
/// ok
/// </summary>
/// <param name="action"></param>
- public void SetOkClickListener(Action<Button> action)
+ public void SetOkClickListener(Action<KeypadEntity> action)
{
EventHandler<MouseEventArgs> UpClick = (sender, e) =>
{
- btnOk.BackgroundColor = MusicColor.SelectedColor;// this.UpBackgroundColor;
- action?.Invoke(btnOk);
+ btnOk.IsSelected = false;
//寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
};
btnOk.MouseUpEventHandler += UpClick;
@@ -200,24 +217,15 @@
EventHandler<MouseEventArgs> DownClick = (sender, e) =>
{
+ btnOk.IsSelected = true;
+ KeypadEntity keypadEntity = new KeypadEntity();
+ keypadEntity.name = btnOk.Name;
+ keypadEntity.keypad = "key_ok";
+ action?.Invoke(keypadEntity);
//鎸変笅鍘绘敼鍙樿儗鏅鑹�
- 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