From 286279b89fcae7e207a656fbea00a51555b214ac Mon Sep 17 00:00:00 2001 From: Thomas Hilscher Date: Mon, 4 Sep 2023 13:15:51 +0200 Subject: [PATCH] Fixed ChartWindow --- Elwig/Windows/ChartWindow.xaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Elwig/Windows/ChartWindow.xaml.cs b/Elwig/Windows/ChartWindow.xaml.cs index 9010918..c0bd2cf 100644 --- a/Elwig/Windows/ChartWindow.xaml.cs +++ b/Elwig/Windows/ChartWindow.xaml.cs @@ -231,6 +231,7 @@ namespace Elwig.Windows { private void InitPlot() { OechslePricePlotScatter = OechslePricePlot.Plot.AddScatter(Graph.DataX, Graph.DataY); + OechslePricePlot.Configuration.DoubleClickBenchmark = false; OechslePricePlotScatter.LineColor = Color.Blue; OechslePricePlotScatter.MarkerColor = Color.Blue; OechslePricePlotScatter.MarkerSize = 9; @@ -398,7 +399,7 @@ namespace Elwig.Windows { PriceInput.Text = Graph.DataY[PrimaryMarkedPointIndex].ToString(); - EnableActionButtons(); + if (IsEditing || IsCreating) EnableActionButtons(); OechslePricePlot.Render(); return; } @@ -430,6 +431,8 @@ namespace Elwig.Windows { return; } FlattenGraph(0, PrimaryMarkedPointIndex, Graph.DataY[PrimaryMarkedPointIndex]); + SaveButton.IsEnabled = true; + ResetButton.IsEnabled = true; } private void RightFlatButton_Click(object sender, RoutedEventArgs evt) { @@ -437,6 +440,8 @@ namespace Elwig.Windows { return; } FlattenGraph(PrimaryMarkedPointIndex, Graph.DataY.Length - 1, Graph.DataY[PrimaryMarkedPointIndex]); + SaveButton.IsEnabled = true; + ResetButton.IsEnabled = true; } private void InterpolateButton_Click(object sender, RoutedEventArgs evt) { @@ -451,6 +456,8 @@ namespace Elwig.Windows { for (int i = lowIndex; i < highIndex - 1; i++) { Graph.DataY[i + 1] = Math.Round(Graph.DataY[i] + step, 4); // TODO richtig runden } + SaveButton.IsEnabled = true; + ResetButton.IsEnabled = true; } private void LinearIncreaseButton_Click(object sender, RoutedEventArgs e) { @@ -462,6 +469,8 @@ namespace Elwig.Windows { return; } LinearIncreaseGraph(PrimaryMarkedPointIndex, Graph.DataY.Length - 1, priceIncrease.Value); + SaveButton.IsEnabled = true; + ResetButton.IsEnabled = true; } private void OechslePricePlot_MouseDown(object sender, MouseEventArgs e) {