public static bool InputIntegerDialog(ref int value, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false) { UIInputForm frm = new UIInputForm(); frm.TopMost = topMost; frm.Style = style; frm.Editor.Type = UITextBox.UIEditType.Integer; frm.Editor.IntValue = value; frm.Text = UILocalize.InputTitle; frm.Label.Text = desc; frm.CheckInputEmpty = checkEmpty; if (showMask) { frm.ShowDialogWithMask(); } else { frm.ShowDialog(); } if (frm.IsOK) { value = frm.Editor.IntValue; return(true); } return(false); }
public static bool InputDoubleDialog(ref double value, double minimum, double maximum, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false) { UIInputForm frm = new UIInputForm(); frm.TopMost = topMost; frm.Style = style; frm.Editor.Type = UITextBox.UIEditType.Double; frm.Editor.DecLength = decimals; frm.Editor.DoubleValue = value; frm.Text = UILocalize.InputTitle; frm.Label.Text = desc; frm.CheckInputEmpty = checkEmpty; frm.Editor.Minimum = minimum; frm.Editor.Maximum = maximum; frm.Editor.HasMaximum = true; frm.Editor.HasMinimum = true; if (showMask) { frm.ShowDialogWithMask(); } else { frm.ShowDialog(); } if (frm.IsOK) { value = frm.Editor.DoubleValue; return(true); } return(false); }
public static bool InputPasswordDialog(ref string value, bool checkEmpty = true, string desc = "请输入密码:", UIStyle style = UIStyle.Blue, bool topMost = false, bool showMask = false) { UIInputForm frm = new UIInputForm(); frm.TopMost = topMost; frm.Style = style; frm.Text = UILocalize.InputTitle; frm.Label.Text = desc; frm.Editor.PasswordChar = '*'; frm.CheckInputEmpty = checkEmpty; if (showMask) { frm.ShowDialogWithMask(); } else { frm.ShowDialog(); } if (frm.IsOK) { value = frm.Editor.Text; return(true); } return(false); }