Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/30/17 16:41:06 (7 years ago)
Author:
pfleck
Message:

#2713 #2715 #2765
Merged to stable

  • 14435-14439,14493,14516,14519,14982,14987,14992,15042 (from #2713)
  • 14457-14458,14508,14582,14740,14984,15068,15095 (from #2715)
  • 14860-14861 (from #2765)
Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Analysis.Views

  • stable/HeuristicLab.Analysis.Views/3.3/ScatterPlotDataRowVisualPropertiesControl.cs

    r14186 r15097  
    2323using System.Drawing;
    2424using System.Windows.Forms;
     25using HeuristicLab.Common.Resources;
    2526using HeuristicLab.MainForm;
    2627using HeuristicLab.MainForm.WindowsForms;
     
    4445      InitializeComponent();
    4546      pointStyleComboBox.DataSource = Enum.GetValues(typeof(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle));
     47      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType));
     48      clearColorButton.BackColor = Color.Transparent;
     49      clearColorButton.BackgroundImage = VSImageLibrary.Delete;
    4650      SetEnabledStateOfControls();
    4751    }
     
    5761          pointSizeNumericUpDown.Value = 1;
    5862          displayNameTextBox.Text = String.Empty;
     63          regressionTypeComboBox.SelectedIndex = -1;
     64          polynomialRegressionOrderNumericUpDown.Value = 2;
     65          isRegressionVisibleInLegendCheckBox.Checked = false;
     66          regressionLegendTextBox.Text = string.Empty;
    5967        } else {
    6068          displayNameTextBox.Text = Content.DisplayName;
     
    6977          pointSizeNumericUpDown.Value = Content.PointSize;
    7078          isVisibleInLegendCheckBox.Checked = Content.IsVisibleInLegend;
     79          regressionTypeComboBox.SelectedItem = Content.RegressionType;
     80          polynomialRegressionOrderNumericUpDown.Value = Content.PolynomialRegressionOrder;
     81          isRegressionVisibleInLegendCheckBox.Checked = Content.IsRegressionVisibleInLegend;
     82          regressionLegendTextBox.Text = content.RegressionDisplayName;
    7183        }
    7284      }
     
    7890      pointStyleComboBox.Enabled = Content != null;
    7991      colorButton.Enabled = Content != null;
    80       colorButton.Enabled = Content != null;
     92      clearColorButton.Visible = Content != null && !Content.Color.IsEmpty;
    8193      isVisibleInLegendCheckBox.Enabled = Content != null;
    8294      pointSizeNumericUpDown.Enabled = Content != null;
    8395      displayNameTextBox.Enabled = Content != null;
     96      regressionTypeComboBox.Enabled = Content != null;
     97      polynomialRegressionOrderNumericUpDown.Enabled = Content != null && Content.RegressionType == ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.Polynomial;
     98      orderLabel.Enabled = polynomialRegressionOrderNumericUpDown.Enabled;
     99      isRegressionVisibleInLegendCheckBox.Enabled = Content != null && Content.RegressionType != ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.None;
     100      regressionLegendTextBox.Enabled = Content != null && Content.RegressionType != ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType.None;
    84101    }
    85102
     
    87104    private void pointStyleComboBox_SelectedValueChanged(object sender, EventArgs e) {
    88105      if (!SuppressEvents && Content != null) {
    89         ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle)pointStyleComboBox.SelectedValue;
     106        var selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle)pointStyleComboBox.SelectedValue;
    90107        Content.PointStyle = selected;
    91108      }
     
    97114        colorButton.BackColor = Content.Color;
    98115        colorButton.Text = String.Empty;
     116        clearColorButton.Visible = true;
     117      }
     118    }
     119
     120    private void clearColorButton_Click(object sender, EventArgs e) {
     121      if (!SuppressEvents && Content != null) {
     122        Content.Color = Color.Empty;
     123        colorButton.BackColor = SystemColors.Control;
     124        colorButton.Text = "?";
     125        clearColorButton.Visible = false;
    99126      }
    100127    }
     
    121148      }
    122149    }
     150
     151    private void regressionTypeComboBox_SelectedValueChanged(object sender, EventArgs e) {
     152      if (!SuppressEvents && Content != null) {
     153        var selected = (ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType)regressionTypeComboBox.SelectedValue;
     154        Content.RegressionType = selected;
     155        SetEnabledStateOfControls();
     156      }
     157    }
     158
     159    private void polynomialRegressionOrderNumericUpDown_ValueChanged(object sender, EventArgs e) {
     160      if (!SuppressEvents && Content != null) {
     161        Content.PolynomialRegressionOrder = (int)polynomialRegressionOrderNumericUpDown.Value;
     162      }
     163    }
     164
     165    private void isRegressionVisibleInLegendCheckBox_CheckedChanged(object sender, EventArgs e) {
     166      if (!SuppressEvents && Content != null) {
     167        Content.IsRegressionVisibleInLegend = isRegressionVisibleInLegendCheckBox.Checked;
     168      }
     169    }
     170
     171    private void regressionLegendTextBox_Validated(object sender, EventArgs e) {
     172      if (!SuppressEvents && Content != null) {
     173        Content.RegressionDisplayName = regressionLegendTextBox.Text;
     174      }
     175    }
    123176    #endregion
    124177  }
Note: See TracChangeset for help on using the changeset viewer.