summaryrefslogtreecommitdiff
path: root/grapher/Models/Fields
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-01 02:39:09 -0700
committerJacob Palecki <[email protected]>2020-09-01 02:39:09 -0700
commit4aa2f3ed741dcbd39233e125a34cac8163267d8d (patch)
tree59399d8d793e7aa35c3a79fe369d19f7c3935ae4 /grapher/Models/Fields
parentAdd constants class and separate classes into regions (diff)
downloadrawaccel-4aa2f3ed741dcbd39233e125a34cac8163267d8d.tar.xz
rawaccel-4aa2f3ed741dcbd39233e125a34cac8163267d8d.zip
Move constants to central class
Diffstat (limited to 'grapher/Models/Fields')
-rw-r--r--grapher/Models/Fields/Field.cs8
-rw-r--r--grapher/Models/Fields/FieldXY.cs18
2 files changed, 6 insertions, 20 deletions
diff --git a/grapher/Models/Fields/Field.cs b/grapher/Models/Fields/Field.cs
index 03693ed..7651a37 100644
--- a/grapher/Models/Fields/Field.cs
+++ b/grapher/Models/Fields/Field.cs
@@ -10,12 +10,6 @@ namespace grapher
{
public class Field
{
- #region Constants
-
- public const string DefaultFormatString = "0.#########";
-
- #endregion Constants
-
#region Enumerations
public enum FieldState
@@ -39,7 +33,7 @@ namespace grapher
DefaultData = defaultData;
State = FieldState.Undefined;
ContainingForm = containingForm;
- FormatString = DefaultFormatString;
+ FormatString = Constants.DefaultFieldFormatString;
box.KeyDown += new System.Windows.Forms.KeyEventHandler(KeyDown);
box.Leave += new System.EventHandler(FocusLeave);
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)
{