From d987694e57c3bce76bd5a208d74a3696db222a4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 14 一月 2021 14:00:06 +0800
Subject: [PATCH] Merge branch 'WJC' into NewFilePath

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs |  207 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 207 insertions(+), 0 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
old mode 100755
new mode 100644
index 53bec95..227b2e0
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/TipPopView.cs
@@ -260,6 +260,7 @@
                 TextAlignment = TextAlignment.CenterLeft,
             };
             editBjView.AddChidren(editText);
+            
 
             Button clearIconBtn = new Button
             {
@@ -355,7 +356,213 @@
 
         }
 
+        /// <summary>
+        /// 杈撳叆妗�
+        /// </summary>
+        /// <param name="titleId">鏍囬鏂囨湰</param>
+        /// <param name="tnputEditTxet">鏄剧ず鏂囨湰</param>
+        /// <param name="confirmAction">鍥炶皟鍑芥暟</param>
+        public void InputBox(int titleId, string tnputEditTxet, Action<string> confirmAction)
+        {
+            Dialog dialog = new Dialog()
+            {
+                BackgroundColor = 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(172),
+                BackgroundColor = CSS_Color.view,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(RradiusFrameLayout),
+            };
+            dialog.AddChidren(whiteView);
+
+            Button btnTitle = new Button()
+            {
+                Y = Application.GetRealHeight(20),
+                X = Application.GetRealWidth(35),
+                Height = Application.GetRealHeight(22),
+                Width = Application.GetRealWidth(200),
+                TextColor = CSS_Color.textConfirmColor,
+                TextSize = TextSize.text16,
+                TextAlignment = TextAlignment.Center,
+                TextID = titleId,
+
+            };
+            whiteView.AddChidren(btnTitle);
+
+            FrameLayout editBjView = new FrameLayout()
+            {
+                // Gravity = Gravity.CenterHorizontal,
+                Y = btnTitle.Bottom + Application.GetRealHeight(16),
+                X = Application.GetRealWidth(53),
+                Width = Application.GetRealWidth(157),
+                Height = Application.GetRealHeight(40),
+                BackgroundColor = CSS_Color.viewMiddle,
+                BorderColor = CSS_Color.viewTranslucence,
+                BorderWidth = 0,
+                Radius = (uint)Application.GetRealHeight(radiusEditFrameLayout),
+            };
+            whiteView.AddChidren(editBjView);
+
+            EditText editText = new EditText()
+            {
+               // X = Application.GetRealWidth(12),
+                Y = Application.GetRealHeight(10),
+                Width = Application.GetRealWidth(157),
+                Height = Application.GetRealHeight(20),
+                Text = tnputEditTxet,
+                TextColor = CSS_Color.textColor,
+                TextSize = TextSize.text14,
+                TextAlignment = TextAlignment.Center,
+                IsNumberKeyboardType=true,
+            };
+            editBjView.AddChidren(editText);
+         
+            Button btn_subtract = new Button
+            {
+                X = Application.GetRealWidth(17),
+                Y = Application.GetRealHeight(66),
+                Width = Application.GetRealWidth(24),
+                Height = Application.GetRealWidth(24),
+                UnSelectedImagePath = "LogicIcon/-.png",
+            };
+            whiteView.AddChidren(btn_subtract);
+            Button btn_add = new Button
+            {
+                X = Application.GetRealWidth(222),
+                Y = Application.GetRealHeight(66),
+                Width = Application.GetRealWidth(24),
+                Height = Application.GetRealWidth(24),
+                UnSelectedImagePath = "LogicIcon/+.png",
+            };
+            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)
+                    {
+                        editText.Text = (intValue - 1).ToString();
+                       
+                    }
+                }
+               
+            };
+            btn_add.MouseUpEventHandler += (sender, e) =>
+            {
+                
+                string editTextValue = editText.Text;
+                if (!string.IsNullOrEmpty(editTextValue))
+                {
+                    int intValue = int.Parse(editTextValue);
+                    if (intValue <100)
+                    {
+                        editText.Text = (intValue + 1).ToString();
+                    }
+                }
+            };
+
+            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) =>
+            {
+                dialog.Close();
+            };
+
+            Button btnTip = new Button
+            {
+                Width = Application.GetRealWidth(0),
+            };
+            whiteView.AddChidren(btnTip);//涓�鐩撮敊璇紝涓�鐩寸寷鐐癸紝涓�鐩村姞鎺т欢
+
+            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;
+                    btnCancel.Gravity = Gravity.BottomLeft;
+                    btnConfirm.Y = btnLine.Bottom;
+                    btnConfirm.Gravity = Gravity.BottomRight;
+
+                    btnTip.X = Application.GetRealWidth(53);
+                    btnTip.Y = editBjView.Bottom + Application.GetRealHeight(12);
+                    btnTip.Width = Application.GetRealWidth(200);
+                    btnTip.Height = Application.GetRealHeight(17);
+                    btnTip.Text = errorId_IsNullOrEmpty;
+                    btnTip.TextColor = CSS_Color.textRedColor;
+                    btnTip.TextSize = TextSize.text12;
+                    btnTip.TextAlignment = TextAlignment.CenterLeft;
+                    return;
+                }
+
+                confirmAction(editText.Text.Trim());
+                dialog.Close();
+            };
+
+        }
         /// <summary>
         /// 纭畾鎻愮ず妗�
         /// </summary>

--
Gitblit v1.8.0