diff options
| author | JacobPalecki <[email protected]> | 2020-09-08 16:00:05 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-08 16:00:05 -0700 |
| commit | e5461fa84e65d78823d0022339fa2d8864f7e63c (patch) | |
| tree | b486ef524c93bfeb29a86403114b6805bf9decf1 /grapher/Models/Options/AccelOptionSet.cs | |
| parent | Merge pull request #19 from JacobPalecki/gainOffset (diff) | |
| parent | Save show last mouse value (diff) | |
| download | rawaccel-e5461fa84e65d78823d0022339fa2d8864f7e63c.tar.xz rawaccel-e5461fa84e65d78823d0022339fa2d8864f7e63c.zip | |
Merge pull request #20 from JacobPalecki/GUI
GUI: Add By Component & Anisotropy; Remove Logarithm and Sigmoid; Delete Console; Some Refactoring
Diffstat (limited to 'grapher/Models/Options/AccelOptionSet.cs')
| -rw-r--r-- | grapher/Models/Options/AccelOptionSet.cs | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs new file mode 100644 index 0000000..bc0d368 --- /dev/null +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -0,0 +1,117 @@ +using grapher.Models.Serialized; +using System.Drawing; +using System.Windows.Forms; + +namespace grapher.Models.Options +{ + public class AccelOptionSet + { + public AccelOptionSet( + Label title, + Label activeValuesTitle, + int topAnchor, + AccelTypeOptions accelTypeOptions) + { + OptionsTitle = title; + ActiveValuesTitle = activeValuesTitle; + TopAnchor = topAnchor; + Options = accelTypeOptions; + + ActiveValuesTitle.AutoSize = false; + ActiveValuesTitle.TextAlign = ContentAlignment.MiddleCenter; + + Options.ShowFull(); + + OptionsTitle.Top = TopAnchor; + IsTitleMode = true; + SetRegularMode(); + } + + public int TopAnchor { get; } + + public Label OptionsTitle { get; } + + public Label ActiveValuesTitle { get; } + + public AccelTypeOptions Options { get; } + + + public bool IsTitleMode { get; private set; } + + public void SetRegularMode() + { + if (IsTitleMode) + { + IsTitleMode = false; + + HideTitle(); + Options.ShowFull(); + } + } + + public void SetTitleMode(string title) + { + OptionsTitle.Text = title; + + if (!IsTitleMode) + { + IsTitleMode = true; + + Options.ShowShortened(); + DisplayTitle(); + } + } + + public void Hide() + { + OptionsTitle.Hide(); + ActiveValuesTitle.Hide(); + Options.Hide(); + } + + public void Show() + { + if (IsTitleMode) + { + OptionsTitle.Show(); + } + + ActiveValuesTitle.Show(); + Options.Show(); + } + + public void DisplayTitle() + { + OptionsTitle.Show(); + + Options.Top = OptionsTitle.Top + OptionsTitle.Height + Constants.OptionVerticalSeperation; + } + + public void HideTitle() + { + OptionsTitle.Hide(); + + Options.Top = TopAnchor; + } + + public void SetArgs(ref AccelArgs args) + { + Options.SetArgs(ref args); + } + + public AccelArgs GenerateArgs() + { + return Options.GenerateArgs(); + } + + public void SetActiveValues(int mode, AccelArgs args) + { + Options.SetActiveValues(mode, args); + } + + public void AlignActiveValues() + { + Options.AlignActiveValues(); + } + } +} |