Changeset 17124
- Timestamp:
- 07/11/19 00:22:56 (5 years ago)
- Location:
- stable
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 17007-17008,17118
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Core.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Core.Views merged: 17007-17008,17118
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs
r17097 r17124 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 -
stable/HeuristicLab.Core.Views/3.3/ItemArrayView.cs
r17097 r17124 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 } -
stable/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs
r17097 r17124 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 -
stable/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r17097 r17124 104 104 if (Content != null) { 105 105 Caption += " (" + Content.GetType().Name + ")"; 106 foreach (T item in Content )106 foreach (T item in Content.OrderBy(x => x.ToString())) 107 107 AddListViewItem(CreateListViewItem(item)); 108 108 AdjustListViewColumnSizes(); 109 SortItemsListView(SortOrder.Ascending);110 109 } 111 110 } … … 221 220 protected virtual void itemsListView_SelectedIndexChanged(object sender, EventArgs e) { 222 221 removeButton.Enabled = (Content != null) && !Content.IsReadOnly && !ReadOnly && itemsListView.SelectedItems.Count > 0; 223 AdjustListViewColumnSizes();224 222 if (showDetailsCheckBox.Checked) { 225 223 if (itemsListView.SelectedItems.Count == 1) { … … 327 325 } 328 326 } 327 protected virtual void itemsListView_Layout(object sender, LayoutEventArgs e) { 328 if (itemsListView.Columns.Count == 1) 329 AdjustListViewColumnSizes(); 330 } 329 331 #endregion 330 332 … … 423 425 foreach (ListViewItem listViewItem in GetListViewItemsForItem(item)) 424 426 UpdateListViewItemText(listViewItem); 425 AdjustListViewColumnSizes(); 427 if (itemsListView.Columns.Count > 1) 428 AdjustListViewColumnSizes(); 426 429 } 427 430 } … … 435 438 } 436 439 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); 440 if (itemsListView.Columns.Count == 1) { 441 if (itemsListView.Columns[0].Width != itemsListView.ClientSize.Width) 442 itemsListView.Columns[0].Width = itemsListView.ClientSize.Width; 443 } else { 444 if (itemsListView.Items.Count > 0) { 445 for (int i = 0; i < itemsListView.Columns.Count; i++) 446 itemsListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 447 } 440 448 } 441 449 } -
stable/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs
r17097 r17124 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 -
stable/HeuristicLab.Core.Views/3.3/ItemListView.cs
r17097 r17124 242 242 removeButton.Enabled = itemsListView.SelectedItems.Count > 0 && 243 243 (Content != null) && !Content.IsReadOnly && !ReadOnly; 244 AdjustListViewColumnSizes(); 245 244 246 245 if (showDetailsCheckBox.Checked) { 247 246 if (itemsListView.SelectedItems.Count == 1) { … … 354 353 } 355 354 } 355 protected virtual void itemsListView_Layout(object sender, LayoutEventArgs e) { 356 if (itemsListView.Columns.Count == 1) 357 AdjustListViewColumnSizes(); 358 } 356 359 #endregion 357 360 … … 494 497 foreach (ListViewItem listViewItem in GetListViewItemsForItem(item)) 495 498 UpdateListViewItemText(listViewItem); 496 AdjustListViewColumnSizes(); 499 if (itemsListView.Columns.Count > 1) 500 AdjustListViewColumnSizes(); 497 501 } 498 502 } … … 501 505 #region Helpers 502 506 protected virtual void AdjustListViewColumnSizes() { 503 if (itemsListView.Items.Count > 0) { 504 for (int i = 0; i < itemsListView.Columns.Count; i++) 505 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 } 506 515 } 507 516 }
Note: See TracChangeset
for help on using the changeset viewer.