Changeset 4779
- Timestamp:
- 11/12/10 12:48:41 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Data.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.Designer.cs
r4709 r4779 54 54 this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); 55 55 this.ShowHideColumns = new System.Windows.Forms.ToolStripMenuItem(); 56 this.statusStrip = new System.Windows.Forms.StatusStrip(); 57 this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); 56 this.statisticsTextBox = new System.Windows.Forms.TextBox(); 58 57 ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); 59 58 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 60 59 this.contextMenu.SuspendLayout(); 61 this.statusStrip.SuspendLayout();62 60 this.SuspendLayout(); 63 61 // … … 96 94 this.dataGridView.Name = "dataGridView"; 97 95 this.dataGridView.RowHeadersWidth = 160; 98 this.dataGridView.Size = new System.Drawing.Size(424, 3 27);96 this.dataGridView.Size = new System.Drawing.Size(424, 330); 99 97 this.dataGridView.TabIndex = 4; 100 98 this.dataGridView.VirtualMode = true; … … 150 148 this.ShowHideColumns.Click += new System.EventHandler(this.ShowHideColumns_Click); 151 149 // 152 // stat usStrip1150 // statisticsTextBox 153 151 // 154 this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 155 this.toolStripStatusLabel}); 156 this.statusStrip.Location = new System.Drawing.Point(0, 382); 157 this.statusStrip.Name = "statusStrip1"; 158 this.statusStrip.Size = new System.Drawing.Size(424, 22); 159 this.statusStrip.TabIndex = 5; 160 this.statusStrip.Text = "statusStrip1"; 161 // 162 // toolStripStatusLabel 163 // 164 this.toolStripStatusLabel.Name = "toolStripStatusLabel"; 165 this.toolStripStatusLabel.Size = new System.Drawing.Size(378, 17); 166 this.toolStripStatusLabel.Spring = true; 152 this.statisticsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 153 | System.Windows.Forms.AnchorStyles.Right))); 154 this.statisticsTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; 155 this.statisticsTextBox.Location = new System.Drawing.Point(3, 388); 156 this.statisticsTextBox.Name = "statisticsTextBox"; 157 this.statisticsTextBox.Size = new System.Drawing.Size(418, 13); 158 this.statisticsTextBox.TabIndex = 5; 159 this.statisticsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; 167 160 // 168 161 // StringConvertibleMatrixView … … 170 163 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 171 164 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 172 this.Controls.Add(this. statusStrip);165 this.Controls.Add(this.columnsTextBox); 173 166 this.Controls.Add(this.dataGridView); 174 this.Controls.Add(this.columnsTextBox);175 167 this.Controls.Add(this.rowsTextBox); 176 168 this.Controls.Add(this.columnsLabel); 177 169 this.Controls.Add(this.rowsLabel); 170 this.Controls.Add(this.statisticsTextBox); 178 171 this.Name = "StringConvertibleMatrixView"; 179 172 this.Size = new System.Drawing.Size(424, 404); … … 181 174 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 182 175 this.contextMenu.ResumeLayout(false); 183 this.statusStrip.ResumeLayout(false);184 this.statusStrip.PerformLayout();185 176 this.ResumeLayout(false); 186 177 this.PerformLayout(); … … 197 188 protected System.Windows.Forms.ToolStripMenuItem ShowHideColumns; 198 189 protected System.Windows.Forms.DataGridView dataGridView; 199 private System.Windows.Forms.StatusStrip statusStrip; 200 private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; 190 protected System.Windows.Forms.TextBox statisticsTextBox; 201 191 202 192 } -
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
r4720 r4779 510 510 511 511 private void UpdateVisibilityOfStatisticalInformation() { 512 stat usStrip.Visible = showStatisticalInformation;512 statisticsTextBox.Visible = showStatisticalInformation; 513 513 UpdateDataGridViewSizeAndLocation(); 514 514 } … … 521 521 dataGridView.Location = new Point(0, offset); 522 522 523 int stat usStripHeight = showStatisticalInformation ? statusStrip.Height: 0;524 dataGridView.Size = new Size(Size.Width, Size.Height - offset - stat usStripHeight);523 int statisticsTextBoxHeight = showStatisticalInformation ? statisticsTextBox.Height + statisticsTextBox.Margin.Top + statisticsTextBox.Margin.Bottom : 0; 524 dataGridView.Size = new Size(Size.Width, Size.Height - offset - statisticsTextBoxHeight); 525 525 } 526 526 527 527 private void dataGridView_SelectionChanged(object sender, EventArgs e) { 528 toolStripStatusLabel.Text = string.Empty; 528 string stringFormat = "{0,20:0.0000}"; 529 statisticsTextBox.Text = string.Empty; 529 530 if (dataGridView.SelectedCells.Count > 1) { 530 531 List<double> selectedValues = new List<double>(); … … 536 537 if (selectedValues.Count > 1) { 537 538 StringBuilder labelText = new StringBuilder(); 538 labelText.Append("Count: " + s electedValues.Count+ " ");539 labelText.Append("Sum: " + s electedValues.Sum() + " ");540 labelText.Append("Min: " + s electedValues.Min() + " ");541 labelText.Append("Max: " + s electedValues.Max() + " ");542 labelText.Append("Average: " + s electedValues.Average() + " ");543 labelText.Append("Standard Deviation: " + s electedValues.StandardDeviation() + " ");544 545 toolStripStatusLabel.Text = labelText.ToString();539 labelText.Append("Count: " + string.Format(stringFormat, selectedValues.Count) + " "); 540 labelText.Append("Sum: " + string.Format(stringFormat, selectedValues.Sum()) + " "); 541 labelText.Append("Min: " + string.Format(stringFormat, selectedValues.Min()) + " "); 542 labelText.Append("Max: " + string.Format(stringFormat, selectedValues.Max()) + " "); 543 labelText.Append("Average: " + string.Format(stringFormat, selectedValues.Average()) + " "); 544 labelText.Append("Standard Deviation: " + string.Format(stringFormat, selectedValues.StandardDeviation()) + " "); 545 546 statisticsTextBox.Text = labelText.ToString(); 546 547 } 547 548 }
Note: See TracChangeset
for help on using the changeset viewer.