summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2020-09-08 14:29:37 -0700
committerJacob Palecki <[email protected]>2020-09-08 14:29:37 -0700
commitae8ee86fdaac66815827e132493c8bfcc5fbf8c9 (patch)
tree516dc3d36ebbc5e547837e6756182ab583d8a32c
parentSet WriteButton vertical placement (diff)
downloadrawaccel-ae8ee86fdaac66815827e132493c8bfcc5fbf8c9.tar.xz
rawaccel-ae8ee86fdaac66815827e132493c8bfcc5fbf8c9.zip
Center write button
-rw-r--r--grapher/Models/AccelGUIFactory.cs3
-rw-r--r--grapher/Models/Charts/AccelCharts.cs13
2 files changed, 14 insertions, 2 deletions
diff --git a/grapher/Models/AccelGUIFactory.cs b/grapher/Models/AccelGUIFactory.cs
index 35d2869..a381192 100644
--- a/grapher/Models/AccelGUIFactory.cs
+++ b/grapher/Models/AccelGUIFactory.cs
@@ -93,7 +93,8 @@ namespace grapher.Models
new ChartXY(accelerationChart, accelerationChartY),
new ChartXY(velocityChart, velocityChartY),
new ChartXY(gainChart, gainChartY),
- showVelocityGainToolStripMenuItem);
+ showVelocityGainToolStripMenuItem,
+ writeButton);
var sensitivity = new OptionXY(
sensitivityBoxX,
diff --git a/grapher/Models/Charts/AccelCharts.cs b/grapher/Models/Charts/AccelCharts.cs
index b3199d4..9040851 100644
--- a/grapher/Models/Charts/AccelCharts.cs
+++ b/grapher/Models/Charts/AccelCharts.cs
@@ -15,7 +15,8 @@ namespace grapher
ChartXY sensitivityChart,
ChartXY velocityChart,
ChartXY gainChart,
- ToolStripMenuItem enableVelocityAndGain)
+ ToolStripMenuItem enableVelocityAndGain,
+ Button writeButton)
{
Estimated = new EstimatedPoints();
EstimatedX = new EstimatedPoints();
@@ -27,6 +28,7 @@ namespace grapher
VelocityChart = velocityChart;
GainChart = gainChart;
EnableVelocityAndGain = enableVelocityAndGain;
+ WriteButton = writeButton;
SensitivityChart.SetPointBinds(Estimated.Sensitivity, EstimatedX.Sensitivity, EstimatedY.Sensitivity);
VelocityChart.SetPointBinds(Estimated.Velocity, EstimatedX.Velocity, EstimatedY.Velocity);
@@ -63,6 +65,8 @@ namespace grapher
public ToolStripMenuItem EnableVelocityAndGain { get; }
+ private Button WriteButton { get; }
+
public AccelData AccelData { get; }
private EstimatedPoints Estimated { get; }
@@ -132,6 +136,7 @@ namespace grapher
VelocityChart.SetWidened();
GainChart.SetWidened();
UpdateFormWidth();
+ AlignWriteButton();
}
public void SetNarrowed()
@@ -140,6 +145,7 @@ namespace grapher
VelocityChart.SetNarrowed();
GainChart.SetNarrowed();
UpdateFormWidth();
+ AlignWriteButton();
}
private void OnEnableClick(object sender, EventArgs e)
@@ -211,6 +217,11 @@ namespace grapher
ContaingForm.Width = SensitivityChart.Left + SensitivityChart.Width;
}
+ private void AlignWriteButton()
+ {
+ WriteButton.Left = SensitivityChart.Left / 2 - WriteButton.Width / 2;
+ }
+
#endregion Methods
}
}