Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/17 16:17:12 (7 years ago)
Author:
pfleck
Message:

#2709

  • Use the new icons for PreprocessingCheckedVariablesView (linechart, histogram).
  • Added a "lock aspect ratio" sizing for the multi scatter plot.
  • Fixed a bug in single scatter plot when changing the regression line.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs

    r14902 r14917  
    4343    public ScatterPlotMultiView() {
    4444      InitializeComponent();
     45
     46      oldWidth = (int)widthNumericUpDown.Value;
     47      oldHeight = (int)heightNumericUpDown.Value;
    4548
    4649      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType));
     
    465468
    466469    #region Sizing of Charts
     470    private int oldWidth;
     471    private int oldHeight;
     472    private float AspectRatio {
     473      get {
     474        if (oldWidth == 0 || oldHeight == 0) return 1;
     475        return (float)oldWidth / oldHeight;
     476      }
     477    }
     478    private bool lockChange = false;
    467479
    468480    private int GetColumnWidth() { return (int)widthNumericUpDown.Value; }
    469481    private int GetRowHeight() { return (int)heightNumericUpDown.Value; }
     482
    470483    private void widthNumericUpDown_ValueChanged(object sender, EventArgs e) {
    471484      frameTableLayoutPanel.SuspendRepaint();
     485      if (lockAspectCheckBox.Checked && !lockChange) {
     486        lockChange = true;
     487        heightNumericUpDown.Value = (int)((double)widthNumericUpDown.Value / AspectRatio);
     488        lockChange = false;
     489      }
    472490      for (int i = 0; i < columnHeaderTableLayoutPanel.ColumnCount; i++) {
    473491        columnHeaderTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth();
    474492        bodyTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth();
    475493      }
     494      oldWidth = GetColumnWidth();
     495      oldHeight = GetRowHeight();
    476496      frameTableLayoutPanel.ResumeRepaint(true);
    477497    }
    478498    private void heightNumericUpDown_ValueChanged(object sender, EventArgs e) {
    479499      frameTableLayoutPanel.SuspendRepaint();
     500      if (lockAspectCheckBox.Checked && !lockChange) {
     501        lockChange = true;
     502        widthNumericUpDown.Value = (int)((double)heightNumericUpDown.Value * AspectRatio);
     503        lockChange = false;
     504      }
    480505      for (int i = 0; i < rowHeaderTableLayoutPanel.RowCount; i++) {
    481506        rowHeaderTableLayoutPanel.RowStyles[i].Height = GetRowHeight();
    482507        bodyTableLayoutPanel.RowStyles[i].Height = GetRowHeight();
    483508      }
     509      oldWidth = GetColumnWidth();
     510      oldHeight = GetRowHeight();
    484511      frameTableLayoutPanel.ResumeRepaint(true);
    485512    }
Note: See TracChangeset for help on using the changeset viewer.