Changeset 10916
- Timestamp:
- 05/28/14 15:34:34 (10 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab 3.3.sln
r10766 r10916 1 1 2 2 Microsoft Visual Studio Solution File, Format Version 12.00 3 # Visual Studio 2013 4 VisualStudioVersion = 12.0.30110.0 5 MinimumVisualStudioVersion = 10.0.40219.1 3 # Visual Studio 2012 6 4 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{96396439-A764-4022-A8D2-BE021449B8D1}" 7 5 ProjectSection(SolutionItems) = preProject … … 10 8 ..\documentation\License\gpl-3.0.txt = ..\documentation\License\gpl-3.0.txt 11 9 MergeConfigs.cmd = MergeConfigs.cmd 10 Performance1.psess = Performance1.psess 12 11 PreBuildEvent.cmd = PreBuildEvent.cmd 13 12 EndProjectSection … … 1922 1921 HideSolutionNode = FALSE 1923 1922 EndGlobalSection 1923 GlobalSection(Performance) = preSolution 1924 HasPerformanceSessions = true 1925 EndGlobalSection 1924 1926 EndGlobal -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/CopyOfStringConvertibleMatrixView.cs
r10691 r10916 79 79 } 80 80 81 // Was private before 82 protected virtual void dataGridView_SelectionChanged(object sender, EventArgs e) { 83 string stringFormat = "{0,20:0.0000}"; 84 statisticsTextBox.Text = string.Empty; 85 if (dataGridView.SelectedCells.Count > 1) { 86 List<double> selectedValues = new List<double>(); 87 foreach (DataGridViewCell cell in dataGridView.SelectedCells) { 88 double value; 89 if (!double.TryParse(cell.Value.ToString(), out value)) return; 90 selectedValues.Add(value); 91 } 92 if (selectedValues.Count > 1) { 93 StringBuilder labelText = new StringBuilder(); 94 labelText.Append("Count: " + string.Format(stringFormat, selectedValues.Count) + " "); 95 labelText.Append("Sum: " + string.Format(stringFormat, selectedValues.Sum()) + " "); 96 labelText.Append("Min: " + string.Format(stringFormat, selectedValues.Min()) + " "); 97 labelText.Append("Max: " + string.Format(stringFormat, selectedValues.Max()) + " "); 98 labelText.Append("Average: " + string.Format(stringFormat, selectedValues.Average()) + " "); 99 labelText.Append("Standard Deviation: " + string.Format(stringFormat, selectedValues.StandardDeviation()) + " "); 100 101 statisticsTextBox.Text = labelText.ToString(); 102 } 103 } 104 } 105 81 106 #region unchanged copied from original - see HeuristicLab.Data.Views.StringConvertibleMatrix 82 107 … … 572 597 } 573 598 574 private void dataGridView_SelectionChanged(object sender, EventArgs e) { 575 string stringFormat = "{0,20:0.0000}"; 576 statisticsTextBox.Text = string.Empty; 577 if (dataGridView.SelectedCells.Count > 1) { 578 List<double> selectedValues = new List<double>(); 579 foreach (DataGridViewCell cell in dataGridView.SelectedCells) { 580 double value; 581 if (!double.TryParse(cell.Value.ToString(), out value)) return; 582 selectedValues.Add(value); 583 } 584 if (selectedValues.Count > 1) { 585 StringBuilder labelText = new StringBuilder(); 586 labelText.Append("Count: " + string.Format(stringFormat, selectedValues.Count) + " "); 587 labelText.Append("Sum: " + string.Format(stringFormat, selectedValues.Sum()) + " "); 588 labelText.Append("Min: " + string.Format(stringFormat, selectedValues.Min()) + " "); 589 labelText.Append("Max: " + string.Format(stringFormat, selectedValues.Max()) + " "); 590 labelText.Append("Average: " + string.Format(stringFormat, selectedValues.Average()) + " "); 591 labelText.Append("Standard Deviation: " + string.Format(stringFormat, selectedValues.StandardDeviation()) + " "); 592 593 statisticsTextBox.Text = labelText.ToString(); 594 } 595 } 596 } 599 597 600 } 598 601 #endregion -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs
r10911 r10916 74 74 _highlightedCellsBackground = new Dictionary<int, IList<int>>(); 75 75 currentCell = null; 76 DataGridView.SelectionChanged += DataGridView_SelectionChanged; 77 } 78 79 void DataGridView_SelectionChanged(object sender, EventArgs e) { 80 if (!isSearching && Content != null) { 81 Content.DataGridLogic.SetSelection(GetSelectedCells()); 76 } 77 78 protected override void dataGridView_SelectionChanged(object sender, EventArgs e) { 79 if (Content != null) { 80 if (!isSearching) { 81 base.dataGridView_SelectionChanged(sender, e); 82 Content.DataGridLogic.SetSelection(GetSelectedCells()); 83 } 82 84 } 83 85 } … … 103 105 OnContentChanged(); 104 106 searchIterator = null; 105 } 107 } 106 108 107 109 protected override void DeregisterContentEvents() { … … 129 131 if (!dataGridView.ReadOnly) { 130 132 string errorMessage; 131 if (Content != null) {133 if (Content != null) { 132 134 if (dataGridView.IsCurrentCellInEditMode && Content.FilterLogic.IsFiltered()) { 133 135 errorMessage = "A filter is active, you cannot modify data. Press ESC to exit edit mode."; … … 192 194 } 193 195 194 void DataGridView_SelectionChanged_FindAndReplace(object sender, EventArgs e) {196 private void DataGridView_SelectionChanged_FindAndReplace(object sender, EventArgs e) { 195 197 if (Content != null) { 196 198 if (!isSearching && AreMultipleCellsSelected()) { … … 276 278 isSearching = true; 277 279 SuspendRepaint(); 278 foreach (var column in FindAll(findAndReplaceDialog.GetSearchText())) { 280 var selectedCells = FindAll(findAndReplaceDialog.GetSearchText()); 281 foreach (var column in selectedCells) { 279 282 foreach (var cell in column.Value) { 280 283 dataGridView[column.Key, cell].Selected = true; … … 283 286 ResumeRepaint(true); 284 287 isSearching = false; 285 DataGridView_SelectionChanged(null, null); 288 Content.DataGridLogic.SetSelection(selectedCells); 289 //update statistic in base 290 base.dataGridView_SelectionChanged(sender, e); 286 291 } 287 292
Note: See TracChangeset
for help on using the changeset viewer.