summaryrefslogtreecommitdiff
path: root/grapher/OptionXY.cs
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-07-30 20:15:12 -0700
committerJacob Palecki <[email protected]>2020-07-30 20:15:12 -0700
commit49bd00c71b223d12f1d85d5c1bae635d450403fd (patch)
treeb8984dcaa28c13c6b5f065cd0e540c1faca55c17 /grapher/OptionXY.cs
parentUse class heirarchy for layout types (diff)
downloadrawaccel-49bd00c71b223d12f1d85d5c1bae635d450403fd.tar.xz
rawaccel-49bd00c71b223d12f1d85d5c1bae635d450403fd.zip
Use options instead of fields
Diffstat (limited to 'grapher/OptionXY.cs')
-rw-r--r--grapher/OptionXY.cs51
1 files changed, 51 insertions, 0 deletions
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();
+ }
+
+ }
+}