From eda3fb873e59544ff36301b51e05aef64f87b0f9 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期五, 27 八月 2021 13:21:21 +0800
Subject: [PATCH] Merge branch 'newBranch1' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into newBranch1

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs |  172 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 147 insertions(+), 25 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
index 4bf15c4..c842a69 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
@@ -26,7 +26,7 @@
         /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
         /// <param name="List">琚绱㈠垪琛�</param>
         /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
-        public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, int errorId_PresenceP, List<string> List, Action<string> confirmAction)
+        public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, int errorId_PresenceP, List<string> List, Action<string,Dialog> confirmAction, Action action,bool tag=true)
         {
             Dialog dialog = new Dialog()
             {
@@ -145,6 +145,8 @@
             btnCancel.MouseUpEventHandler += (sender, e) =>
             {
                 dialog.Close();
+                action();
+
             };
             Button btnTip = new Button
             {
@@ -186,8 +188,10 @@
                 }
 
 
-                confirmAction(editText.Text.Trim());
-                dialog.Close();
+                confirmAction(editText.Text.Trim(),dialog);
+                if (tag) {
+                    dialog.Close();
+                }
             };
 
         }
@@ -199,7 +203,7 @@
         /// <param name="tnputEditTxet">鏄剧ず鏂囨湰</param>
         /// <param name="errorId_IsNullOrEmpty">杈撳叆妗嗘湰鏂囦负绌鸿嚜瀹氫箟鎻愮ず閿欒鏂囨湰</param>
         /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
-        public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, Action<string> confirmAction)
+        public void InputBox(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, Action<string> confirmAction,Action action)
         {
             Dialog dialog = new Dialog()
             {
@@ -318,6 +322,8 @@
             btnCancel.MouseUpEventHandler += (sender, e) =>
             {
                 dialog.Close();
+                action();
+
             };
 
             Button btnTip = new Button
@@ -361,9 +367,8 @@
         /// </summary>
         /// <param name="titleId">鏍囬鏂囨湰</param>
         /// <param name="tnputEditTxet">鏄剧ず鏂囨湰</param>
-        /// <param name="errorId_IsNullOrEmpty">杈撳叆妗嗘湰鏂囦负绌鸿嚜瀹氫箟鎻愮ず閿欒鏂囨湰</param>
         /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
-        public void InputBox1(int titleId, string tnputEditTxet, int errorId_IsNullOrEmpty, Action<string> confirmAction)
+        public void InputBox(int titleId, string tnputEditTxet, Action<string> confirmAction)
         {
             Dialog dialog = new Dialog()
             {
@@ -425,13 +430,7 @@
                 IsNumberKeyboardType=true,
             };
             editBjView.AddChidren(editText);
-
-            editText.MouseUpEventHandler += (sen, e) =>
-            {
-                if (!editText.Foucs)
-                    editText.Foucs = true;
-
-            };
+         
             Button btn_subtract = new Button
             {
                 X = Application.GetRealWidth(17),
@@ -452,27 +451,29 @@
             whiteView.AddChidren(btn_add);
             btn_subtract.MouseUpEventHandler += (sender, e) =>
             {
+                
                 string editTextValue = editText.Text;
                 if (!string.IsNullOrEmpty(editTextValue))
                 {
                     int intValue = int.Parse(editTextValue);
-                    if (intValue - 1 >= 0)
+                    if (intValue>1)
                     {
                         editText.Text = (intValue - 1).ToString();
-                        editText.Foucs = false;
+                       
                     }
                 }
+               
             };
             btn_add.MouseUpEventHandler += (sender, e) =>
             {
+                
                 string editTextValue = editText.Text;
                 if (!string.IsNullOrEmpty(editTextValue))
                 {
                     int intValue = int.Parse(editTextValue);
-                    if (intValue - 1 <= 100)
+                    if (intValue <100)
                     {
                         editText.Text = (intValue + 1).ToString();
-                        editText.Foucs = false;
                     }
                 }
             };
@@ -529,9 +530,22 @@
 
             btnConfirm.MouseUpEventHandler += (sender, e) =>
             {
+                string errorId_IsNullOrEmpty = "";
                 if (string.IsNullOrEmpty(editText.Text.Trim()))
                 {
-
+                    errorId_IsNullOrEmpty = Language.StringByID(StringId.nullvalue);
+                }
+                else
+                {
+                    var editTextValue = editText.Text.Trim();
+                    int intValue = int.Parse(editTextValue);
+                    if (intValue <= 0 || intValue > 100)
+                    {
+                        errorId_IsNullOrEmpty = Language.StringByID(StringId.setvalue);
+                    }
+                }
+                if (errorId_IsNullOrEmpty!="")
+                {
                     whiteView.Height = Application.GetRealHeight(183);
                     btnLine.Y = whiteView.Height - Application.GetRealHeight(44 + 1);
                     btnCancel.Y = btnLine.Bottom;
@@ -539,17 +553,17 @@
                     btnConfirm.Y = btnLine.Bottom;
                     btnConfirm.Gravity = Gravity.BottomRight;
 
-                    btnTip.X = Application.GetRealWidth(24);
+                    btnTip.X = Application.GetRealWidth(53);
                     btnTip.Y = editBjView.Bottom + Application.GetRealHeight(12);
-                    btnTip.Width = Application.GetRealWidth(222);
-                    btnTip.Height = Application.GetRealHeight(17);
-                    btnTip.Text = Language.StringByID(errorId_IsNullOrEmpty);
+                    btnTip.Width = Application.GetRealWidth(157);//200
+                    btnTip.Height = Application.GetRealHeight(24);//17
+                    btnTip.Text = errorId_IsNullOrEmpty;
                     btnTip.TextColor = CSS_Color.textRedColor;
                     btnTip.TextSize = TextSize.text12;
                     btnTip.TextAlignment = TextAlignment.CenterLeft;
+                    btnTip.IsMoreLines = true;
                     return;
                 }
-
 
                 confirmAction(editText.Text.Trim());
                 dialog.Close();
@@ -665,6 +679,114 @@
         /// 纭畾鎻愮ず妗�
         /// </summary>
         /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="tipTxet">鑷畾涔夋彁绀烘枃鏈�</param>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        public void TipBox(int titleId, string tipTxet, Action<Dialog> confirmAction,Action action,bool tag=true)
+        {
+            Dialog dialog = new Dialog()
+            {
+                BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
+            };
+
+            FrameLayout whiteView = new FrameLayout()
+            {
+                //Gravity = Gravity.Center,
+                X = Application.GetRealWidth(53),
+                Y = Application.GetRealHeight(264),
+                Width = Application.GetRealWidth(270),
+                Height = Application.GetRealHeight(140),
+                BackgroundColor = CSS_Color.view,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            dialog.AddChidren(whiteView);
+
+            Button titleBtn = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                X = Application.GetRealWidth(35),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(270 - 35 * 2),
+                TextColor = CSS_Color.textConfirmColor,
+                TextSize = TextSize.text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = titleId,
+            };
+            whiteView.AddChidren(titleBtn);
+
+            Button tipBtn = new Button()
+            {
+                Y = titleBtn.Bottom + Application.GetRealHeight(8),
+                X = Application.GetRealWidth(20),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(270 - 20 * 2),
+                TextColor = CSS_Color.textTipColor,
+                TextSize = TextSize.text12,
+                TextAlignment = TextAlignment.Center,
+                Text= tipTxet,
+            };
+            whiteView.AddChidren(tipBtn);
+
+
+            Button btnLine = new Button()
+            {
+                Y = whiteView.Height - Application.GetRealHeight(44 + 1),
+                Height = Application.GetRealHeight(1),
+                BackgroundColor = CSS_Color.viewLine,
+            };
+            whiteView.AddChidren(btnLine);
+
+            Button btnCancel = new Button()
+            {
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.textTipColor,
+                TextSize = TextSize.text16,
+                TextID = StringId.cancelMusic,
+                Gravity = Gravity.BottomLeft,
+            };
+            whiteView.AddChidren(btnCancel);
+            btnCancel.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomLeft);
+            Button btnConfirm = new Button()
+            {
+                X = btnCancel.Right,
+                Y = btnLine.Bottom,
+                Width = Application.GetRealWidth(135),
+                Height = Application.GetRealHeight(44),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.view,
+                IsBold = true,
+                TextSize = TextSize.text16,
+                TextID = StringId.confirmMusic,
+                BackgroundColor = CSS_Color.textConfirmColor,
+                Gravity = Gravity.BottomRight,
+            };
+            whiteView.AddChidren(btnConfirm);
+            btnConfirm.SetCornerWithSameRadius(Application.GetRealHeight(RradiusFrameLayout), HDLUtils.RectCornerBottomRight);
+            dialog.Show();
+            btnCancel.MouseUpEventHandler += (sender, e) =>
+            {
+                action();
+                dialog.Close();
+            };
+
+            btnConfirm.MouseUpEventHandler += (sender, e) =>
+            {
+                confirmAction(dialog);
+                if (tag) {
+                    dialog.Close();
+                }
+            };
+
+        }
+
+        /// <summary>
+        /// 纭畾鎻愮ず妗�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
         /// <param name="tipTxet">鑷畾涔夋彁绀烘枃鏈�(鎹㈣)</param>
         /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
         public void TipBox1(int titleId, int tipTxet, Action confirmAction)
@@ -771,9 +893,9 @@
         /// 淇℃伅鎻愮ず绐楀彛锛岃嚜鍔ㄥ叧闂�
         /// </summary>
         /// <param name="msg">鎻愮ず閿欒鏂囨湰</param>
-        public void FlashingBox(string msg)
+        public void FlashingBox(string msg,int time=2)
         {
-            new PublicAssmebly().TipMsgAutoClose(msg, false, 2000);
+            new PublicAssmebly().TipMsgAutoClose(msg, false, time*1000);
         }
 
         /// <summary>

--
Gitblit v1.8.0