diff options
| author | Jacob Palecki <[email protected]> | 2020-07-31 12:20:11 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-07-31 12:20:11 -0700 |
| commit | 6537db04f7e717eda2f21e007cdba7e13b7f559e (patch) | |
| tree | efb65bf3f305f376ea75f4f687b08bf8998c020f /grapher/Layouts/LayoutBase.cs | |
| parent | Add class for storing settings from file (diff) | |
| parent | Merge pull request #6 from a1xd/st-refactor (diff) | |
| download | rawaccel-6537db04f7e717eda2f21e007cdba7e13b7f559e.tar.xz rawaccel-6537db04f7e717eda2f21e007cdba7e13b7f559e.zip | |
Show no settings for off, remove unused class for PR
Diffstat (limited to 'grapher/Layouts/LayoutBase.cs')
| -rw-r--r-- | grapher/Layouts/LayoutBase.cs | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 9c60008..a4d0827 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; namespace grapher.Layouts { @@ -13,11 +14,14 @@ namespace grapher.Layouts public const string Exponent = "Exponent"; public const string Limit = "Limit"; public const string Midpoint = "Midpoint"; + public const string Offset = "Offset"; public LayoutBase() { - Show = new bool[] { false, false, false }; - OptionNames = new string[] { string.Empty, string.Empty, string.Empty }; + ShowOptions = new bool[] { false, false, false, false }; + ShowOptionsXY = new bool[] { true, true }; + OptionNames = new string[] { string.Empty, string.Empty, string.Empty, string.Empty }; + ButtonEnabled = true; } /// <summary> @@ -28,16 +32,20 @@ namespace grapher.Layouts public string Name { get; internal set; } - internal bool[] Show { get; set; } + internal bool[] ShowOptions { get; set; } + + internal bool[] ShowOptionsXY { get; set; } internal string[] OptionNames { get; set; } - public void Layout(Option[] options) + internal bool ButtonEnabled { get; set; } + + public void Layout(Option[] options, OptionXY[] optionsXY, Button button) { // Relies on AccelOptions to keep lengths correct. for (int i = 0; i< options.Length; i++) { - if (Show[i]) + if (ShowOptions[i]) { options[i].Show(OptionNames[i]); } @@ -47,6 +55,20 @@ namespace grapher.Layouts } } + // Relies on AccelOptions to keep lengths correct. + for (int i = 0; i< optionsXY.Length; i++) + { + if (ShowOptionsXY[i]) + { + optionsXY[i].Show(); + } + else + { + optionsXY[i].Hide(); + } + } + + button.Enabled = ButtonEnabled; } } } |