Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/26/11 15:11:48 (13 years ago)
Author:
mkommend
Message:

#1479: Corrected handling of GroupSymbols.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarView.cs

    r6233 r6299  
    9090          if (!(symbol is IReadOnlySymbol)) {
    9191            symbol.Changed += new EventHandler(symbol_Changed);
    92             symbols.Add(symbol, symbol.InitialFrequency > 0.0);
     92            symbols.Add(symbol, symbol.Enabled);
    9393          }
    9494        }
     
    101101    private void symbol_Changed(object sender, EventArgs e) {
    102102      ISymbol symbol = (ISymbol)sender;
    103       symbols.SetItemCheckedState(symbol, symbol.InitialFrequency > 0.0);
     103      symbols.SetItemCheckedState(symbol, symbol.Enabled);
    104104    }
    105105
    106106    private void symbols_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<ISymbol>> e) {
    107107      ICheckedItemList<ISymbol> checkedItemList = (ICheckedItemList<ISymbol>)sender;
    108       foreach (var indexedItem in e.Items) {
    109         if (checkedItemList.ItemChecked(indexedItem.Value)) {
    110           indexedItem.Value.InitialFrequency = 1.0;
    111         } else {
    112           indexedItem.Value.InitialFrequency = 0.0;
    113         }
    114       }
     108      foreach (var indexedItem in e.Items)
     109        indexedItem.Value.Enabled = checkedItemList.ItemChecked(indexedItem.Value);
    115110    }
    116111    private void ClearSymbols() {
Note: See TracChangeset for help on using the changeset viewer.