Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/10/19 15:40:44 (5 years ago)
Author:
gkronber
Message:

#2520: merged r16491:16528 from trunk to persistence branch

Location:
branches/2520_PersistenceReintegration
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2520_PersistenceReintegration

  • branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views

  • branches/2520_PersistenceReintegration/HeuristicLab.Analysis.Views/3.3/IndexedDataTableView.cs

    r16453 r16529  
    2020#endregion
    2121
    22 using HeuristicLab.Collections;
    23 using HeuristicLab.Core.Views;
    24 using HeuristicLab.MainForm;
    2522using System;
    2623using System.Collections.Generic;
     
    2926using System.Windows.Forms;
    3027using System.Windows.Forms.DataVisualization.Charting;
     28using HeuristicLab.Collections;
     29using HeuristicLab.Core.Views;
     30using HeuristicLab.MainForm;
    3131
    3232namespace HeuristicLab.Analysis.Views {
    3333  [View("IndexedDataTable View")]
    3434  [Content(typeof(IndexedDataTable<>), true)]
    35   public partial class IndexedDataTableView<T> : NamedItemView {
     35  public partial class IndexedDataTableView<T> : NamedItemView, IConfigureableView {
    3636    protected List<Series> invisibleSeries;
    3737    protected Dictionary<IObservableList<Tuple<T, double>>, IndexedDataRow<T>> valuesRowsTable;
     
    4949      chart.ChartAreas[0].CursorX.Interval = 1;
    5050      chart.SuppressExceptions = true;
     51      chart.ContextMenuStrip.Items.Add(configureToolStripMenuItem);
    5152    }
    5253
     
    131132      base.SetEnabledStateOfControls();
    132133      chart.Enabled = Content != null;
     134    }
     135
     136    public void ShowConfiguration() {
     137      if (Content != null) {
     138        using (var dialog = new DataTableVisualPropertiesDialog<IndexedDataRow<T>>(Content)) {
     139          dialog.ShowDialog(this);
     140        }
     141      } else MessageBox.Show("Nothing to configure.");
    133142    }
    134143
     
    211220      if (Content.VisualProperties.TitleFont != null) chart.Titles[0].Font = Content.VisualProperties.TitleFont;
    212221      if (!Content.VisualProperties.TitleColor.IsEmpty) chart.Titles[0].ForeColor = Content.VisualProperties.TitleColor;
     222      chart.Titles[0].Text = Content.VisualProperties.Title;
     223      chart.Titles[0].Visible = !string.IsNullOrEmpty(Content.VisualProperties.Title);
    213224
    214225      if (Content.VisualProperties.AxisTitleFont != null) area.AxisX.TitleFont = Content.VisualProperties.AxisTitleFont;
     
    313324    #region Event Handlers
    314325    #region Content Event Handlers
    315     protected override void Content_NameChanged(object sender, EventArgs e) {
    316       if (InvokeRequired)
    317         Invoke(new EventHandler(Content_NameChanged), sender, e);
    318       else {
    319         chart.Titles[0].Text = Content.Name;
    320         base.Content_NameChanged(sender, e);
    321       }
    322     }
    323326    private void Content_VisualPropertiesChanged(object sender, EventArgs e) {
    324327      if (InvokeRequired)
     
    508511    }
    509512    #endregion
     513    private void configureToolStripMenuItem_Click(object sender, EventArgs e) {
     514      ShowConfiguration();
     515    }
    510516    #endregion
    511517
Note: See TracChangeset for help on using the changeset viewer.