From 2be0106211cb4ce30036fc0c8e84ae70dff68c87 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 8 Oct 2020 02:07:56 -0400 Subject: add toggle button + save gui settings on close remove option to disable write on startup --- grapher/Models/Charts/AccelCharts.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grapher/Models/Charts/AccelCharts.cs') diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 7484a3a..9087b30 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -133,14 +133,14 @@ namespace grapher { ChartState.SetWidened(); UpdateFormWidth(); - AlignWriteButton(); + //AlignWriteButton(); } public void SetNarrowed() { ChartState.SetNarrowed(); UpdateFormWidth(); - AlignWriteButton(); + //AlignWriteButton(); } public void Redraw() -- cgit v1.2.3 From 37d2cb7d3ed25862683ef807712c7d50f71e8493 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 8 Oct 2020 02:08:27 -0400 Subject: add scroll to charts --- grapher/Models/Charts/AccelCharts.cs | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) (limited to 'grapher/Models/Charts/AccelCharts.cs') diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs index 9087b30..6247811 100644 --- a/grapher/Models/Charts/AccelCharts.cs +++ b/grapher/Models/Charts/AccelCharts.cs @@ -13,7 +13,7 @@ namespace grapher #region Constructors public AccelCharts( - Form form, + RawAcceleration form, ChartXY sensitivityChart, ChartXY velocityChart, ChartXY gainChart, @@ -34,10 +34,6 @@ namespace grapher EnableLastValue = enableLastMouseMove; WriteButton = writeButton; - - Rectangle screenRectangle = ContainingForm.RectangleToScreen(ContainingForm.ClientRectangle); - FormBorderHeight = screenRectangle.Top - ContainingForm.Top; - EnableVelocityAndGain.Click += new System.EventHandler(OnEnableClick); EnableVelocityAndGain.CheckedChanged += new System.EventHandler(OnEnableVelocityGainCheckStateChange); @@ -52,7 +48,7 @@ namespace grapher #region Properties - public Form ContainingForm { get; } + public RawAcceleration ContainingForm { get; } public ToolStripMenuItem EnableVelocityAndGain { get; } @@ -125,23 +121,9 @@ namespace grapher { ChartState = ChartStateManager.DetermineState(driverSettings); ChartState.Activate(); - UpdateFormWidth(); Bind(); } - public void SetWidened() - { - ChartState.SetWidened(); - UpdateFormWidth(); - //AlignWriteButton(); - } - - public void SetNarrowed() - { - ChartState.SetNarrowed(); - UpdateFormWidth(); - //AlignWriteButton(); - } public void Redraw() { @@ -176,8 +158,6 @@ namespace grapher velocityChart.SetTop(sensitivityChart.Height + Constants.ChartSeparationVertical); gainChart.SetHeight(sensitivityChart.Height); gainChart.SetTop(velocityChart.Top + velocityChart.Height + Constants.ChartSeparationVertical); - - sensitivityChart.Show(); } private void OnEnableClick(object sender, EventArgs e) @@ -187,6 +167,7 @@ namespace grapher private void OnEnableVelocityGainCheckStateChange(object sender, EventArgs e) { + ContainingForm.ResetAutoScroll(); if (EnableVelocityAndGain.Checked) { ShowVelocityAndGain(); @@ -207,17 +188,12 @@ namespace grapher private void ShowVelocityAndGain() { - ChartState.ShowVelocityAndGain(ContainingForm, FormBorderHeight); + ChartState.ShowVelocityAndGain(); } private void HideVelocityAndGain() { - ChartState.HideVelocityAndGain(ContainingForm, FormBorderHeight); - } - - private void UpdateFormWidth() - { - ContainingForm.Width = ChartState.SensitivityChart.Left + ChartState.SensitivityChart.Width; + ChartState.HideVelocityAndGain(); } private void AlignWriteButton() -- cgit v1.2.3