diff options
| author | Jacob Palecki <[email protected]> | 2020-09-01 02:39:09 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-01 02:39:09 -0700 |
| commit | 4aa2f3ed741dcbd39233e125a34cac8163267d8d (patch) | |
| tree | 59399d8d793e7aa35c3a79fe369d19f7c3935ae4 /grapher/Models/Fields/FieldXY.cs | |
| parent | Add constants class and separate classes into regions (diff) | |
| download | rawaccel-4aa2f3ed741dcbd39233e125a34cac8163267d8d.tar.xz rawaccel-4aa2f3ed741dcbd39233e125a34cac8163267d8d.zip | |
Move constants to central class
Diffstat (limited to 'grapher/Models/Fields/FieldXY.cs')
| -rw-r--r-- | grapher/Models/Fields/FieldXY.cs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/grapher/Models/Fields/FieldXY.cs b/grapher/Models/Fields/FieldXY.cs index 83f6434..826be27 100644 --- a/grapher/Models/Fields/FieldXY.cs +++ b/grapher/Models/Fields/FieldXY.cs @@ -9,31 +9,23 @@ namespace grapher { public class FieldXY { - #region Constants - - public const int DefaultSeparation = 4; - - public const string ShortenedFormatString = "0.###"; - - #endregion Constants - #region Constructors public FieldXY(TextBox xBox, TextBox yBox, CheckBox lockCheckBox, Form containingForm, double defaultData) { XField = new Field(xBox, containingForm, defaultData); YField = new Field(yBox, containingForm, defaultData); - YField.FormatString = ShortenedFormatString; + YField.FormatString = Constants.ShortenedFormatString; LockCheckBox = lockCheckBox; LockCheckBox.CheckedChanged += new System.EventHandler(CheckChanged); - XField.Box.Width = (YField.Box.Left + YField.Box.Width - XField.Box.Left - DefaultSeparation) / 2; + XField.Box.Width = (YField.Box.Left + YField.Box.Width - XField.Box.Left - Constants.DefaultFieldSeparation) / 2; YField.Box.Width = XField.Box.Width; DefaultWidthX = XField.Box.Width; DefaultWidthY = YField.Box.Width; - YField.Box.Left = XField.Box.Left + XField.Box.Width + DefaultSeparation; + YField.Box.Left = XField.Box.Left + XField.Box.Width + Constants.DefaultFieldSeparation; CombinedWidth = DefaultWidthX + DefaultWidthY + YField.Box.Left - (XField.Box.Left + DefaultWidthX); SetCombined(); @@ -99,7 +91,7 @@ namespace grapher YField.SetToUnavailable(); YField.Box.Hide(); XField.Box.Width = CombinedWidth; - XField.FormatString = Field.DefaultFormatString; + XField.FormatString = Constants.DefaultFieldFormatString; } public void SetSeparate() @@ -109,7 +101,7 @@ namespace grapher XField.Box.Width = DefaultWidthX; YField.Box.Width = DefaultWidthY; - XField.FormatString = ShortenedFormatString; + XField.FormatString = Constants.ShortenedFormatString; if (XField.State == Field.FieldState.Default) { |