From 5ec581e5d37b108fc9d59e89afd8e94e21b32080 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期二, 17 十月 2023 17:33:36 +0800
Subject: [PATCH] 2023年10月17日17:33:33

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs |  104 ++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 73 insertions(+), 31 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
index c599ae8..dba07fc 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/MenuFramLayout.cs
@@ -14,7 +14,7 @@
         {
             this.Width = Application.GetRealWidth(width);
             this.Height = Application.GetRealWidth(height);
-            this.Radius = (uint)Application.GetRealHeight(cornerValue);
+            this.Radius = (uint)Application.GetRealWidth(cornerValue);
             this.BackgroundColor = MusicColor.ViewColor;
             this.Gravity = Gravity.CenterHorizontal;
         }
@@ -22,8 +22,8 @@
         {
             Y = Application.GetRealWidth(16),
             X = Application.GetRealWidth(78),
-            Width = Application.GetRealWidth(24),
-            Height = Application.GetRealHeight(20),
+            Width = Application.GetRealWidth(24),//楂樺害鍜屽楂樹笉涓�鏍�,浠ュ搴︿负缁村害璁$畻,鍚﹀垯鍙樺舰
+            Height = Application.GetRealWidth(20),
             UnSelectedImagePath = "AksIcon/shang.png",
             SelectedImagePath = "AksIcon/shang_selected.png",
             Name = "涓�",
@@ -40,7 +40,7 @@
             Y = Application.GetRealWidth(144),
             X = Application.GetRealWidth(78),
             Width = Application.GetRealWidth(24),
-            Height = Application.GetRealHeight(20),
+            Height = Application.GetRealWidth(20),
             UnSelectedImagePath = "AksIcon/xia.png",
             SelectedImagePath = "AksIcon/xia_selected.png",
             Name = "涓�",
@@ -57,7 +57,7 @@
             Y = Application.GetRealWidth(78),
             X = Application.GetRealWidth(16),
             Width = Application.GetRealWidth(20),
-            Height = Application.GetRealHeight(24),
+            Height = Application.GetRealWidth(24),
             UnSelectedImagePath = "AksIcon/zuo.png",
             SelectedImagePath = "AksIcon/zuo_selected.png",
             Name = "宸�",
@@ -76,7 +76,7 @@
             Y = Application.GetRealWidth(78),
             X = Application.GetRealWidth(144),
             Width = Application.GetRealWidth(20),
-            Height = Application.GetRealHeight(24),
+            Height = Application.GetRealWidth(24),
             UnSelectedImagePath = "AksIcon/you.png",
             SelectedImagePath = "AksIcon/you_selected.png",
             Name = "鍙�",
@@ -94,10 +94,10 @@
 
         Button btnOkbj = new Button
         {
-            Gravity=Gravity.Center,
+            Gravity = Gravity.Center,
             Width = Application.GetRealWidth(76),
             Height = Application.GetRealWidth(76),
-            Radius = (uint)Application.GetRealHeight(38),
+            Radius = (uint)Application.GetRealWidth(38),
             BackgroundColor = MusicColor.WhiteColor,
 
 
@@ -107,7 +107,7 @@
             Gravity = Gravity.Center,
             Width = Application.GetRealWidth(28),
             Height = Application.GetRealWidth(28),
-            Radius = (uint)Application.GetRealHeight(14),
+            Radius = (uint)Application.GetRealWidth(14),
             BackgroundColor = 0xff1B2D4D,
             SelectedBackgroundColor = MusicColor.SelectedColor,
             Name = "纭畾"
@@ -140,6 +140,10 @@
         {
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
             {
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnTop.Name;
+                keypadEntity.keypad = "key_up";
+                action?.Invoke(keypadEntity);
                 btnTop.IsSelected = false;
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
@@ -151,13 +155,17 @@
             {
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
                 btnTop.IsSelected = true;
-                KeypadEntity keypadEntity = new KeypadEntity();
-                keypadEntity.name = btnTop.Name;
-                keypadEntity.keypad = "key_up";
-                action?.Invoke(keypadEntity);
             };
             btnTop.MouseDownEventHandler += DownClick;
             btnTopClick.MouseDownEventHandler += DownClick;
+
+            EventHandler<MouseEventArgs> OutsideClick = (sender, e) =>
+            {
+                //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                btnTop.IsSelected = false;
+            };
+            btnTop.MouseUpOutsideEventHandler += OutsideClick;
+            btnTopClick.MouseUpOutsideEventHandler += OutsideClick;
         }
 
         /// <summary>
@@ -168,9 +176,11 @@
         {
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
             {
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnBottom.Name;
+                keypadEntity.keypad = "key_down";
+                action?.Invoke(keypadEntity);
                 btnBottom.IsSelected = false;
-
-
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
             btnBottom.MouseUpEventHandler += UpClick;
@@ -180,14 +190,22 @@
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
                 btnBottom.IsSelected = true;
-                KeypadEntity keypadEntity = new KeypadEntity();
-                keypadEntity.name = btnBottom.Name;
-                keypadEntity.keypad = "key_down";
-                action?.Invoke(keypadEntity);
+             
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
             };
             btnBottom.MouseDownEventHandler += DownClick;
             btnBottomClick.MouseDownEventHandler += DownClick;
+
+
+            EventHandler<MouseEventArgs> OutsideClick = (sender, e) =>
+            {
+                //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                btnBottom.IsSelected = false;
+            };
+            btnBottom.MouseUpOutsideEventHandler += OutsideClick;
+            btnBottomClick.MouseUpOutsideEventHandler += OutsideClick;
+
+
         }
         /// <summary>
         /// 宸�
@@ -197,6 +215,10 @@
         {
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
             {
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnLeft.Name;
+                keypadEntity.keypad = "key_left";
+                action?.Invoke(keypadEntity);
                 btnLeft.IsSelected = false;
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
@@ -207,14 +229,18 @@
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
                 btnLeft.IsSelected = true;
-                KeypadEntity keypadEntity = new KeypadEntity();
-                keypadEntity.name = btnLeft.Name;
-                keypadEntity.keypad = "key_left";
-                action?.Invoke(keypadEntity);
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
             };
             btnLeft.MouseDownEventHandler += DownClick;
             btnLeftClick.MouseDownEventHandler += DownClick;
+
+            EventHandler<MouseEventArgs> OutsideClick = (sender, e) =>
+            {
+                //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                btnLeft.IsSelected = false;
+            };
+            btnLeft.MouseUpOutsideEventHandler += OutsideClick;
+            btnLeftClick.MouseUpOutsideEventHandler += OutsideClick;
 
         }
         /// <summary>
@@ -225,6 +251,10 @@
         {
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
             {
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnRight.Name;
+                keypadEntity.keypad = "key_right";
+                action?.Invoke(keypadEntity);
                 btnRight.IsSelected = false;
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
@@ -236,13 +266,18 @@
             {
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
                 btnRight.IsSelected = true;
-                KeypadEntity keypadEntity = new KeypadEntity();
-                keypadEntity.name = btnRight.Name;
-                keypadEntity.keypad = "key_right";
-                action?.Invoke(keypadEntity);
+
             };
             btnRight.MouseDownEventHandler += DownClick;
             btnRightClick.MouseDownEventHandler += DownClick;
+
+            EventHandler<MouseEventArgs> OutsideClick = (sender, e) =>
+            {
+                //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                btnRight.IsSelected = false;
+            };
+            btnRight.MouseUpOutsideEventHandler += OutsideClick;
+            btnRightClick.MouseUpOutsideEventHandler += OutsideClick;
         }
 
 
@@ -255,6 +290,10 @@
         {
             EventHandler<MouseEventArgs> UpClick = (sender, e) =>
             {
+                KeypadEntity keypadEntity = new KeypadEntity();
+                keypadEntity.name = btnOk.Name;
+                keypadEntity.keypad = "key_ok";
+                action?.Invoke(keypadEntity);
                 btnOk.IsSelected = false;
                 //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
             };
@@ -264,13 +303,16 @@
             EventHandler<MouseEventArgs> DownClick = (sender, e) =>
             {
                 btnOk.IsSelected = true;
-                KeypadEntity keypadEntity = new KeypadEntity();
-                keypadEntity.name = btnOk.Name;
-                keypadEntity.keypad = "key_ok";
-                action?.Invoke(keypadEntity);
                 //鎸変笅鍘绘敼鍙樿儗鏅鑹�
             };
             btnOk.MouseDownEventHandler += DownClick;
+
+            EventHandler<MouseEventArgs> OutsideClick = (sender, e) =>
+            {
+                //寮硅捣鏉ヨ繕鍘熻儗鏅鑹�
+                btnOk.IsSelected = false;
+            };
+            btnOk.MouseUpOutsideEventHandler += OutsideClick;
         }
 
     }

--
Gitblit v1.8.0