diff options
| author | Jacob Palecki <[email protected]> | 2020-08-12 18:18:34 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-08-12 18:18:34 -0700 |
| commit | ae18a1a06060ef66d317af521032ac22fcd88eb3 (patch) | |
| tree | a5eb5c07257c83061bf2f6506779120c2f550f34 /grapher/Field.cs | |
| parent | Nicer decimals, enter press not needed to enter values (diff) | |
| download | rawaccel-ae18a1a06060ef66d317af521032ac22fcd88eb3.tar.xz rawaccel-ae18a1a06060ef66d317af521032ac22fcd88eb3.zip | |
Fixed some edge cases around not using enter
Diffstat (limited to 'grapher/Field.cs')
| -rw-r--r-- | grapher/Field.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/grapher/Field.cs b/grapher/Field.cs index d34472b..8d75172 100644 --- a/grapher/Field.cs +++ b/grapher/Field.cs @@ -12,7 +12,7 @@ namespace grapher { #region Constants - public const string DefaultFormatString = "#.#########"; + public const string DefaultFormatString = "0.#########"; #endregion Constants @@ -173,7 +173,6 @@ namespace grapher if (State == FieldState.Typing) { TextToData(); - SetToEntered(); } } @@ -185,8 +184,6 @@ namespace grapher e.Handled = true; e.SuppressKeyPress = true; - - SetToEntered(); } else if (e.KeyCode == Keys.Escape) { @@ -207,6 +204,15 @@ namespace grapher } Box.Text = DecimalString(Data); + + if (string.Equals(Box.Text, DefaultText)) + { + SetToDefault(); + } + else + { + SetToEntered(); + } } private string DecimalString(double value) |