summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-02 01:39:36 -0700
committerJacob Palecki <[email protected]>2020-09-02 01:39:36 -0700
commit66131ff0e469aed0a44ad0fa7179b9cddfb66df5 (patch)
tree6997d7f06f327edb5874f1a8bf1bc16de98b21a0
parentMove optionsets to applyoptions (diff)
downloadrawaccel-66131ff0e469aed0a44ad0fa7179b9cddfb66df5.tar.xz
rawaccel-66131ff0e469aed0a44ad0fa7179b9cddfb66df5.zip
The menus mostly work
-rw-r--r--grapher/Models/AccelGUI.cs2
-rw-r--r--grapher/Models/Options/AccelOptionSet.cs5
-rw-r--r--grapher/Models/Options/ApplyOptions.cs39
3 files changed, 32 insertions, 14 deletions
diff --git a/grapher/Models/AccelGUI.cs b/grapher/Models/AccelGUI.cs
index 6b14672..3a15d48 100644
--- a/grapher/Models/AccelGUI.cs
+++ b/grapher/Models/AccelGUI.cs
@@ -96,6 +96,7 @@ namespace grapher
public void RefreshOnRead()
{
+ AccelCharts.RefreshXY(Settings.RawAccelSettings.AccelerationSettings.combineMagnitudes);
UpdateGraph();
UpdateShownActiveValues();
}
@@ -117,7 +118,6 @@ namespace grapher
Rotation.SetActiveValue(settings.rotation);
ApplyOptions.SetActiveValues(settings);
- AccelCharts.RefreshXY(settings.combineMagnitudes);
}
private void OnScaleMenuItemClick(object sender, EventArgs e)
diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs
index 46b6e3e..b1f85a9 100644
--- a/grapher/Models/Options/AccelOptionSet.cs
+++ b/grapher/Models/Options/AccelOptionSet.cs
@@ -34,6 +34,8 @@ namespace grapher.Models.Options
AccelTypeOptions.ShowFullText();
TitleLabel.Top = TopAnchor;
+ IsTitleMode = true;
+ SetRegularMode();
}
public int TopAnchor { get; }
@@ -71,11 +73,12 @@ namespace grapher.Models.Options
public void SetTitleMode(string title)
{
+ TitleLabel.Text = title;
+
if (!IsTitleMode)
{
IsTitleMode = true;
- TitleLabel.Text = title;
AccelTypeOptions.Left = Acceleration.Field.Left;
AccelTypeOptions.Width = Acceleration.Field.Width;
AccelTypeOptions.ShowShortenedText();
diff --git a/grapher/Models/Options/ApplyOptions.cs b/grapher/Models/Options/ApplyOptions.cs
index 0241fdf..bfbc1ef 100644
--- a/grapher/Models/Options/ApplyOptions.cs
+++ b/grapher/Models/Options/ApplyOptions.cs
@@ -34,10 +34,9 @@ namespace grapher.Models.Options
OptionSetY = optionSetY;
ByComponentVectorXYLock.CheckedChanged += new System.EventHandler(OnByComponentXYLockChecked);
- ByComponentVectorXYLock.Checked = false;
ByComponentVectorXYLock.Checked = true;
- IsWhole = false;
+ EnableWholeApplication();
}
#endregion Constructors
@@ -124,44 +123,60 @@ namespace grapher.Models.Options
public void OnByComponentCheckedChange(object sender, EventArgs e)
{
- if (ByComponentVectorMenuItem.Checked)
- {
- EnableByComponentApplication();
- }
+ EnableByComponentApplication();
+ }
+
+ public void ShowWholeSet()
+ {
+ OptionSetX.SetRegularMode();
+ OptionSetY.Hide();
}
- public void ShowWholeOptionSet()
+ public void ShowByComponentAsOneSet()
{
OptionSetX.SetTitleMode("X = Y");
OptionSetY.Hide();
}
- public void ShowByComponentSets()
+ public void ShowByComponentAsTwoSets()
{
OptionSetX.SetTitleMode("X");
OptionSetY.SetTitleMode("Y");
OptionSetY.Show();
}
- private void OnByComponentXYLockChecked(object sender, EventArgs e)
- {
+ public void ShowByComponentSet()
+ {
if (ByComponentVectorXYLock.Checked)
{
- ShowWholeOptionSet();
+ ShowByComponentAsOneSet();
}
else
{
- ShowByComponentSets();
+ ShowByComponentAsTwoSets();
+ }
+ }
+
+ private void OnByComponentXYLockChecked(object sender, EventArgs e)
+ {
+ if (!IsWhole)
+ {
+ ShowByComponentSet();
}
}
public void EnableWholeApplication()
{
IsWhole = true;
+ ByComponentVectorXYLock.Hide();
+ ShowWholeSet();
}
+
public void EnableByComponentApplication()
{
IsWhole = false;
+ ByComponentVectorXYLock.Show();
+ ShowByComponentSet();
}
#endregion Methods