Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8106


Ignore:
Timestamp:
06/25/12 16:02:27 (12 years ago)
Author:
mkommend
Message:

#1722: Corrected behavior of SymbolicExpressionGrammarEditorView.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarEditorView.cs

    r7581 r8106  
    164164    }
    165165
     166    private void symbolsTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e) {
     167      if (e.Action == TreeViewAction.Unknown) return;
     168      e.Cancel = Content == null || Content.ReadOnly || ReadOnly || Locked;
     169    }
     170
    166171    private void symbolsTreeView_AfterCheck(object sender, TreeViewEventArgs e) {
    167       if (e.Action != TreeViewAction.Unknown) {
    168         Content.StartGrammarManipulation();
    169         allowedChildSymbolsControl.Symbol = null;
    170         var symbol = (ISymbol)e.Node.Tag;
    171         symbol.Enabled = e.Node.Checked;
    172         foreach (var node in IterateTreeNodes())
    173           node.Checked = ((ISymbol)node.Tag).Enabled;
    174 
    175         Content.FinishedGrammarManipulation();
    176       }
    177     }
    178 
    179     private void symbolsTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e) {
    180       if (Content == null || Content.ReadOnly) e.Cancel = true;
    181       if (ReadOnly || Locked) e.Cancel = true;
     172      if (e.Action == TreeViewAction.Unknown) return;
     173      Content.StartGrammarManipulation();
     174      allowedChildSymbolsControl.Symbol = null;
     175      var symbol = (ISymbol)e.Node.Tag;
     176      symbol.Enabled = e.Node.Checked;
     177      foreach (var node in IterateTreeNodes())
     178        node.Checked = ((ISymbol)node.Tag).Enabled;
     179
     180      Content.FinishedGrammarManipulation();
    182181    }
    183182
Note: See TracChangeset for help on using the changeset viewer.