예제 #1
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);
        }
예제 #2
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);
        }