Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/15/17 16:26:34 (7 years ago)
Author:
pfleck
Message:

#2713 Reverted the separation of the DataTable/ScatterPlotView in -View and -Control.
Instead, a ShowName property is added to control whether the name-textbox and the info-label from the NamedItemView are shown.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs

    r14981 r14982  
    2727using System.Windows.Forms.DataVisualization.Charting;
    2828using HeuristicLab.Collections;
    29 using HeuristicLab.MainForm.WindowsForms;
     29using HeuristicLab.Core.Views;
     30using HeuristicLab.MainForm;
    3031
    3132namespace HeuristicLab.Analysis.Views {
    32   public partial class DataTableControl : AsynchronousContentView {
     33  [View("DataTable View")]
     34  [Content(typeof(DataTable), true)]
     35  public partial class DataTableView : NamedItemView, IConfigureableView {
    3336    protected List<Series> invisibleSeries;
    3437    protected Dictionary<IObservableList<double>, DataRow> valuesRowsTable;
     
    3942    }
    4043
    41     public DataTableControl() {
     44    public bool ShowName {
     45      get { return nameTextBox.Visible; }
     46      set {
     47        if (nameTextBox.Visible != value) {
     48          foreach (Control c in Controls) {
     49            if (c == chart) continue;
     50            c.Visible = value;
     51          }
     52          chart.Dock = value ? DockStyle.None : DockStyle.Fill;
     53        }
     54      }
     55    }
     56
     57    public DataTableView() {
    4258      InitializeComponent();
    4359      valuesRowsTable = new Dictionary<IObservableList<double>, DataRow>();
     
    89105
    90106    protected override void OnContentChanged() {
     107      base.OnContentChanged();
    91108      invisibleSeries.Clear();
    92109      chart.Titles[0].Text = string.Empty;
     
    105122
    106123    protected override void SetEnabledStateOfControls() {
     124      base.SetEnabledStateOfControls();
    107125      chart.Enabled = Content != null;
    108126    }
     
    306324    #region Event Handlers
    307325    #region Content Event Handlers
     326    protected override void Content_NameChanged(object sender, EventArgs e) {
     327      if (InvokeRequired)
     328        Invoke(new EventHandler(Content_NameChanged), sender, e);
     329      else {
     330        Content.VisualProperties.Title = Content.Name;
     331        base.Content_NameChanged(sender, e);
     332      }
     333    }
    308334    private void Content_VisualPropertiesChanged(object sender, EventArgs e) {
    309335      if (InvokeRequired)
Note: See TracChangeset for help on using the changeset viewer.