Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8726


Ignore:
Timestamp:
10/04/12 09:38:32 (12 years ago)
Author:
mkommend
Message:

#1043: Removed the possibility to edit the name of optimizers in the ExperimentTreeView by pressing F2.

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  
    171171      this.treeView.Size = new System.Drawing.Size(191, 402);
    172172      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);
    175173      this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(treeView_AfterSelect);
    176174      this.treeView.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.optimizerTreeView_ItemDrag);
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs

    r8668 r8726  
    625625      var optimizer = namedItem as IOptimizer;
    626626
    627       if (e.KeyCode == Keys.F2 && !treeNode.IsEditing) {
    628         treeNode.BeginEdit();
    629         return;
    630       }
    631 
    632627      if (e.KeyCode == Keys.Delete && optimizer != null) {
    633628        if (treeNode.Parent == null)
     
    679674      if (contextMenuStrip.Items.Cast<ToolStripMenuItem>().Any(item => item.Enabled))
    680675        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;
    696676    }
    697677
Note: See TracChangeset for help on using the changeset viewer.