Changeset 3367
- Timestamp:
- 04/16/10 04:13:49 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs
r3299 r3367 113 113 executionTimeTextBox.Enabled = true; 114 114 } 115 SetEnableStateOfControls(); 116 } 117 118 protected override void OnReadOnlyChanged() { 119 base.OnReadOnlyChanged(); 120 SetEnableStateOfControls(); 121 } 122 private void SetEnableStateOfControls() { 123 parameterCollectionView.ReadOnly = ReadOnly; 124 problemViewHost.ReadOnly = ReadOnly; 125 resultsView.ReadOnly = ReadOnly; 126 runsView.ReadOnly = ReadOnly; 115 127 } 116 128 … … 140 152 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e); 141 153 else { 142 nameTextBox.Enabled = Content.ExecutionState != ExecutionState.Started; 143 descriptionTextBox.Enabled = Content.ExecutionState != ExecutionState.Started; 154 this.ReadOnly = Content.ExecutionState == ExecutionState.Started; 144 155 SaveEnabled = Content.ExecutionState != ExecutionState.Started; 145 parameterCollectionView.Enabled = Content.ExecutionState != ExecutionState.Started;146 newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = Content.ExecutionState != ExecutionState.Started;147 problemViewHost.Enabled = Content.ExecutionState != ExecutionState.Started;148 156 EnableDisableButtons(); 149 157 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs
r3299 r3367 97 97 executionTimeTextBox.Enabled = true; 98 98 } 99 SetEnableStateOfControls(); 100 } 101 protected override void OnReadOnlyChanged() { 102 base.OnReadOnlyChanged(); 103 SetEnableStateOfControls(); 104 } 105 private void SetEnableStateOfControls() { 106 repetitionsNumericUpDown.ReadOnly = ReadOnly; 107 algorithmViewHost.ReadOnly = ReadOnly; 108 runsView.ReadOnly = ReadOnly; 99 109 } 100 110 … … 109 119 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e); 110 120 else { 111 nameTextBox.Enabled = Content.ExecutionState != ExecutionState.Started; 112 descriptionTextBox.Enabled = Content.ExecutionState != ExecutionState.Started; 121 this.ReadOnly = Content.ExecutionState == ExecutionState.Started; 113 122 SaveEnabled = Content.ExecutionState != ExecutionState.Started; 114 repetitionsNumericUpDown.Enabled = Content.ExecutionState != ExecutionState.Started;115 123 newAlgorithmButton.Enabled = openAlgorithmButton.Enabled = saveAlgorithmButton.Enabled = Content.ExecutionState != ExecutionState.Started; 116 124 EnableDisableButtons(); … … 237 245 private void algorithmPanel_DragEnterOver(object sender, DragEventArgs e) { 238 246 e.Effect = DragDropEffects.None; 247 if (ReadOnly) 248 return; 239 249 Type type = e.Data.GetData("Type") as Type; 240 250 if ((type != null) && (typeof(IAlgorithm).IsAssignableFrom(type))) { -
trunk/sources/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.cs
r3361 r3367 101 101 createUserDefinedAlgorithmButton.Enabled = true; 102 102 } 103 SetEnableStateOfControls(); 104 } 105 106 protected override void OnReadOnlyChanged() { 107 base.OnReadOnlyChanged(); 108 SetEnableStateOfControls(); 109 } 110 private void SetEnableStateOfControls() { 111 engineViewHost.ReadOnly = ReadOnly; 112 if (Content == null) 113 engineComboBox.Enabled = false; 114 else 115 engineComboBox.Enabled = Content.ExecutionState != ExecutionState.Started; 103 116 } 104 117 … … 108 121 else { 109 122 createUserDefinedAlgorithmButton.Enabled = Content.ExecutionState != ExecutionState.Started; 110 engineComboBox.Enabled = Content.ExecutionState != ExecutionState.Started;111 engineViewHost.Enabled = Content.ExecutionState != ExecutionState.Started;112 operatorGraphViewHost.Enabled = Content.ExecutionState != ExecutionState.Started;113 123 base.Content_ExecutionStateChanged(sender, e); 114 124 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentView.cs
r3329 r3367 84 84 executionTimeTextBox.Enabled = true; 85 85 } 86 SetEnableStateOfControls(); 87 } 88 89 protected override void OnReadOnlyChanged() { 90 base.OnReadOnlyChanged(); 91 SetEnableStateOfControls(); 92 } 93 private void SetEnableStateOfControls() { 94 optimizerListView.ReadOnly = ReadOnly; 86 95 } 87 96 -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs
r3362 r3367 45 45 InitializeComponent(); 46 46 Caption = "Run Collection"; 47 base.ReadOnly = true;48 47 } 49 48 … … 51 50 : this() { 52 51 Content = content; 53 }54 public override bool ReadOnly {55 get { return base.ReadOnly; }56 set { /*not needed because results are always readonly */}57 52 } 58 53 … … 97 92 itemsListView.Enabled = true; 98 93 detailsGroupBox.Enabled = true; 99 removeButton.Enabled = true;94 removeButton.Enabled = !ReadOnly; 100 95 viewHost.Enabled = true; 101 96 viewHost.ReadOnly = ReadOnly; … … 170 165 if (itemsListView.SelectedItems.Count == 1) { 171 166 IRun item = (IRun)itemsListView.SelectedItems[0].Tag; 172 IView view = MainFormManager.CreateDefaultView(item );167 IView view = MainFormManager.CreateDefaultView(item,ReadOnly); 173 168 if (view != null) view.Show(); 174 169 } … … 180 175 data.SetData("Type", item.GetType()); 181 176 data.SetData("Value", item); 182 if (Content.IsReadOnly ) {177 if (Content.IsReadOnly || ReadOnly) { 183 178 DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link); 184 179 } else { … … 190 185 protected virtual void itemsListView_DragEnterOver(object sender, DragEventArgs e) { 191 186 e.Effect = DragDropEffects.None; 187 if (ReadOnly) return; 192 188 Type type = e.Data.GetData("Type") as Type; 193 189 if ((!Content.IsReadOnly) && (type != null) && (typeof(IRun).IsAssignableFrom(type))) { -
trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs
r3362 r3367 127 127 if (listView.SelectedItems.Count == 1) { 128 128 IItem item = (IItem)listView.SelectedItems[0].Tag; 129 IView view = MainFormManager.CreateDefaultView(item );129 IView view = MainFormManager.CreateDefaultView(item,ReadOnly); 130 130 if (view != null) view.Show(); 131 131 } … … 140 140 } 141 141 private void showAlgorithmButton_Click(object sender, EventArgs e) { 142 MainFormManager.CreateDefaultView(Content.Algorithm.Clone() ).Show();142 MainFormManager.CreateDefaultView(Content.Algorithm.Clone(),ReadOnly).Show(); 143 143 } 144 144 } -
trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs
r3361 r3367 56 56 protected override void OnContentChanged() { 57 57 base.OnContentChanged(); 58 if (Content == null) 58 if (Content == null) 59 59 globalScopeView.Content = null; 60 else 60 else 61 61 globalScopeView.Content = Content.GlobalScope; 62 SetEnableStateOfControls(); 62 63 } 63 64 64 protected override void Content_ExecutionStateChanged(object sender, EventArgs e) { 65 if (InvokeRequired) 66 Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e); 67 else { 65 protected override void OnReadOnlyChanged() { 66 base.OnReadOnlyChanged(); 67 SetEnableStateOfControls(); 68 } 69 private void SetEnableStateOfControls() { 70 globalScopeView.ReadOnly = ReadOnly; 71 operatorGraphViewHost.ReadOnly = ReadOnly; 72 if (Content == null) 73 newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = false; 74 else 68 75 newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = Content.ExecutionState != ExecutionState.Started; 69 globalScopeView.Enabled = Content.ExecutionState != ExecutionState.Started;70 base.Content_ExecutionStateChanged(sender, e);71 }72 76 } 73 77
Note: See TracChangeset
for help on using the changeset viewer.