From 330e3ae4cdd1e9facb14b6ea2b3e609166c04fd3 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 12 一月 2021 16:00:27 +0800
Subject: [PATCH] 2021-1-12-1

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs |   43 +++++++++++++++++++++++++------------------
 1 files changed, 25 insertions(+), 18 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..227b2e0 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
@@ -361,9 +361,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 +424,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 +445,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 +524,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 +547,16 @@
                     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.Width = Application.GetRealWidth(200);
                     btnTip.Height = Application.GetRealHeight(17);
-                    btnTip.Text = Language.StringByID(errorId_IsNullOrEmpty);
+                    btnTip.Text = errorId_IsNullOrEmpty;
                     btnTip.TextColor = CSS_Color.textRedColor;
                     btnTip.TextSize = TextSize.text12;
                     btnTip.TextAlignment = TextAlignment.CenterLeft;
                     return;
                 }
-
 
                 confirmAction(editText.Text.Trim());
                 dialog.Close();

--
Gitblit v1.8.0