- Timestamp:
- 07/25/10 00:29:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs
r4068 r4096 21 21 22 22 using System; 23 using System.Drawing;24 23 using System.Windows.Forms; 25 24 using HeuristicLab.Common; … … 64 63 this.Invoke(new EventHandler(Content_Changed), sender, e); 65 64 else 66 UpdateColor PictureBox();65 UpdateColor(); 67 66 } 68 67 … … 71 70 viewHost.Content = null; 72 71 if (Content != null) 73 UpdateColor PictureBox();72 UpdateColor(); 74 73 FillListView(); 75 74 } … … 88 87 } 89 88 } 90 private void UpdateColor PictureBox() {89 private void UpdateColor() { 91 90 this.colorDialog.Color = this.Content.Color; 92 this.colorPictureBox.Image = this.GenerateImage(colorPictureBox.Width, colorPictureBox.Height, this.Content.Color); 93 } 94 private Image GenerateImage(int width, int height, Color fillColor) { 95 Image colorImage = new Bitmap(width, height); 96 using (Graphics gfx = Graphics.FromImage(colorImage)) { 97 using (SolidBrush brush = new SolidBrush(fillColor)) { 98 gfx.FillRectangle(brush, 0, 0, width, height); 99 } 100 } 101 return colorImage; 91 this.colorArea.BackColor = this.Content.Color; 102 92 } 103 93 … … 132 122 133 123 private void listView_SelectedIndexChanged(object sender, EventArgs e) { 134 if (listView.SelectedItems.Count == 1) 135 viewHost.Content = (IContent)listView.SelectedItems[0].Tag; 136 else 137 viewHost.Content = null; 124 if (showDetailsCheckBox.Checked) { 125 if (listView.SelectedItems.Count == 1) { 126 detailsGroupBox.Enabled = true; 127 viewHost.Content = listView.SelectedItems[0].Tag as IContent; 128 } else { 129 viewHost.Content = null; 130 detailsGroupBox.Enabled = false; 131 } 132 } 138 133 } 139 134 private void listView_DoubleClick(object sender, EventArgs e) { … … 159 154 } 160 155 } 156 private void showDetailsCheckBox_CheckedChanged(object sender, EventArgs e) { 157 if (showDetailsCheckBox.Checked) { 158 splitContainer.Panel2Collapsed = false; 159 detailsGroupBox.Enabled = listView.SelectedItems.Count == 1; 160 viewHost.Content = listView.SelectedItems.Count == 1 ? (IContent)listView.SelectedItems[0].Tag : null; 161 } else { 162 splitContainer.Panel2Collapsed = true; 163 viewHost.Content = null; 164 viewHost.ClearCache(); 165 } 166 } 161 167 private void showAlgorithmButton_Click(object sender, EventArgs e) { 162 168 if (!Locked) {
Note: See TracChangeset
for help on using the changeset viewer.