Changeset 3299 for trunk/sources
- Timestamp:
- 04/11/10 03:59:22 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.Designer.cs
r3298 r3299 83 83 this.listView.View = System.Windows.Forms.View.Details; 84 84 this.listView.SelectedIndexChanged += new System.EventHandler(this.listView_SelectedIndexChanged); 85 this.listView.SizeChanged += new System.EventHandler(this.listView_SizeChanged);86 85 this.listView.DoubleClick += new System.EventHandler(this.listView_DoubleClick); 87 86 this.listView.DragDrop += new System.Windows.Forms.DragEventHandler(this.listView_DragDrop); … … 178 177 // saveButton 179 178 // 180 this.saveButton.Enabled = false;181 179 this.saveButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save; 182 180 this.saveButton.Location = new System.Drawing.Point(120, 0); -
trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.cs
r3298 r3299 101 101 item.ToStringChanged += new EventHandler(Item_ToStringChanged); 102 102 sortAscendingButton.Enabled = sortDescendingButton.Enabled = listView.Items.Count > 1; 103 saveButton.Enabled = listView.Items.Count > 0;103 AdjustListViewColumnSizes(); 104 104 } 105 105 } … … 114 114 itemListViewItemTable.Remove(item); 115 115 sortAscendingButton.Enabled = sortDescendingButton.Enabled = listView.Items.Count > 1; 116 saveButton.Enabled = listView.Items.Count > 0;117 116 } 118 117 } … … 204 203 private void listView_SelectedIndexChanged(object sender, EventArgs e) { 205 204 removeButton.Enabled = listView.SelectedItems.Count > 0; 206 }207 private void listView_SizeChanged(object sender, EventArgs e) {208 if (listView.Columns.Count > 0)209 listView.Columns[0].Width = Math.Max(0, listView.Width - 25);210 205 } 211 206 private void listView_KeyDown(object sender, KeyEventArgs e) { … … 294 289 itemListViewItemTable[item].Text = item.ToString(); 295 290 listView.Sort(); 291 AdjustListViewColumnSizes(); 292 } 293 } 294 #endregion 295 296 #region Helpers 297 private void AdjustListViewColumnSizes() { 298 if (listView.Items.Count > 0) { 299 for (int i = 0; i < listView.Columns.Count; i++) 300 listView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 296 301 } 297 302 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs
r3281 r3299 50 50 this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView(); 51 51 this.problemTabPage = new System.Windows.Forms.TabPage(); 52 this.problemPanel = new System.Windows.Forms.Panel(); 53 this.problemViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 52 54 this.saveProblemButton = new System.Windows.Forms.Button(); 53 55 this.openProblemButton = new System.Windows.Forms.Button(); 54 56 this.newProblemButton = new System.Windows.Forms.Button(); 55 this.problemViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();56 57 this.resultsTabPage = new System.Windows.Forms.TabPage(); 57 58 this.resultsView = new HeuristicLab.Optimization.Views.ResultCollectionView(); 59 this.runsTabPage = new System.Windows.Forms.TabPage(); 60 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); 58 61 this.startButton = new System.Windows.Forms.Button(); 59 62 this.pauseButton = new System.Windows.Forms.Button(); … … 64 67 this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); 65 68 this.stopButton = new System.Windows.Forms.Button(); 66 this.runsTabPage = new System.Windows.Forms.TabPage();67 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView();68 69 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 69 70 this.tabControl.SuspendLayout(); 70 71 this.parametersTabPage.SuspendLayout(); 71 72 this.problemTabPage.SuspendLayout(); 73 this.problemPanel.SuspendLayout(); 72 74 this.resultsTabPage.SuspendLayout(); 73 75 this.runsTabPage.SuspendLayout(); … … 124 126 // problemTabPage 125 127 // 128 this.problemTabPage.Controls.Add(this.problemPanel); 126 129 this.problemTabPage.Controls.Add(this.saveProblemButton); 127 130 this.problemTabPage.Controls.Add(this.openProblemButton); 128 131 this.problemTabPage.Controls.Add(this.newProblemButton); 129 this.problemTabPage.Controls.Add(this.problemViewHost);130 132 this.problemTabPage.Location = new System.Drawing.Point(4, 22); 131 133 this.problemTabPage.Name = "problemTabPage"; … … 135 137 this.problemTabPage.Text = "Problem"; 136 138 this.problemTabPage.UseVisualStyleBackColor = true; 139 // 140 // problemPanel 141 // 142 this.problemPanel.AllowDrop = true; 143 this.problemPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 144 | System.Windows.Forms.AnchorStyles.Left) 145 | System.Windows.Forms.AnchorStyles.Right))); 146 this.problemPanel.Controls.Add(this.problemViewHost); 147 this.problemPanel.Location = new System.Drawing.Point(6, 36); 148 this.problemPanel.Name = "problemPanel"; 149 this.problemPanel.Size = new System.Drawing.Size(659, 332); 150 this.problemPanel.TabIndex = 3; 151 this.problemPanel.DragOver += new System.Windows.Forms.DragEventHandler(this.problemPanel_DragEnterOver); 152 this.problemPanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.problemPanel_DragDrop); 153 this.problemPanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.problemPanel_DragEnterOver); 154 // 155 // problemViewHost 156 // 157 this.problemViewHost.Content = null; 158 this.problemViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 159 this.problemViewHost.Location = new System.Drawing.Point(0, 0); 160 this.problemViewHost.Name = "problemViewHost"; 161 this.problemViewHost.Size = new System.Drawing.Size(659, 332); 162 this.problemViewHost.TabIndex = 0; 163 this.problemViewHost.ViewType = null; 137 164 // 138 165 // saveProblemButton … … 169 196 this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click); 170 197 // 171 // problemViewHost172 //173 this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)174 | System.Windows.Forms.AnchorStyles.Left)175 | System.Windows.Forms.AnchorStyles.Right)));176 this.problemViewHost.Content = null;177 this.problemViewHost.Location = new System.Drawing.Point(6, 36);178 this.problemViewHost.Name = "problemViewHost";179 this.problemViewHost.Size = new System.Drawing.Size(659, 332);180 this.problemViewHost.TabIndex = 3;181 this.problemViewHost.ViewType = null;182 //183 198 // resultsTabPage 184 199 // … … 203 218 this.resultsView.Size = new System.Drawing.Size(659, 362); 204 219 this.resultsView.TabIndex = 0; 220 // 221 // runsTabPage 222 // 223 this.runsTabPage.Controls.Add(this.runsView); 224 this.runsTabPage.Location = new System.Drawing.Point(4, 22); 225 this.runsTabPage.Name = "runsTabPage"; 226 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3); 227 this.runsTabPage.Size = new System.Drawing.Size(671, 374); 228 this.runsTabPage.TabIndex = 3; 229 this.runsTabPage.Text = "Runs"; 230 this.runsTabPage.UseVisualStyleBackColor = true; 231 // 232 // runsView 233 // 234 this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 235 | System.Windows.Forms.AnchorStyles.Left) 236 | System.Windows.Forms.AnchorStyles.Right))); 237 this.runsView.Caption = "RunCollection"; 238 this.runsView.Content = null; 239 this.runsView.Location = new System.Drawing.Point(6, 6); 240 this.runsView.Name = "runsView"; 241 this.runsView.Size = new System.Drawing.Size(659, 362); 242 this.runsView.TabIndex = 0; 205 243 // 206 244 // startButton … … 285 323 this.stopButton.UseVisualStyleBackColor = true; 286 324 this.stopButton.Click += new System.EventHandler(this.stopButton_Click); 287 //288 // runsTabPage289 //290 this.runsTabPage.Controls.Add(this.runsView);291 this.runsTabPage.Location = new System.Drawing.Point(4, 22);292 this.runsTabPage.Name = "runsTabPage";293 this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);294 this.runsTabPage.Size = new System.Drawing.Size(671, 374);295 this.runsTabPage.TabIndex = 3;296 this.runsTabPage.Text = "Runs";297 this.runsTabPage.UseVisualStyleBackColor = true;298 //299 // runsView300 //301 this.runsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)302 | System.Windows.Forms.AnchorStyles.Left)303 | System.Windows.Forms.AnchorStyles.Right)));304 this.runsView.Caption = "RunCollection";305 this.runsView.Content = null;306 this.runsView.Location = new System.Drawing.Point(6, 6);307 this.runsView.Name = "runsView";308 this.runsView.Size = new System.Drawing.Size(659, 362);309 this.runsView.TabIndex = 0;310 325 // 311 326 // AlgorithmView … … 337 352 this.parametersTabPage.ResumeLayout(false); 338 353 this.problemTabPage.ResumeLayout(false); 354 this.problemPanel.ResumeLayout(false); 339 355 this.resultsTabPage.ResumeLayout(false); 340 356 this.runsTabPage.ResumeLayout(false); … … 366 382 protected System.Windows.Forms.TabPage runsTabPage; 367 383 protected RunCollectionView runsView; 384 protected System.Windows.Forms.Panel problemPanel; 368 385 369 386 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
r3275 r3299 163 163 #endregion 164 164 165 #region Button events165 #region Control Events 166 166 protected virtual void newProblemButton_Click(object sender, EventArgs e) { 167 167 if (problemTypeSelectorDialog == null) { … … 247 247 } 248 248 } 249 protected virtual void problemPanel_DragEnterOver(object sender, DragEventArgs e) { 250 e.Effect = DragDropEffects.None; 251 Type type = e.Data.GetData("Type") as Type; 252 if ((type != null) && (Content.ProblemType.IsAssignableFrom(type))) { 253 if ((e.KeyState & 8) == 8) e.Effect = DragDropEffects.Copy; // CTRL key 254 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key 255 else if ((e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) e.Effect = DragDropEffects.Link; 256 else if ((e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) e.Effect = DragDropEffects.Copy; 257 else if ((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) e.Effect = DragDropEffects.Move; 258 } 259 } 260 protected virtual void problemPanel_DragDrop(object sender, DragEventArgs e) { 261 if (e.Effect != DragDropEffects.None) { 262 IProblem problem = e.Data.GetData("Value") as IProblem; 263 if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) problem = (IProblem)problem.Clone(); 264 Content.Problem = problem; 265 } 266 } 249 267 #endregion 250 268 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.Designer.cs
r3281 r3299 48 48 this.tabControl = new System.Windows.Forms.TabControl(); 49 49 this.algorithmTabPage = new System.Windows.Forms.TabPage(); 50 this.algorithmPanel = new System.Windows.Forms.Panel(); 51 this.algorithmViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 50 52 this.saveAlgorithmButton = new System.Windows.Forms.Button(); 51 53 this.openAlgorithmButton = new System.Windows.Forms.Button(); 52 54 this.newAlgorithmButton = new System.Windows.Forms.Button(); 53 this.algorithmViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();54 55 this.runsTabPage = new System.Windows.Forms.TabPage(); 55 56 this.runsView = new HeuristicLab.Optimization.Views.RunCollectionView(); … … 67 68 this.tabControl.SuspendLayout(); 68 69 this.algorithmTabPage.SuspendLayout(); 70 this.algorithmPanel.SuspendLayout(); 69 71 this.runsTabPage.SuspendLayout(); 70 72 ((System.ComponentModel.ISupportInitialize)(this.repetitionsNumericUpDown)).BeginInit(); … … 96 98 // algorithmTabPage 97 99 // 100 this.algorithmTabPage.Controls.Add(this.algorithmPanel); 98 101 this.algorithmTabPage.Controls.Add(this.saveAlgorithmButton); 99 102 this.algorithmTabPage.Controls.Add(this.openAlgorithmButton); 100 103 this.algorithmTabPage.Controls.Add(this.newAlgorithmButton); 101 this.algorithmTabPage.Controls.Add(this.algorithmViewHost);102 104 this.algorithmTabPage.Location = new System.Drawing.Point(4, 22); 103 105 this.algorithmTabPage.Name = "algorithmTabPage"; … … 107 109 this.algorithmTabPage.Text = "Algorithm"; 108 110 this.algorithmTabPage.UseVisualStyleBackColor = true; 111 // 112 // algorithmPanel 113 // 114 this.algorithmPanel.AllowDrop = true; 115 this.algorithmPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 116 | System.Windows.Forms.AnchorStyles.Left) 117 | System.Windows.Forms.AnchorStyles.Right))); 118 this.algorithmPanel.Controls.Add(this.algorithmViewHost); 119 this.algorithmPanel.Location = new System.Drawing.Point(6, 36); 120 this.algorithmPanel.Name = "algorithmPanel"; 121 this.algorithmPanel.Size = new System.Drawing.Size(659, 306); 122 this.algorithmPanel.TabIndex = 3; 123 this.algorithmPanel.DragOver += new System.Windows.Forms.DragEventHandler(this.algorithmPanel_DragEnterOver); 124 this.algorithmPanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.algorithmPanel_DragDrop); 125 this.algorithmPanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.algorithmPanel_DragEnterOver); 126 // 127 // algorithmViewHost 128 // 129 this.algorithmViewHost.Content = null; 130 this.algorithmViewHost.Dock = System.Windows.Forms.DockStyle.Fill; 131 this.algorithmViewHost.Location = new System.Drawing.Point(0, 0); 132 this.algorithmViewHost.Name = "algorithmViewHost"; 133 this.algorithmViewHost.Size = new System.Drawing.Size(659, 306); 134 this.algorithmViewHost.TabIndex = 0; 135 this.algorithmViewHost.ViewType = null; 109 136 // 110 137 // saveAlgorithmButton … … 140 167 this.newAlgorithmButton.UseVisualStyleBackColor = true; 141 168 this.newAlgorithmButton.Click += new System.EventHandler(this.newAlgorithmButton_Click); 142 //143 // algorithmViewHost144 //145 this.algorithmViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)146 | System.Windows.Forms.AnchorStyles.Left)147 | System.Windows.Forms.AnchorStyles.Right)));148 this.algorithmViewHost.Content = null;149 this.algorithmViewHost.Location = new System.Drawing.Point(6, 36);150 this.algorithmViewHost.Name = "algorithmViewHost";151 this.algorithmViewHost.Size = new System.Drawing.Size(659, 306);152 this.algorithmViewHost.TabIndex = 3;153 this.algorithmViewHost.ViewType = null;154 169 // 155 170 // runsTabPage … … 279 294 0, 280 295 0}); 281 this.repetitionsNumericUpDown.Validated += new System.EventHandler(repetitionsNumericUpDown_Validated);282 296 this.repetitionsNumericUpDown.ValueChanged += new System.EventHandler(this.repetitionsNumericUpDown_ValueChanged); 297 this.repetitionsNumericUpDown.Validated += new System.EventHandler(this.repetitionsNumericUpDown_Validated); 283 298 // 284 299 // pauseButton … … 325 340 this.tabControl.ResumeLayout(false); 326 341 this.algorithmTabPage.ResumeLayout(false); 342 this.algorithmPanel.ResumeLayout(false); 327 343 this.runsTabPage.ResumeLayout(false); 328 344 ((System.ComponentModel.ISupportInitialize)(this.repetitionsNumericUpDown)).EndInit(); … … 351 367 private RunCollectionView runsView; 352 368 private System.Windows.Forms.Button pauseButton; 369 private System.Windows.Forms.Panel algorithmPanel; 353 370 354 371 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs
r3274 r3299 235 235 } 236 236 } 237 private void algorithmPanel_DragEnterOver(object sender, DragEventArgs e) { 238 e.Effect = DragDropEffects.None; 239 Type type = e.Data.GetData("Type") as Type; 240 if ((type != null) && (typeof(IAlgorithm).IsAssignableFrom(type))) { 241 if ((e.KeyState & 8) == 8) e.Effect = DragDropEffects.Copy; // CTRL key 242 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key 243 else if ((e.AllowedEffect & DragDropEffects.Link) == DragDropEffects.Link) e.Effect = DragDropEffects.Link; 244 else if ((e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy) e.Effect = DragDropEffects.Copy; 245 else if ((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move) e.Effect = DragDropEffects.Move; 246 } 247 } 248 private void algorithmPanel_DragDrop(object sender, DragEventArgs e) { 249 if (e.Effect != DragDropEffects.None) { 250 IAlgorithm algorithm = e.Data.GetData("Value") as IAlgorithm; 251 if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) algorithm = (IAlgorithm)algorithm.Clone(); 252 Content.Algorithm = algorithm; 253 } 254 } 237 255 #endregion 238 256
Note: See TracChangeset
for help on using the changeset viewer.