Exemplo n.º 1
0
        public static bool InputPasswordDialog(ref string value, bool checkEmpty = true, string desc = "请输入密码:", UIStyle style = UIStyle.Blue, bool topMost = 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;
            frm.ShowDialog();
            if (frm.IsOK)
            {
                value = frm.Editor.Text;
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public static bool InputIntegerDialog(ref int value, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue, bool topMost = 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;
            frm.ShowDialog();
            if (frm.IsOK)
            {
                value = frm.Editor.IntValue;
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
        private static bool InputDoubleDialog(ref double value, int decimals = 2, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue)
        {
            UIInputForm frm = new UIInputForm();

            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.ShowDialog();
            if (frm.IsOK)
            {
                value = frm.Editor.IntValue;
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        private static bool InputIntegerDialog(ref int value, int minimum, int maximum, bool checkEmpty = true, string desc = "请输入数字:", UIStyle style = UIStyle.Blue)
        {
            UIInputForm frm = new UIInputForm();

            frm.Style             = style;
            frm.Editor.Type       = UITextBox.UIEditType.Integer;
            frm.Editor.IntValue   = value;
            frm.Text              = UILocalize.InputTitle;
            frm.Label.Text        = desc;
            frm.CheckInputEmpty   = checkEmpty;
            frm.Editor.MaxLength  = 11;
            frm.Editor.Minimum    = minimum;
            frm.Editor.Maximum    = maximum;
            frm.Editor.HasMaximum = true;
            frm.Editor.HasMinimum = true;
            frm.ShowDialog();
            if (frm.IsOK)
            {
                value = frm.Editor.IntValue;
                return(true);
            }

            return(false);
        }