Changeset 5660
- Timestamp:
- 03/10/11 13:00:48 (14 years ago)
- Location:
- branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3
- Files:
-
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/HeuristicLab.Clients.OKB-3.3.csproj
r5647 r5660 305 305 <DependentUpon>OKBAlgorithmView.cs</DependentUpon> 306 306 </Compile> 307 <Compile Include="RunCreation\Views\ ProblemView.cs">308 <SubType>UserControl</SubType> 309 </Compile> 310 <Compile Include="RunCreation\Views\ ProblemView.Designer.cs">311 <DependentUpon> ProblemView.cs</DependentUpon>307 <Compile Include="RunCreation\Views\OKBProblemView.cs"> 308 <SubType>UserControl</SubType> 309 </Compile> 310 <Compile Include="RunCreation\Views\OKBProblemView.Designer.cs"> 311 <DependentUpon>OKBProblemView.cs</DependentUpon> 312 312 </Compile> 313 313 <None Include="app.config" /> -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBAlgorithmView.Designer.cs
r5647 r5660 57 57 this.algorithmLabel = new System.Windows.Forms.Label(); 58 58 this.refreshButton = new System.Windows.Forms.Button(); 59 this.cloneAlgorithmButton = new System.Windows.Forms.Button(); 59 60 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 60 61 this.tabControl.SuspendLayout(); … … 71 72 this.nameTextBox.Location = new System.Drawing.Point(72, 29); 72 73 this.nameTextBox.Size = new System.Drawing.Size(607, 20); 73 this.nameTextBox.TabIndex = 4;74 this.nameTextBox.TabIndex = 5; 74 75 // 75 76 // nameLabel 76 77 // 77 78 this.nameLabel.Location = new System.Drawing.Point(3, 32); 78 this.nameLabel.TabIndex = 3;79 this.nameLabel.TabIndex = 4; 79 80 // 80 81 // descriptionLabel 81 82 // 82 83 this.descriptionLabel.Location = new System.Drawing.Point(3, 58); 83 this.descriptionLabel.TabIndex = 5;84 this.descriptionLabel.TabIndex = 6; 84 85 // 85 86 // descriptionTextBox … … 87 88 this.descriptionTextBox.Location = new System.Drawing.Point(72, 55); 88 89 this.descriptionTextBox.Size = new System.Drawing.Size(607, 20); 89 this.descriptionTextBox.TabIndex = 6;90 this.descriptionTextBox.TabIndex = 7; 90 91 // 91 92 // tabControl … … 103 104 this.tabControl.SelectedIndex = 0; 104 105 this.tabControl.Size = new System.Drawing.Size(679, 371); 105 this.tabControl.TabIndex = 7;106 this.tabControl.TabIndex = 8; 106 107 // 107 108 // problemTabPage … … 256 257 this.startButton.Name = "startButton"; 257 258 this.startButton.Size = new System.Drawing.Size(24, 24); 258 this.startButton.TabIndex = 8;259 this.startButton.TabIndex = 9; 259 260 this.toolTip.SetToolTip(this.startButton, "Start/Resume Algorithm"); 260 261 this.startButton.UseVisualStyleBackColor = true; … … 268 269 this.pauseButton.Name = "pauseButton"; 269 270 this.pauseButton.Size = new System.Drawing.Size(24, 24); 270 this.pauseButton.TabIndex = 9;271 this.pauseButton.TabIndex = 10; 271 272 this.toolTip.SetToolTip(this.pauseButton, "Pause Algorithm"); 272 273 this.pauseButton.UseVisualStyleBackColor = true; … … 280 281 this.resetButton.Name = "resetButton"; 281 282 this.resetButton.Size = new System.Drawing.Size(24, 24); 282 this.resetButton.TabIndex = 1 1;283 this.resetButton.TabIndex = 12; 283 284 this.toolTip.SetToolTip(this.resetButton, "Reset Algorithm"); 284 285 this.resetButton.UseVisualStyleBackColor = true; … … 292 293 this.executionTimeLabel.Name = "executionTimeLabel"; 293 294 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13); 294 this.executionTimeLabel.TabIndex = 1 2;295 this.executionTimeLabel.TabIndex = 13; 295 296 this.executionTimeLabel.Text = "&Execution Time:"; 296 297 // … … 302 303 this.executionTimeTextBox.ReadOnly = true; 303 304 this.executionTimeTextBox.Size = new System.Drawing.Size(137, 20); 304 this.executionTimeTextBox.TabIndex = 1 3;305 this.executionTimeTextBox.TabIndex = 14; 305 306 // 306 307 // openFileDialog … … 318 319 this.stopButton.Name = "stopButton"; 319 320 this.stopButton.Size = new System.Drawing.Size(24, 24); 320 this.stopButton.TabIndex = 1 0;321 this.stopButton.TabIndex = 11; 321 322 this.toolTip.SetToolTip(this.stopButton, "Stop Algorithm"); 322 323 this.stopButton.UseVisualStyleBackColor = true; … … 331 332 this.algorithmComboBox.Location = new System.Drawing.Point(72, 0); 332 333 this.algorithmComboBox.Name = "algorithmComboBox"; 333 this.algorithmComboBox.Size = new System.Drawing.Size(5 77, 21);334 this.algorithmComboBox.Size = new System.Drawing.Size(547, 21); 334 335 this.algorithmComboBox.TabIndex = 1; 335 336 this.algorithmComboBox.SelectedValueChanged += new System.EventHandler(this.algorithmComboBox_SelectedValueChanged); … … 351 352 this.refreshButton.Name = "refreshButton"; 352 353 this.refreshButton.Size = new System.Drawing.Size(24, 24); 353 this.refreshButton.TabIndex = 2;354 this.refreshButton.TabIndex = 3; 354 355 this.toolTip.SetToolTip(this.refreshButton, "Refresh Algorithms"); 355 356 this.refreshButton.UseVisualStyleBackColor = true; 356 357 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 357 358 // 358 // AlgorithmView 359 // cloneAlgorithmButton 360 // 361 this.cloneAlgorithmButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 362 this.cloneAlgorithmButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Clone; 363 this.cloneAlgorithmButton.Location = new System.Drawing.Point(625, -1); 364 this.cloneAlgorithmButton.Name = "cloneAlgorithmButton"; 365 this.cloneAlgorithmButton.Size = new System.Drawing.Size(24, 24); 366 this.cloneAlgorithmButton.TabIndex = 2; 367 this.toolTip.SetToolTip(this.cloneAlgorithmButton, "Clone Algorithm"); 368 this.cloneAlgorithmButton.UseVisualStyleBackColor = true; 369 this.cloneAlgorithmButton.Click += new System.EventHandler(this.cloneAlgorithmButton_Click); 370 // 371 // OKBAlgorithmView 359 372 // 360 373 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); … … 362 375 this.Controls.Add(this.algorithmComboBox); 363 376 this.Controls.Add(this.algorithmLabel); 377 this.Controls.Add(this.cloneAlgorithmButton); 364 378 this.Controls.Add(this.refreshButton); 365 379 this.Controls.Add(this.tabControl); … … 370 384 this.Controls.Add(this.stopButton); 371 385 this.Controls.Add(this.resetButton); 372 this.Name = " AlgorithmView";386 this.Name = "OKBAlgorithmView"; 373 387 this.Size = new System.Drawing.Size(679, 482); 374 388 this.Controls.SetChildIndex(this.resetButton, 0); … … 384 398 this.Controls.SetChildIndex(this.tabControl, 0); 385 399 this.Controls.SetChildIndex(this.refreshButton, 0); 400 this.Controls.SetChildIndex(this.cloneAlgorithmButton, 0); 386 401 this.Controls.SetChildIndex(this.algorithmLabel, 0); 387 402 this.Controls.SetChildIndex(this.algorithmComboBox, 0); … … 422 437 private System.Windows.Forms.Label algorithmLabel; 423 438 private System.Windows.Forms.Button refreshButton; 439 private System.Windows.Forms.Button cloneAlgorithmButton; 424 440 } 425 441 } -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBAlgorithmView.cs
r5647 r5660 124 124 base.SetEnabledStateOfControls(); 125 125 algorithmComboBox.Enabled = (Content != null) && !ReadOnly && !Locked && (algorithmComboBox.Items.Count > 0); 126 cloneAlgorithmButton.Enabled = (Content != null) && (Content.Problem != null) && !ReadOnly && !Locked; 126 127 refreshButton.Enabled = (Content != null) && !ReadOnly && !Locked; 127 128 parameterCollectionView.Enabled = Content != null; … … 246 247 247 248 #region Control Events 249 private void cloneAlgorithmButton_Click(object sender, EventArgs e) { 250 MainFormManager.MainForm.ShowContent((IContent)Content.Algorithm.Clone()); 251 } 248 252 private void refreshButton_Click(object sender, System.EventArgs e) { 249 253 RunCreationClient.Instance.Refresh(); -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBProblemView.Designer.cs
r5653 r5660 48 48 this.problemLabel = new System.Windows.Forms.Label(); 49 49 this.refreshButton = new System.Windows.Forms.Button(); 50 this.cloneProblemButton = new System.Windows.Forms.Button(); 51 this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView(); 52 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 50 53 this.SuspendLayout(); 54 // 55 // parameterCollectionView 56 // 57 this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 58 | System.Windows.Forms.AnchorStyles.Left) 59 | System.Windows.Forms.AnchorStyles.Right))); 60 this.parameterCollectionView.Content = null; 61 this.parameterCollectionView.Location = new System.Drawing.Point(0, 79); 62 this.parameterCollectionView.Name = "parameterCollectionView"; 63 this.parameterCollectionView.Size = new System.Drawing.Size(706, 314); 64 this.parameterCollectionView.TabIndex = 8; 65 // 66 // nameTextBox 67 // 68 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 69 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 70 this.nameTextBox.Location = new System.Drawing.Point(72, 27); 71 this.nameTextBox.Size = new System.Drawing.Size(634, 20); 72 this.nameTextBox.TabIndex = 5; 73 // 74 // nameLabel 75 // 76 this.nameLabel.Location = new System.Drawing.Point(3, 30); 77 this.nameLabel.TabIndex = 4; 78 // 79 // descriptionLabel 80 // 81 this.descriptionLabel.Location = new System.Drawing.Point(3, 56); 82 this.descriptionLabel.TabIndex = 6; 83 // 84 // descriptionTextBox 85 // 86 this.descriptionTextBox.Location = new System.Drawing.Point(72, 53); 87 this.descriptionTextBox.Size = new System.Drawing.Size(634, 20); 88 this.descriptionTextBox.TabIndex = 7; 51 89 // 52 90 // problemComboBox … … 56 94 this.problemComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 57 95 this.problemComboBox.FormattingEnabled = true; 58 this.problemComboBox.Location = new System.Drawing.Point( 57, 0);96 this.problemComboBox.Location = new System.Drawing.Point(72, 0); 59 97 this.problemComboBox.Name = "problemComboBox"; 60 this.problemComboBox.Size = new System.Drawing.Size(619, 21); 61 this.problemComboBox.TabIndex = 4; 98 this.problemComboBox.Size = new System.Drawing.Size(574, 21); 99 this.problemComboBox.TabIndex = 1; 100 this.problemComboBox.SelectedValueChanged += new System.EventHandler(this.problemComboBox_SelectedValueChanged); 62 101 // 63 102 // problemLabel … … 67 106 this.problemLabel.Name = "problemLabel"; 68 107 this.problemLabel.Size = new System.Drawing.Size(48, 13); 69 this.problemLabel.TabIndex = 3;108 this.problemLabel.TabIndex = 0; 70 109 this.problemLabel.Text = "&Problem:"; 71 110 // … … 73 112 // 74 113 this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 114 this.refreshButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh; 75 115 this.refreshButton.Location = new System.Drawing.Point(682, -1); 76 116 this.refreshButton.Name = "refreshButton"; 77 117 this.refreshButton.Size = new System.Drawing.Size(24, 24); 78 this.refreshButton.TabIndex = 5; 118 this.refreshButton.TabIndex = 3; 119 this.toolTip.SetToolTip(this.refreshButton, "Refresh Problems"); 79 120 this.refreshButton.UseVisualStyleBackColor = true; 80 121 this.refreshButton.Click += new System.EventHandler(this.refreshButton_Click); 122 // 123 // cloneProblemButton 124 // 125 this.cloneProblemButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 126 this.cloneProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Clone; 127 this.cloneProblemButton.Location = new System.Drawing.Point(652, -1); 128 this.cloneProblemButton.Name = "cloneProblemButton"; 129 this.cloneProblemButton.Size = new System.Drawing.Size(24, 24); 130 this.cloneProblemButton.TabIndex = 2; 131 this.toolTip.SetToolTip(this.cloneProblemButton, "Clone Problem"); 132 this.cloneProblemButton.UseVisualStyleBackColor = true; 133 this.cloneProblemButton.Click += new System.EventHandler(this.cloneProblemButton_Click); 81 134 // 82 135 // OKBProblemView … … 86 139 this.Controls.Add(this.problemComboBox); 87 140 this.Controls.Add(this.problemLabel); 141 this.Controls.Add(this.cloneProblemButton); 88 142 this.Controls.Add(this.refreshButton); 143 this.Controls.Add(this.parameterCollectionView); 89 144 this.Name = "OKBProblemView"; 90 145 this.Size = new System.Drawing.Size(706, 393); 146 this.Controls.SetChildIndex(this.refreshButton, 0); 147 this.Controls.SetChildIndex(this.cloneProblemButton, 0); 148 this.Controls.SetChildIndex(this.problemLabel, 0); 149 this.Controls.SetChildIndex(this.descriptionLabel, 0); 150 this.Controls.SetChildIndex(this.parameterCollectionView, 0); 151 this.Controls.SetChildIndex(this.nameTextBox, 0); 152 this.Controls.SetChildIndex(this.descriptionTextBox, 0); 153 this.Controls.SetChildIndex(this.nameLabel, 0); 154 this.Controls.SetChildIndex(this.problemComboBox, 0); 155 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 91 156 this.ResumeLayout(false); 92 157 this.PerformLayout(); … … 99 164 private System.Windows.Forms.Label problemLabel; 100 165 private System.Windows.Forms.Button refreshButton; 166 private System.Windows.Forms.Button cloneProblemButton; 167 private HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView; 101 168 102 169 -
branches/OKB (trunk integration)/HeuristicLab.Clients.OKB/3.3/RunCreation/Views/OKBProblemView.cs
r5653 r5660 20 20 #endregion 21 21 22 using System; 23 using System.Linq; 24 using System.Windows.Forms; 25 using HeuristicLab.Common; 22 26 using HeuristicLab.Core.Views; 23 27 using HeuristicLab.MainForm; … … 26 30 [View("OKBProblem View")] 27 31 [Content(typeof(OKBProblem), true)] 28 public partial class OKBProblemView : ParameterizedNamedItemView {32 public partial class OKBProblemView : NamedItemView { 29 33 public new OKBProblem Content { 30 34 get { return (OKBProblem)base.Content; } … … 36 40 } 37 41 42 protected override void OnInitialized(System.EventArgs e) { 43 base.OnInitialized(e); 44 RunCreationClient.Instance.Refreshing += new EventHandler(RunCreationClient_Refreshing); 45 RunCreationClient.Instance.Refreshed += new EventHandler(RunCreationClient_Refreshed); 46 PopulateComboBox(); 47 } 48 49 protected override void DeregisterContentEvents() { 50 Content.ProblemChanged -= new EventHandler(Content_ProblemChanged); 51 base.DeregisterContentEvents(); 52 } 53 protected override void RegisterContentEvents() { 54 base.RegisterContentEvents(); 55 Content.ProblemChanged += new EventHandler(Content_ProblemChanged); 56 } 57 38 58 protected override void OnContentChanged() { 39 59 base.OnContentChanged(); 60 if (Content == null) { 61 problemComboBox.SelectedIndex = -1; 62 parameterCollectionView.Content = null; 63 } else { 64 problemComboBox.SelectedItem = RunCreationClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId); 65 parameterCollectionView.Content = Content.Parameters; 66 } 40 67 } 41 68 69 protected override void SetEnabledStateOfControls() { 70 base.SetEnabledStateOfControls(); 71 problemComboBox.Enabled = (Content != null) && !ReadOnly && !Locked && (problemComboBox.Items.Count > 0); 72 cloneProblemButton.Enabled = (Content != null) && (Content.Problem != null) && !ReadOnly && !Locked; 73 refreshButton.Enabled = (Content != null) && !ReadOnly && !Locked; 74 parameterCollectionView.Enabled = Content != null; 75 } 76 77 protected override void OnClosed(FormClosedEventArgs e) { 78 RunCreationClient.Instance.Refreshing -= new EventHandler(RunCreationClient_Refreshing); 79 RunCreationClient.Instance.Refreshed -= new EventHandler(RunCreationClient_Refreshed); 80 base.OnClosed(e); 81 } 82 83 private void RunCreationClient_Refreshing(object sender, EventArgs e) { 84 if (InvokeRequired) { 85 Invoke(new EventHandler(RunCreationClient_Refreshing), sender, e); 86 } else { 87 Cursor = Cursors.AppStarting; 88 problemComboBox.Enabled = refreshButton.Enabled = false; 89 } 90 } 91 private void RunCreationClient_Refreshed(object sender, EventArgs e) { 92 if (InvokeRequired) { 93 Invoke(new EventHandler(RunCreationClient_Refreshed), sender, e); 94 } else { 95 PopulateComboBox(); 96 SetEnabledStateOfControls(); 97 Cursor = Cursors.Default; 98 } 99 } 100 101 #region Content Events 102 private void Content_ProblemChanged(object sender, EventArgs e) { 103 if (InvokeRequired) 104 Invoke(new EventHandler(Content_ProblemChanged), sender, e); 105 else { 106 problemComboBox.SelectedItem = RunCreationClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId); 107 } 108 } 109 #endregion 110 111 #region Control Events 112 private void cloneProblemButton_Click(object sender, EventArgs e) { 113 MainFormManager.MainForm.ShowContent((IContent)Content.Problem.Clone()); 114 } 42 115 private void refreshButton_Click(object sender, System.EventArgs e) { 116 RunCreationClient.Instance.Refresh(); 117 } 118 private void problemComboBox_SelectedValueChanged(object sender, System.EventArgs e) { 119 Problem problem = problemComboBox.SelectedValue as Problem; 120 if ((problem != null) && (Content != null)) { 121 Content.Load(problem.Id); 122 if (Content.ProblemId != problem.Id) // reset selected item if load was not successful 123 problemComboBox.SelectedItem = RunCreationClient.Instance.Problems.FirstOrDefault(x => x.Id == Content.ProblemId); 124 } 125 } 126 #endregion 43 127 128 #region Helpers 129 private void PopulateComboBox() { 130 problemComboBox.DataSource = null; 131 problemComboBox.DataSource = RunCreationClient.Instance.Problems.ToList(); 132 problemComboBox.DisplayMember = "Name"; 44 133 } 134 #endregion 45 135 } 46 136 }
Note: See TracChangeset
for help on using the changeset viewer.