Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/19/11 13:52:12 (13 years ago)
Author:
mkommend
Message:

#1532:

  • Enabled renaming of symbols
  • Fixed cloning of grammers
  • Added readonly attribute in grammars to lock grammars during the algorithm run
  • Removed useless clone method in cloner
  • Changed CheckedItemCollectionViews to enable scrolling during the locked state
File:
1 edited

Legend:

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

    r5809 r6233  
    3939    }
    4040
     41    public override bool ReadOnly {
     42      get {
     43        if ((Content != null) && Content.ReadOnly) return true;
     44        return base.ReadOnly;
     45      }
     46      set {
     47        if ((Content != null) && Content.ReadOnly) base.ReadOnly = true;
     48        else base.ReadOnly = value;
     49      }
     50    }
     51
    4152    public SymbolicExpressionGrammarView() {
    4253      InitializeComponent();
    4354      symbols = new CheckedItemList<ISymbol>();
    4455      symbols.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<ISymbol>>(symbols_CheckedItemsChanged);
     56    }
     57
     58    protected override void RegisterContentEvents() {
     59      base.RegisterContentEvents();
     60      Content.ReadOnlyChanged += new EventHandler(Content_ReadOnlyChanged);
     61    }
     62    protected override void DeregisterContentEvents() {
     63      base.DeregisterContentEvents();
     64      Content.ReadOnlyChanged -= new EventHandler(Content_ReadOnlyChanged);
    4565    }
    4666
     
    5070    }
    5171
    52     protected override void SetEnabledStateOfControls() {
    53       base.SetEnabledStateOfControls();
    54       checkedItemListView.Enabled = Content != null;
    55       checkedItemListView.ReadOnly = ReadOnly;
     72    private void Content_ReadOnlyChanged(object sender, EventArgs e) {
     73      ReadOnly = Content.ReadOnly;
    5674    }
    5775
     
    6987      } else {
    7088        ClearSymbols();
    71         foreach (Symbol symbol in Content.Symbols) {
     89        foreach (ISymbol symbol in Content.Symbols) {
    7290          if (!(symbol is IReadOnlySymbol)) {
    7391            symbol.Changed += new EventHandler(symbol_Changed);
Note: See TracChangeset for help on using the changeset viewer.