Changeset 3350 for trunk/sources/HeuristicLab.Core.Views/3.3
- Timestamp:
- 04/15/10 01:34:27 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Core.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r3341 r3350 69 69 Caption = "Item Collection"; 70 70 while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]); 71 itemsListView.Enabled = false;72 detailsGroupBox.Enabled = false;73 71 viewHost.Content = null; 74 addButton.Enabled = false;75 sortAscendingButton.Enabled = false;76 sortDescendingButton.Enabled = false;77 removeButton.Enabled = false;78 79 72 if (Content != null) { 80 73 Caption += " (" + Content.GetType().Name + ")"; 81 itemsListView.Enabled = true;82 addButton.Enabled = !Content.IsReadOnly;83 74 foreach (T item in Content) 84 75 AddListViewItem(CreateListViewItem(item)); 76 SortItemsListView(SortOrder.Ascending); 77 } 78 SetEnableStateOfControls(); 79 } 80 81 protected override void OnReadOnlyChanged() { 82 base.OnReadOnlyChanged(); 83 SetEnableStateOfControls(); 84 } 85 private void SetEnableStateOfControls() { 86 if (Content == null) { 87 itemsListView.Enabled = false; 88 detailsGroupBox.Enabled = false; 85 89 sortAscendingButton.Enabled = itemsListView.Items.Count > 0; 86 90 sortDescendingButton.Enabled = itemsListView.Items.Count > 0; 87 SortItemsListView(SortOrder.Ascending); 91 viewHost.Enabled = false; 92 addButton.Enabled = false; 93 removeButton.Enabled = false; 94 } else { 95 itemsListView.Enabled = true; 96 detailsGroupBox.Enabled = true; 97 sortAscendingButton.Enabled = true; 98 sortDescendingButton.Enabled = true; 99 viewHost.Enabled = true; 100 viewHost.ReadOnly = ReadOnly; 101 addButton.Enabled = !ReadOnly; 102 removeButton.Enabled = !ReadOnly; 88 103 } 89 104 } -
trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemView.cs
r2917 r3350 66 66 Caption = "NamedItem"; 67 67 nameTextBox.Text = "-"; 68 nameTextBox.Enabled = false;69 68 descriptionTextBox.Text = ""; 70 descriptionTextBox.Enabled = false;71 69 toolTip.SetToolTip(descriptionTextBox, string.Empty); 72 70 } else { 73 71 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 74 72 nameTextBox.Text = Content.Name; 75 nameTextBox.ReadOnly = !Content.CanChangeName; 73 descriptionTextBox.Text = Content.Description; 74 toolTip.SetToolTip(descriptionTextBox, Content.Description); 75 } 76 SetEnableStateOfControls(); 77 } 78 79 protected override void OnReadOnlyChanged() { 80 base.OnReadOnlyChanged(); 81 SetEnableStateOfControls(); 82 } 83 private void SetEnableStateOfControls() { 84 if (Content == null) { 85 nameTextBox.Enabled = false; 86 descriptionTextBox.Enabled = false; 87 } else { 76 88 nameTextBox.Enabled = true; 77 descriptionTextBox.Text = Content.Description; 78 descriptionTextBox.ReadOnly = !Content.CanChangeDescription; 89 nameTextBox.ReadOnly = ReadOnly || !Content.CanChangeName; ; 79 90 descriptionTextBox.Enabled = true; 80 toolTip.SetToolTip(descriptionTextBox, Content.Description);91 descriptionTextBox.ReadOnly = ReadOnly || !Content.CanChangeDescription; 81 92 } 82 93 }
Note: See TracChangeset
for help on using the changeset viewer.