Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/15/10 01:34:27 (14 years ago)
Author:
mkommend
Message:

implemented first version of View.ReadOnly and adapted some views to the new mechanism (ticket #973)

File:
1 edited

Legend:

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

    r3341 r3350  
    4343    }
    4444
     45    public override bool ReadOnly {
     46      get { return base.ReadOnly; }
     47      set { /*not needed because results are always readonly */}
     48    }
     49
    4550    /// <summary>
    4651    /// Initializes a new instance of <see cref="VariableView"/> with caption "Variable".
     
    4954      InitializeComponent();
    5055      Caption = "Run";
     56      base.ReadOnly = true;
    5157    }
    5258    /// <summary>
     
    6571      viewHost.ViewType = null;
    6672      viewHost.Content = null;
     73      if (Content == null)
     74        Caption = "Run";
     75      else
     76        Caption = Content.Name + " (" + Content.GetType().Name + ")";
     77      SetEnableStateOfControls();
     78    }
     79    protected override void OnReadOnlyChanged() {
     80      base.OnReadOnlyChanged();
     81      SetEnableStateOfControls();
     82    }
     83    private void SetEnableStateOfControls() {
    6784      if (Content == null) {
    68         Caption = "Run";
    6985        parametersResultsGroupBox.Enabled = false;
     86        viewHost.Enabled = false;
    7087      } else {
    71         Caption = Content.Name + " (" + Content.GetType().Name + ")";
    7288        parametersResultsGroupBox.Enabled = true;
     89        viewHost.Enabled = true;
     90        viewHost.ReadOnly = ReadOnly;
    7391      }
    7492    }
Note: See TracChangeset for help on using the changeset viewer.