Changeset 3350 for trunk/sources/HeuristicLab.Optimization.Views
- Timestamp:
- 04/15/10 01:34:27 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/ResultCollectionView.cs
r3274 r3350 30 30 [Content(typeof(IObservableKeyedCollection<string, IResult>), false)] 31 31 public partial class ResultCollectionView : NamedItemCollectionView<IResult> { 32 public override bool ReadOnly { 33 get { return base.ReadOnly; } 34 set { /*not needed because results are always readonly */} 35 } 32 36 /// <summary> 33 37 /// Initializes a new instance of <see cref="VariablesScopeView"/> with caption "Variables Scope View". … … 37 41 Caption = "ResultCollection"; 38 42 itemsGroupBox.Text = "Results"; 43 base.ReadOnly = true; 39 44 } 40 45 /// <summary> -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ResultView.cs
r3226 r3350 44 44 } 45 45 46 public override bool ReadOnly { 47 get { return base.ReadOnly; } 48 set { /*not needed because results are always readonly */} 49 } 50 46 51 /// <summary> 47 52 /// Initializes a new instance of <see cref="VariableView"/> with caption "Variable". … … 50 55 InitializeComponent(); 51 56 Caption = "Result"; 57 base.ReadOnly = true; 52 58 } 53 59 /// <summary> … … 84 90 Caption = "Result"; 85 91 dataTypeTextBox.Text = "-"; 86 dataTypeTextBox.Enabled = false;87 valueGroupBox.Enabled = false;88 92 viewHost.Content = null; 89 93 } else { 90 94 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 91 95 dataTypeTextBox.Text = Content.DataType.GetPrettyName(); 96 viewHost.ViewType = null; 97 viewHost.Content = Content.Value; 98 } 99 SetEnableStateOfControls(); 100 } 101 protected override void OnReadOnlyChanged() { 102 base.OnReadOnlyChanged(); 103 SetEnableStateOfControls(); 104 } 105 private void SetEnableStateOfControls() { 106 if (Content == null) { 107 dataTypeTextBox.Enabled = false; 108 valueGroupBox.Enabled = false; 109 viewHost.Enabled = false; 110 } else { 92 111 dataTypeTextBox.Enabled = true; 93 112 valueGroupBox.Enabled = true; 94 viewHost. ViewType = null;95 viewHost. Content = Content.Value;113 viewHost.Enabled = true; 114 viewHost.ReadOnly = ReadOnly; 96 115 } 97 116 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs
r3349 r3350 43 43 Caption = "Run Collection Bubble Chart"; 44 44 this.categoricalMapping = new Dictionary<int, Dictionary<object, double>>(); 45 base.ReadOnly = true; 45 46 } 46 47 … … 53 54 get { return (RunCollection)base.Content; } 54 55 set { base.Content = value; } 56 } 57 public override bool ReadOnly { 58 get { return base.ReadOnly; } 59 set { /*not needed because results are always readonly */} 55 60 } 56 61 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionTabularView.cs
r3347 r3350 40 40 Caption = "Run Collection"; 41 41 this.dataGridView.RowHeaderMouseDoubleClick += new DataGridViewCellMouseEventHandler(dataGridView_RowHeaderMouseDoubleClick); 42 base.ReadOnly = true; 42 43 } 43 44 … … 45 46 : this() { 46 47 Content = content; 48 } 49 50 public override bool ReadOnly { 51 get { return base.ReadOnly; } 52 set { /*not needed because results are always readonly */} 47 53 } 48 54 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
r3341 r3350 45 45 InitializeComponent(); 46 46 Caption = "Run Collection"; 47 base.ReadOnly = true; 47 48 } 48 49 … … 50 51 : this() { 51 52 Content = content; 53 } 54 public override bool ReadOnly { 55 get { return base.ReadOnly; } 56 set { /*not needed because results are always readonly */} 52 57 } 53 58 … … 69 74 Caption = "Run Collection"; 70 75 while (itemsListView.Items.Count > 0) RemoveListViewItem(itemsListView.Items[0]); 71 itemsListView.Enabled = false;72 detailsGroupBox.Enabled = false;73 76 viewHost.Content = null; 74 removeButton.Enabled = false;75 77 76 78 if (Content != null) { 77 79 Caption += " (" + Content.GetType().Name + ")"; 78 itemsListView.Enabled = true;79 80 foreach (IRun item in Content) 80 81 AddListViewItem(CreateListViewItem(item)); 82 } 83 SetEnableStateOfControls(); 84 } 85 86 protected override void OnReadOnlyChanged() { 87 base.OnReadOnlyChanged(); 88 SetEnableStateOfControls(); 89 } 90 private void SetEnableStateOfControls() { 91 if (Content == null) { 92 itemsListView.Enabled = false; 93 detailsGroupBox.Enabled = false; 94 viewHost.Enabled = false; 95 removeButton.Enabled = false; 96 } else { 97 itemsListView.Enabled = true; 98 detailsGroupBox.Enabled = true; 99 removeButton.Enabled = true; 100 viewHost.Enabled = true; 101 viewHost.ReadOnly = ReadOnly; 81 102 } 82 103 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs
r3341 r3350 43 43 } 44 44 45 public override bool ReadOnly { 46 get { return base.ReadOnly; } 47 set { /*not needed because results are always readonly */} 48 } 49 45 50 /// <summary> 46 51 /// Initializes a new instance of <see cref="VariableView"/> with caption "Variable". … … 49 54 InitializeComponent(); 50 55 Caption = "Run"; 56 base.ReadOnly = true; 51 57 } 52 58 /// <summary> … … 65 71 viewHost.ViewType = null; 66 72 viewHost.Content = null; 73 if (Content == null) 74 Caption = "Run"; 75 else 76 Caption = Content.Name + " (" + Content.GetType().Name + ")"; 77 SetEnableStateOfControls(); 78 } 79 protected override void OnReadOnlyChanged() { 80 base.OnReadOnlyChanged(); 81 SetEnableStateOfControls(); 82 } 83 private void SetEnableStateOfControls() { 67 84 if (Content == null) { 68 Caption = "Run";69 85 parametersResultsGroupBox.Enabled = false; 86 viewHost.Enabled = false; 70 87 } else { 71 Caption = Content.Name + " (" + Content.GetType().Name + ")";72 88 parametersResultsGroupBox.Enabled = true; 89 viewHost.Enabled = true; 90 viewHost.ReadOnly = ReadOnly; 73 91 } 74 92 }
Note: See TracChangeset
for help on using the changeset viewer.