Changeset 3638
- Timestamp:
- 05/05/10 15:36:28 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
r3632 r3638 68 68 this.chart.ChartAreas[0].CursorY.Interval = 0; 69 69 this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = !this.isSelecting; 70 this.chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;71 70 this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = !this.isSelecting; 72 this.chart.ChartAreas[0].AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount;73 71 } 74 72 … … 341 339 } 342 340 } 343 this.chart.ChartAreas[0].CursorX.Se tSelectionPosition(double.NaN, double.NaN);344 this.chart.ChartAreas[0].CursorY.Se tSelectionPosition(double.NaN, double.NaN);341 this.chart.ChartAreas[0].CursorX.SelectionStart = this.chart.ChartAreas[0].CursorX.SelectionEnd; 342 this.chart.ChartAreas[0].CursorY.SelectionStart = this.chart.ChartAreas[0].CursorY.SelectionEnd; 345 343 } 346 344 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.Designer.cs
r3300 r3638 46 46 private void InitializeComponent() { 47 47 this.components = new System.ComponentModel.Container(); 48 System.Windows.Forms.ListViewGroup listViewGroup 1= new System.Windows.Forms.ListViewGroup("Results", System.Windows.Forms.HorizontalAlignment.Left);49 System.Windows.Forms.ListViewGroup listViewGroup 2= new System.Windows.Forms.ListViewGroup("Parameters", System.Windows.Forms.HorizontalAlignment.Left);48 System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Results", System.Windows.Forms.HorizontalAlignment.Left); 49 System.Windows.Forms.ListViewGroup listViewGroup4 = new System.Windows.Forms.ListViewGroup("Parameters", System.Windows.Forms.HorizontalAlignment.Left); 50 50 this.parametersResultsGroupBox = new System.Windows.Forms.GroupBox(); 51 51 this.splitContainer = new System.Windows.Forms.SplitContainer(); … … 57 57 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 58 58 this.showAlgorithmButton = new System.Windows.Forms.Button(); 59 this.changeColorButton = new System.Windows.Forms.Button(); 60 this.colorLabel = new System.Windows.Forms.Label(); 61 this.colorPictureBox = new System.Windows.Forms.PictureBox(); 62 this.colorDialog = new System.Windows.Forms.ColorDialog(); 59 63 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 60 64 this.parametersResultsGroupBox.SuspendLayout(); … … 63 67 this.splitContainer.SuspendLayout(); 64 68 this.detailsGroupBox.SuspendLayout(); 69 ((System.ComponentModel.ISupportInitialize)(this.colorPictureBox)).BeginInit(); 65 70 this.SuspendLayout(); 66 71 // … … 81 86 | System.Windows.Forms.AnchorStyles.Right))); 82 87 this.parametersResultsGroupBox.Controls.Add(this.splitContainer); 83 this.parametersResultsGroupBox.Location = new System.Drawing.Point(0, 52);88 this.parametersResultsGroupBox.Location = new System.Drawing.Point(0, 79); 84 89 this.parametersResultsGroupBox.Name = "parametersResultsGroupBox"; 85 this.parametersResultsGroupBox.Size = new System.Drawing.Size(495, 2 72);90 this.parametersResultsGroupBox.Size = new System.Drawing.Size(495, 245); 86 91 this.parametersResultsGroupBox.TabIndex = 4; 87 92 this.parametersResultsGroupBox.TabStop = false; … … 101 106 // 102 107 this.splitContainer.Panel2.Controls.Add(this.detailsGroupBox); 103 this.splitContainer.Size = new System.Drawing.Size(489, 2 53);108 this.splitContainer.Size = new System.Drawing.Size(489, 226); 104 109 this.splitContainer.SplitterDistance = 177; 105 110 this.splitContainer.TabIndex = 0; … … 114 119 this.valueColumnHeader}); 115 120 this.listView.FullRowSelect = true; 116 listViewGroup 1.Header = "Results";117 listViewGroup 1.Name = "resultsGroup";118 listViewGroup 2.Header = "Parameters";119 listViewGroup 2.Name = "parametersGroup";121 listViewGroup3.Header = "Results"; 122 listViewGroup3.Name = "resultsGroup"; 123 listViewGroup4.Header = "Parameters"; 124 listViewGroup4.Name = "parametersGroup"; 120 125 this.listView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { 121 listViewGroup 1,122 listViewGroup 2});126 listViewGroup3, 127 listViewGroup4}); 123 128 this.listView.HideSelection = false; 124 129 this.listView.Location = new System.Drawing.Point(3, 3); … … 126 131 this.listView.Name = "listView"; 127 132 this.listView.ShowItemToolTips = true; 128 this.listView.Size = new System.Drawing.Size(171, 2 47);133 this.listView.Size = new System.Drawing.Size(171, 220); 129 134 this.listView.SmallImageList = this.imageList; 130 135 this.listView.Sorting = System.Windows.Forms.SortOrder.Ascending; … … 158 163 this.detailsGroupBox.Location = new System.Drawing.Point(3, 3); 159 164 this.detailsGroupBox.Name = "detailsGroupBox"; 160 this.detailsGroupBox.Size = new System.Drawing.Size(302, 2 47);165 this.detailsGroupBox.Size = new System.Drawing.Size(302, 220); 161 166 this.detailsGroupBox.TabIndex = 0; 162 167 this.detailsGroupBox.TabStop = false; … … 168 173 | System.Windows.Forms.AnchorStyles.Left) 169 174 | System.Windows.Forms.AnchorStyles.Right))); 175 this.viewHost.Caption = null; 170 176 this.viewHost.Content = null; 171 177 this.viewHost.Location = new System.Drawing.Point(6, 19); 172 178 this.viewHost.Name = "viewHost"; 173 this.viewHost.Size = new System.Drawing.Size(290, 222); 179 this.viewHost.ReadOnly = false; 180 this.viewHost.Size = new System.Drawing.Size(290, 195); 174 181 this.viewHost.TabIndex = 0; 175 182 this.viewHost.ViewType = null; … … 188 195 this.showAlgorithmButton.Click += new System.EventHandler(this.showAlgorithmButton_Click); 189 196 // 197 // changeColorButton 198 // 199 this.changeColorButton.Enabled = false; 200 this.changeColorButton.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; 201 this.changeColorButton.Location = new System.Drawing.Point(94, 52); 202 this.changeColorButton.Name = "changeColorButton"; 203 this.changeColorButton.Size = new System.Drawing.Size(64, 21); 204 this.changeColorButton.TabIndex = 21; 205 this.changeColorButton.Text = "Change"; 206 this.changeColorButton.UseVisualStyleBackColor = true; 207 this.changeColorButton.Click += new System.EventHandler(this.changeColorButton_Click); 208 // 209 // colorLabel 210 // 211 this.colorLabel.AutoSize = true; 212 this.colorLabel.Location = new System.Drawing.Point(3, 56); 213 this.colorLabel.Name = "colorLabel"; 214 this.colorLabel.Size = new System.Drawing.Size(34, 13); 215 this.colorLabel.TabIndex = 22; 216 this.colorLabel.Text = "Color:"; 217 // 218 // colorPictureBox 219 // 220 this.colorPictureBox.Location = new System.Drawing.Point(73, 54); 221 this.colorPictureBox.Name = "colorPictureBox"; 222 this.colorPictureBox.Size = new System.Drawing.Size(17, 17); 223 this.colorPictureBox.TabIndex = 23; 224 this.colorPictureBox.TabStop = false; 225 // 190 226 // RunView 191 227 // 192 228 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 193 229 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 230 this.Controls.Add(this.colorPictureBox); 231 this.Controls.Add(this.colorLabel); 232 this.Controls.Add(this.changeColorButton); 194 233 this.Controls.Add(this.parametersResultsGroupBox); 195 234 this.Controls.Add(this.showAlgorithmButton); … … 202 241 this.Controls.SetChildIndex(this.nameTextBox, 0); 203 242 this.Controls.SetChildIndex(this.nameLabel, 0); 243 this.Controls.SetChildIndex(this.changeColorButton, 0); 244 this.Controls.SetChildIndex(this.colorLabel, 0); 245 this.Controls.SetChildIndex(this.colorPictureBox, 0); 204 246 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 205 247 this.parametersResultsGroupBox.ResumeLayout(false); … … 208 250 this.splitContainer.ResumeLayout(false); 209 251 this.detailsGroupBox.ResumeLayout(false); 252 ((System.ComponentModel.ISupportInitialize)(this.colorPictureBox)).EndInit(); 210 253 this.ResumeLayout(false); 211 254 this.PerformLayout(); … … 224 267 private System.Windows.Forms.ImageList imageList; 225 268 private System.Windows.Forms.Button showAlgorithmButton; 269 private System.Windows.Forms.Label colorLabel; 270 private System.Windows.Forms.Button changeColorButton; 271 private System.Windows.Forms.PictureBox colorPictureBox; 272 private System.Windows.Forms.ColorDialog colorDialog; 226 273 227 274 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs
r3566 r3638 26 26 using HeuristicLab.Core.Views; 27 27 using HeuristicLab.MainForm; 28 using System.Drawing; 28 29 29 30 namespace HeuristicLab.Optimization.Views { … … 58 59 } 59 60 61 protected override void RegisterContentEvents() { 62 base.RegisterContentEvents(); 63 Content.Changed += new EventHandler(Content_Changed); 64 } 65 protected override void DeregisterContentEvents() { 66 base.DeregisterContentEvents(); 67 Content.Changed -= new EventHandler(Content_Changed); 68 } 69 private void Content_Changed(object sender, EventArgs e) { 70 if (InvokeRequired) 71 this.Invoke(new EventHandler(Content_Changed), sender, e); 72 else 73 UpdateColorPictureBox(); 74 } 75 60 76 protected override void OnContentChanged() { 61 77 base.OnContentChanged(); … … 65 81 if (Content == null) 66 82 Caption = "Run"; 67 else 83 else { 68 84 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 85 UpdateColorPictureBox(); 86 } 69 87 SetEnabledStateOfControls(); 70 88 } … … 80 98 listView.Enabled = Content != null; 81 99 viewHost.Enabled = Content != null; 100 changeColorButton.Enabled = Content != null; 82 101 showAlgorithmButton.Enabled = Content != null && !Locked; 102 } 103 104 private void changeColorButton_Click(object sender, EventArgs e) { 105 if (colorDialog.ShowDialog(this) == DialogResult.OK) { 106 this.Content.Color = this.colorDialog.Color; 107 } 108 } 109 private void UpdateColorPictureBox() { 110 this.colorDialog.Color = this.Content.Color; 111 this.colorPictureBox.Image = this.GenerateImage(colorPictureBox.Width, colorPictureBox.Height, this.Content.Color); 112 } 113 private Image GenerateImage(int width, int height, Color fillColor) { 114 Image colorImage = new Bitmap(width, height); 115 using (Graphics gfx = Graphics.FromImage(colorImage)) { 116 using (SolidBrush brush = new SolidBrush(fillColor)) { 117 gfx.FillRectangle(brush, 0, 0, width, height); 118 } 119 } 120 return colorImage; 83 121 } 84 122
Note: See TracChangeset
for help on using the changeset viewer.