Free cookie consent management tool by TermsFeed Policy Generator

Ticket #2452: error-characteristics-chart-drag-and-drop.patch

File error-characteristics-chart-drag-and-drop.patch, 3.9 KB (added by bburlacu, 9 years ago)

Patch to implement drag&drop

  • HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

     
    264264      }
    265265    }
    266266
     267    private void chart_DragDrop(object sender, DragEventArgs e) {
     268      if (e.Data.GetDataPresent("HeuristicLab")) {
     269        var regressionSolution = (IRegressionSolution)e.Data.GetData("HeuristicLab");
     270        AddRegressionSolution(regressionSolution);
     271      }
     272    }
     273
     274    private void chart_DragEnter(object sender, DragEventArgs e) {
     275      e.Effect = DragDropEffects.Copy;
     276    }
     277
    267278    private void residualComboBox_SelectedIndexChanged(object sender, EventArgs e) {
    268279      UpdateChart();
    269280    }
  • HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs

     
    4545    /// </summary>
    4646    private void InitializeComponent() {
    4747      this.components = new System.ComponentModel.Container();
    48       System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
    49       System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
     48      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     49      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
    5050      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    5151      this.label1 = new System.Windows.Forms.Label();
    5252      this.cmbSamples = new System.Windows.Forms.ComboBox();
     
    5656      //
    5757      // chart
    5858      //
     59      this.chart.AllowDrop = true;
    5960      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    6061            | System.Windows.Forms.AnchorStyles.Left)
    6162            | System.Windows.Forms.AnchorStyles.Right)));
    62       chartArea2.Name = "ChartArea1";
    63       this.chart.ChartAreas.Add(chartArea2);
    64       legend2.Alignment = System.Drawing.StringAlignment.Center;
    65       legend2.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
    66       legend2.Name = "Legend1";
    67       this.chart.Legends.Add(legend2);
     63      chartArea1.Name = "ChartArea1";
     64      this.chart.ChartAreas.Add(chartArea1);
     65      legend1.Alignment = System.Drawing.StringAlignment.Center;
     66      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
     67      legend1.Name = "Legend1";
     68      this.chart.Legends.Add(legend1);
    6869      this.chart.Location = new System.Drawing.Point(6, 28);
    6970      this.chart.Name = "chart";
    7071      this.chart.Size = new System.Drawing.Size(366, 202);
    7172      this.chart.TabIndex = 0;
    7273      this.chart.Text = "chart";
     74      this.chart.DragDrop += new System.Windows.Forms.DragEventHandler(this.chart_DragDrop);
     75      this.chart.DragEnter += new System.Windows.Forms.DragEventHandler(this.chart_DragEnter);
    7376      this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Chart_MouseDoubleClick);
    7477      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
    7578      //