Changeset 14917 for branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
- Timestamp:
- 05/03/17 16:17:12 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing Enhancements/HeuristicLab.DataPreprocessing.Views/3.4/ScatterPlotMultiView.cs
r14902 r14917 43 43 public ScatterPlotMultiView() { 44 44 InitializeComponent(); 45 46 oldWidth = (int)widthNumericUpDown.Value; 47 oldHeight = (int)heightNumericUpDown.Value; 45 48 46 49 regressionTypeComboBox.DataSource = Enum.GetValues(typeof(RegressionType)); … … 465 468 466 469 #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; 467 479 468 480 private int GetColumnWidth() { return (int)widthNumericUpDown.Value; } 469 481 private int GetRowHeight() { return (int)heightNumericUpDown.Value; } 482 470 483 private void widthNumericUpDown_ValueChanged(object sender, EventArgs e) { 471 484 frameTableLayoutPanel.SuspendRepaint(); 485 if (lockAspectCheckBox.Checked && !lockChange) { 486 lockChange = true; 487 heightNumericUpDown.Value = (int)((double)widthNumericUpDown.Value / AspectRatio); 488 lockChange = false; 489 } 472 490 for (int i = 0; i < columnHeaderTableLayoutPanel.ColumnCount; i++) { 473 491 columnHeaderTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth(); 474 492 bodyTableLayoutPanel.ColumnStyles[i].Width = GetColumnWidth(); 475 493 } 494 oldWidth = GetColumnWidth(); 495 oldHeight = GetRowHeight(); 476 496 frameTableLayoutPanel.ResumeRepaint(true); 477 497 } 478 498 private void heightNumericUpDown_ValueChanged(object sender, EventArgs e) { 479 499 frameTableLayoutPanel.SuspendRepaint(); 500 if (lockAspectCheckBox.Checked && !lockChange) { 501 lockChange = true; 502 widthNumericUpDown.Value = (int)((double)heightNumericUpDown.Value * AspectRatio); 503 lockChange = false; 504 } 480 505 for (int i = 0; i < rowHeaderTableLayoutPanel.RowCount; i++) { 481 506 rowHeaderTableLayoutPanel.RowStyles[i].Height = GetRowHeight(); 482 507 bodyTableLayoutPanel.RowStyles[i].Height = GetRowHeight(); 483 508 } 509 oldWidth = GetColumnWidth(); 510 oldHeight = GetRowHeight(); 484 511 frameTableLayoutPanel.ResumeRepaint(true); 485 512 }
Note: See TracChangeset
for help on using the changeset viewer.