public string ToStringRange(KeypadSettings settings)
        {
            var min       = settings.Min;
            var max       = settings.Max;
            var dps       = settings.Dps ?? 0;
            var dpsFormat = "F" + dps;
            var builder   = new StringBuilder();

            if (min.HasValue == true || max.HasValue == true)
            {
                if (min.HasValue == true)
                {
                    builder.Append(settings.Min.Value.ToString(dpsFormat)).Append(" ≤ ");
                }

                builder.Append("값");

                if (max.HasValue == true)
                {
                    builder.Append(" ≤ ").Append(settings.Max.Value.ToString(dpsFormat));
                }
            }

            return(builder.ToString());
        }
Exemple #2
0
 public KeypadSettings(KeypadSettings other)
 {
     this.Type       = other.Type;
     this.Title      = other.Title;
     this.Min        = other.Min;
     this.Max        = other.Max;
     this.Dps        = other.Dps;
     this.MaxLength  = this.MaxLength;
     this.Validating = other.Validating;
 }
Exemple #3
0
        public KeypadBase(KeypadSettings settings)
        {
            this.Settings = settings;

            this.SuspendLayout();

            this.TopMost       = true;
            this.StartPosition = FormStartPosition.CenterParent;
            this.Font          = this.FontManager[14.0F, FontStyle.Regular];

            this.Text = settings.Title;

            this.CommitButton        = new OptimizedButton();
            this.CommitButton.Text   = "=";
            this.CommitButton.Click += this.OnCommitButtonClick;
            this.Controls.Add(this.CommitButton);

            this.ResumeLayout(false);
        }
        public KeypadNumber(KeypadSettings settings)
            : base(settings)
        {
            this.SuspendLayout();

            var buttonFont = this.FontManager[16.0F, FontStyle.Regular];

            var rangeLabel = this.RangeLabel = new Label();

            rangeLabel.TextAlign = ContentAlignment.MiddleRight;
            this.Controls.Add(rangeLabel);

            var textBox = this.TextBox = new TextBox();

            textBox.Font         = this.FontManager[16.0F, FontStyle.Regular];
            textBox.TextAlign    = HorizontalAlignment.Right;
            textBox.TextChanged += this.OnTextBoxTextChanged;
            this.Controls.Add(textBox);

            var errorLabel = this.ErrorLabel = new Label();

            errorLabel.TextAlign = ContentAlignment.MiddleRight;
            this.Controls.Add(errorLabel);

            this.NumberButtons = new OptimizedButton[10];

            for (int i = 0; i < this.NumberButtons.Length; ++i)
            {
                var button = this.NumberButtons[i] = new OptimizedButton();
                button.Size   = new Size(46, 44);
                button.Text   = i.ToString();
                button.Tag    = i;
                button.Font   = buttonFont;
                button.Click += this.OnNumberButtonClick;
                this.Controls.Add(button);
            }

            var backspaceButton = this.BackspaceButton = new OptimizedButton();

            backspaceButton.Text   = "<-";
            backspaceButton.Font   = buttonFont;
            backspaceButton.Click += this.OnBackspaceButtonClick;
            this.Controls.Add(backspaceButton);

            var clearButton = this.ClearButton = new OptimizedButton();

            clearButton.Text   = "C";
            clearButton.Font   = buttonFont;
            clearButton.Click += this.OnClearButtonClick;
            this.Controls.Add(clearButton);

            var dotButton = this.DotButton = new OptimizedButton();

            dotButton.Text   = ".";
            dotButton.Font   = buttonFont;
            dotButton.Click += this.OnDotButtonClick;
            this.Controls.Add(dotButton);

            var invertButton = this.InvertButton = new OptimizedButton();

            invertButton.Text   = "±";
            invertButton.Font   = buttonFont;
            invertButton.Click += this.OnInvertButtonClick;
            this.Controls.Add(invertButton);

            this.ResumeLayout(false);

            this.ClientSize = this.GetPreferredSize(new Size(300, 300));
        }
Exemple #5
0
 public KeypadValidateEventArgs(KeypadSettings settings, KeypadParseResult processing, string text)
 {
     this.Settings   = settings;
     this.Processing = processing;
     this.Text       = text;
 }