diff options
| author | Jacob Palecki <[email protected]> | 2020-09-08 14:29:37 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-08 14:29:37 -0700 |
| commit | ae8ee86fdaac66815827e132493c8bfcc5fbf8c9 (patch) | |
| tree | 516dc3d36ebbc5e547837e6756182ab583d8a32c | |
| parent | Set WriteButton vertical placement (diff) | |
| download | rawaccel-ae8ee86fdaac66815827e132493c8bfcc5fbf8c9.tar.xz rawaccel-ae8ee86fdaac66815827e132493c8bfcc5fbf8c9.zip | |
Center write button
| -rw-r--r-- | grapher/Models/AccelGUIFactory.cs | 3 | ||||
| -rw-r--r-- | grapher/Models/Charts/AccelCharts.cs | 13 |
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 } } |