Changeset 8726
- Timestamp:
- 10/04/12 09:38:32 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.Designer.cs
r7967 r8726 171 171 this.treeView.Size = new System.Drawing.Size(191, 402); 172 172 this.treeView.TabIndex = 10; 173 this.treeView.AfterLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(treeView_AfterLabelEdit);174 this.treeView.BeforeLabelEdit += new System.Windows.Forms.NodeLabelEditEventHandler(treeView_BeforeLabelEdit);175 173 this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(treeView_AfterSelect); 176 174 this.treeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.optimizerTreeView_ItemDrag); -
trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs
r8668 r8726 625 625 var optimizer = namedItem as IOptimizer; 626 626 627 if (e.KeyCode == Keys.F2 && !treeNode.IsEditing) {628 treeNode.BeginEdit();629 return;630 }631 632 627 if (e.KeyCode == Keys.Delete && optimizer != null) { 633 628 if (treeNode.Parent == null) … … 679 674 if (contextMenuStrip.Items.Cast<ToolStripMenuItem>().Any(item => item.Enabled)) 680 675 contextMenuStrip.Show(Cursor.Position); 681 }682 683 private void treeView_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e) {684 if (Locked) e.CancelEdit = true;685 if (ReadOnly) e.CancelEdit = true;686 if (e.Node.Tag == null) e.CancelEdit = true;687 var namedItem = e.Node.Tag as INamedItem;688 if (namedItem == null) e.CancelEdit = true;689 else if (!namedItem.CanChangeName) e.CancelEdit = true;690 }691 private void treeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) {692 if (e.Label == null) return;693 e.Node.EndEdit(false);694 var namedItem = (INamedItem)e.Node.Tag;695 namedItem.Name = e.Label;696 676 } 697 677
Note: See TracChangeset
for help on using the changeset viewer.