From 5bd5cdbae1d22b5e14e6933b807ed97b89807b6f Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期三, 18 十月 2023 19:33:20 +0800
Subject: [PATCH] 2023年10月18日19:32:41

---
 HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs |   43 ++++++++++++++++---------------------------
 1 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
index 87995cc..ea95c39 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/CommonView/CornerFramLayout.cs
@@ -4,6 +4,7 @@
 using System.Collections.Generic;
 using HDL_ON.UI.UI2.FuntionControlView.Aks.Entity;
 
+
 namespace HDL_ON.UI.UI2.FuntionControlView.Aks.CommonView
 {
     /// <summary>
@@ -128,20 +129,18 @@
                 //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹�
                 if (!keypad.isClicked)
                 {
-                    buttonFram.Enable = false;
-                    buttonFram.GetImageButton().Alpha =0.5f;
-                    buttonFram.GetImageButton().Enable = false;
-                    buttonFram.GetNameButton().Enable = false;
+                    buttonFram.GetImageButton().Alpha = 0.5f;
                     buttonFram.GetNameButton().TextColor = AksCommonMethod.unBackgroundColor;
-                    //buttonFram.BackgroundColor =AksCommonMethod.unParentBackgroundColor;
+                    buttonFram.SetClick(false);
 
                 }
                 buttonFram.SetClickListener((fl, btnIcon, btnName) =>
                 {
-                    if (buttonFram.Tag != null && buttonFram.Tag is KeypadEntity)
+                    if (buttonFram.Tag == null)
                     {
-                        selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag);
+                        return;
                     }
+                    selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag);
                 });
 
                 //if (defaultIndex != -1 && defaultIndex == i)
@@ -219,18 +218,18 @@
                 //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹�
                 if (!keypad.isClicked)
                 {
-                    buttonFram.Enable = false;
                     buttonFram.GetImageButton().Alpha = 0.5f;
-                    buttonFram.GetImageButton().Enable = false;
-                    buttonFram.GetNameButton().Enable = false;
                     buttonFram.GetNameButton().TextColor = AksCommonMethod.unBackgroundColor;
+                    buttonFram.SetClick(false);
                 }
                 buttonFram.SetClickListener((fl, btnIcon, btnName) =>
                 {
-                    if (buttonFram.Tag != null&& buttonFram.Tag is KeypadEntity)
+                    if (buttonFram.Tag == null)
                     {
-                        selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag);
+                        return;
                     }
+                    selectKeyAction?.Invoke((KeypadEntity)buttonFram.Tag);
+                  
                 });
 
                 //if (defaultIndex != -1 && defaultIndex == i)
@@ -256,12 +255,12 @@
             }
             int currnetheightValue = 0;
             int currnetWidthValue = 0;
-            int heightMaxValue = 84-6;
+            int heightMaxValue = 84 - 6;
             int widthMaxValue = 78;
             //鑾峰彇鐩稿涓�涓含搴﹀��
             int heightDimensionValue = this.Height - Application.GetRealHeight(this.topMargin) - Application.GetRealHeight(this.bottomMargin) - Application.GetRealHeight(heightMaxValue / 2);
             int widthDimensionValue = this.Width - Application.GetRealWidth(this.leftMargin) - Application.GetRealWidth(this.rightMargin) - Application.GetRealHeight(widthMaxValue / 2);
-            for (int i = 0; i <mList.Count; i++)
+            for (int i = 0; i < mList.Count; i++)
             {
                 var keypad = mList[i];
                 Button button = new Button
@@ -292,29 +291,19 @@
                 //涓嶆敮鎸佹寜閿偣鍑昏儗鏅鑹�
                 if (!keypad.isClicked)
                 {
-                    button.Enable = false;
                     button.TextColor = AksCommonMethod.unBackgroundColor;
+
                 }
-                button.MouseDownEventHandler += (sen, e) =>
-                {
-                    
-                    button.IsSelected = true;
 
-                };
-                button.MouseUpOutsideEventHandler += (sen, e) =>
-                {
 
-                    button.IsSelected = false;
-
-                };
                 button.MouseUpEventHandler += (sen, e) =>
                 {
-                    if (button.Tag == null || ((KeypadEntity)button.Tag).keypad == "none")
+                    if (button.Tag == null || ((KeypadEntity)button.Tag).keypad == "none"|| !((KeypadEntity)button.Tag).isClicked)
                     {
                         return;
                     }
                     selectKeyAction?.Invoke((KeypadEntity)button.Tag);
-                    button.IsSelected = false;
+                    SetButtonIsSelected(button);
                 };
 
                 //if (defaultIndex != -1 && defaultIndex == i)

--
Gitblit v1.8.0