Changeset 17008
- Timestamp:
- 06/14/19 12:25:54 (5 years ago)
- Location:
- trunk/HeuristicLab.Core.Views/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs
r16565 r17008 20 20 #endregion 21 21 22 using System.Security.AccessControl;23 22 using System.Windows.Forms; 24 23 … … 154 153 this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick); 155 154 this.itemsListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.itemsListView_KeyDown); 155 this.itemsListView.Layout += new System.Windows.Forms.LayoutEventHandler(this.itemsListView_Layout); 156 // 157 // listViewColumnHeader 158 // 159 this.listViewColumnHeader.Width = 190; 156 160 // 157 161 // imageList -
trunk/HeuristicLab.Core.Views/3.3/ItemArrayView.cs
r16565 r17008 237 237 (Content != null) && !Content.IsReadOnly && !ReadOnly; 238 238 removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && (Content != null) && !Content.IsReadOnly && !ReadOnly; 239 AdjustListViewColumnSizes();240 239 241 240 if (showDetailsCheckBox.Checked) { … … 330 329 } 331 330 } 331 protected virtual void itemsListView_Layout(object sender, LayoutEventArgs e) { 332 if (itemsListView.Columns.Count == 1) 333 AdjustListViewColumnSizes(); 334 } 332 335 #endregion 333 336 … … 453 456 foreach (ListViewItem listViewItem in GetListViewItemsForItem(item)) 454 457 UpdateListViewItemText(listViewItem); 455 AdjustListViewColumnSizes(); 458 if (itemsListView.Columns.Count > 1) 459 AdjustListViewColumnSizes(); 456 460 } 457 461 } … … 460 464 #region Helpers 461 465 protected virtual void AdjustListViewColumnSizes() { 462 if (itemsListView.Items.Count > 0) { 463 for (int i = 0; i < itemsListView.Columns.Count; i++) 464 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 466 if (itemsListView.Columns.Count == 1) { 467 if (itemsListView.Columns[0].Width != itemsListView.ClientSize.Width) 468 itemsListView.Columns[0].Width = itemsListView.ClientSize.Width; 469 } else { 470 if (itemsListView.Items.Count > 0) { 471 for (int i = 0; i < itemsListView.Columns.Count; i++) 472 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 473 } 465 474 } 466 475 } -
trunk/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs
r16565 r17008 20 20 #endregion 21 21 22 using System.Security.AccessControl;23 22 using System.Windows.Forms; 24 23 … … 107 106 this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick); 108 107 this.itemsListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.itemsListView_KeyDown); 108 this.itemsListView.Layout += new System.Windows.Forms.LayoutEventHandler(this.itemsListView_Layout); 109 // 110 // columnHeader1 111 // 112 this.columnHeader1.Width = 240; 109 113 // 110 114 // imageList -
trunk/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r16565 r17008 221 221 protected virtual void itemsListView_SelectedIndexChanged(object sender, EventArgs e) { 222 222 removeButton.Enabled = (Content != null) && !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0; 223 AdjustListViewColumnSizes();224 223 if (showDetailsCheckBox.Checked) { 225 224 if (itemsListView.SelectedItems.Count == 1) { … … 327 326 } 328 327 } 328 protected virtual void itemsListView_Layout(object sender, LayoutEventArgs e) { 329 if (itemsListView.Columns.Count == 1) 330 AdjustListViewColumnSizes(); 331 } 329 332 #endregion 330 333 … … 423 426 foreach (ListViewItem listViewItem in GetListViewItemsForItem(item)) 424 427 UpdateListViewItemText(listViewItem); 425 AdjustListViewColumnSizes(); 428 if (itemsListView.Columns.Count > 1) 429 AdjustListViewColumnSizes(); 426 430 } 427 431 } … … 435 439 } 436 440 protected virtual void AdjustListViewColumnSizes() { 437 if (itemsListView.Items.Count > 0) { 438 for (int i = 0; i < itemsListView.Columns.Count; i++) 439 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 441 if (itemsListView.Columns.Count == 1) { 442 if (itemsListView.Columns[0].Width != itemsListView.ClientSize.Width) 443 itemsListView.Columns[0].Width = itemsListView.ClientSize.Width; 444 } else { 445 if (itemsListView.Items.Count > 0) { 446 for (int i = 0; i < itemsListView.Columns.Count; i++) 447 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 448 } 440 449 } 441 450 } -
trunk/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs
r16565 r17008 155 155 this.itemsListView.DoubleClick += new System.EventHandler(this.itemsListView_DoubleClick); 156 156 this.itemsListView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.itemsListView_KeyDown); 157 this.itemsListView.Layout += new System.Windows.Forms.LayoutEventHandler(this.itemsListView_Layout); 158 // 159 // listViewColumnHeader 160 // 161 this.listViewColumnHeader.Width = 190; 157 162 // 158 163 // imageList -
trunk/HeuristicLab.Core.Views/3.3/ItemListView.cs
r17007 r17008 353 353 } 354 354 } 355 protected virtual void itemsListView_Layout(object sender, LayoutEventArgs e) { 356 if (itemsListView.Columns.Count == 1) 357 AdjustListViewColumnSizes(); 358 } 355 359 #endregion 356 360 … … 493 497 foreach (ListViewItem listViewItem in GetListViewItemsForItem(item)) 494 498 UpdateListViewItemText(listViewItem); 495 AdjustListViewColumnSizes(); 499 if (itemsListView.Columns.Count > 1) 500 AdjustListViewColumnSizes(); 496 501 } 497 502 } … … 500 505 #region Helpers 501 506 protected virtual void AdjustListViewColumnSizes() { 502 if (itemsListView.Items.Count > 0) { 503 for (int i = 0; i < itemsListView.Columns.Count; i++) 504 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 507 if (itemsListView.Columns.Count == 1) { 508 if (itemsListView.Columns[0].Width != itemsListView.ClientSize.Width) 509 itemsListView.Columns[0].Width = itemsListView.ClientSize.Width; 510 } else { 511 if (itemsListView.Items.Count > 0) { 512 for (int i = 0; i < itemsListView.Columns.Count; i++) 513 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 514 } 505 515 } 506 516 }
Note: See TracChangeset
for help on using the changeset viewer.