From 49bd00c71b223d12f1d85d5c1bae635d450403fd Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 30 Jul 2020 20:15:12 -0700 Subject: Use options instead of fields --- grapher/OptionXY.cs | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 grapher/OptionXY.cs (limited to 'grapher/OptionXY.cs') diff --git a/grapher/OptionXY.cs b/grapher/OptionXY.cs new file mode 100644 index 0000000..c65d1cf --- /dev/null +++ b/grapher/OptionXY.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace grapher +{ + public class OptionXY + { public OptionXY(FieldXY fields, Label label) + { + Fields = fields; + Label = label; + } + + public FieldXY Fields { get; } + + public Label Label { get; } + + public void SetName(string name) + { + Label.Text = name; + Label.Left = Convert.ToInt32((Fields.XField.Box.Left / 2.0) - (Label.Width / 2.0)); + } + + public void Hide() + { + Fields.XField.Box.Hide(); + Fields.YField.Box.Hide(); + Label.Hide(); + } + + public void Show() + { + Fields.XField.Box.Show(); + Fields.YField.Box.Show(); + Label.Show(); + } + + public void Show(string name) + { + SetName(name); + + Fields.XField.Box.Show(); + Fields.YField.Box.Show(); + Label.Show(); + } + + } +} -- cgit v1.2.3