Changeset 2728 for trunk/sources/HeuristicLab.GP/3.3/FunctionView.cs
- Timestamp:
- 02/01/10 08:52:32 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP/3.3/FunctionView.cs
r2701 r2728 165 165 if (e.Data.GetDataPresent("IFunction")) { 166 166 IFunction fun = (IFunction)e.Data.GetData("IFunction"); 167 try { 168 Cursor = Cursors.WaitCursor; 169 if (selectedSlot == ALL_SLOTS) { 170 for (int slot = 0; slot < function.MaxSubTrees; slot++) 171 function.AddAllowedSubFunction(fun, slot); 172 } else { 173 int slot = int.Parse(selectedSlot); 174 function.AddAllowedSubFunction(fun, slot); 175 } 176 } 177 finally { 178 Cursor = Cursors.Default; 179 } 180 } 181 } 182 } 183 184 private void subFunctionsListBox_KeyUp(object sender, KeyEventArgs e) { 185 try { 186 Cursor = Cursors.WaitCursor; 187 if (subFunctionsListBox.SelectedItems.Count > 0 && e.KeyCode == Keys.Delete) { 167 188 if (selectedSlot == ALL_SLOTS) { 168 for (int slot = 0; slot < function.MaxSubTrees; slot++) 169 function.AddAllowedSubFunction(fun, slot); 189 for (int slot = 0; slot < function.MaxSubTrees; slot++) { 190 foreach (var subFun in subFunctionsListBox.SelectedItems) { 191 function.RemoveAllowedSubFunction((IFunction)subFun, slot); 192 } 193 } 170 194 } else { 171 195 int slot = int.Parse(selectedSlot); 172 function.AddAllowedSubFunction(fun, slot);173 }174 }175 }176 }177 178 private void subFunctionsListBox_KeyUp(object sender, KeyEventArgs e) {179 if (subFunctionsListBox.SelectedItems.Count > 0 && e.KeyCode == Keys.Delete) {180 181 if (selectedSlot == ALL_SLOTS) {182 for (int slot = 0; slot < function.MaxSubTrees; slot++) {183 196 foreach (var subFun in subFunctionsListBox.SelectedItems) { 184 197 function.RemoveAllowedSubFunction((IFunction)subFun, slot); 185 198 } 186 199 } 187 } else { 188 int slot = int.Parse(selectedSlot); 189 foreach (var subFun in subFunctionsListBox.SelectedItems) { 190 function.RemoveAllowedSubFunction((IFunction)subFun, slot); 191 } 200 192 201 } 193 202 } 203 finally { 204 Cursor = Cursors.Default; 194 205 } 195 206 }
Note: See TracChangeset
for help on using the changeset viewer.