Changeset 6531


Ignore:
Timestamp:
07/07/11 11:03:22 (8 years ago)
Author:
mkommend
Message:

#1555: Corrected enabled state of add button.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/ExperimentTreeView.cs

    r6529 r6531  
    118118    }
    119119
    120 
    121 
    122120    private void DeregisterNamedItemEvents(INamedItem namedItem) {
    123121      namedItem.ToStringChanged -= new EventHandler(namedItem_ToStringChanged);
     
    399397
    400398      addButton.Enabled = Content != null && !Locked && !ReadOnly &&
    401         (treeView.SelectedNode == null || experiment != null || (batchRun != null && batchRun.Optimizer == null) || (algorithm != null && algorithm.Problem == null));
     399        (treeView.SelectedNode == null || experiment != null || batchRun != null || algorithm != null);
    402400      moveUpButton.Enabled = Content != null && !Locked && !ReadOnly &&
    403401        treeView.SelectedNode != null && treeView.SelectedNode.PrevNode != null && parentExperiment != null;
     
    647645
    648646    private void treeView_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e) {
    649       if (e.Node.Tag == null || !(e.Node.Tag is INamedItem)) {
    650         e.CancelEdit = true;
    651         return;
    652       }
     647      if (Locked) e.CancelEdit = true;
     648      if (ReadOnly) e.CancelEdit = true;
     649      if (e.Node.Tag == null) e.CancelEdit = true;
     650      if (!(e.Node.Tag is NamedItem)) e.CancelEdit = true;
    653651    }
    654652    private void treeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) {
Note: See TracChangeset for help on using the changeset viewer.