Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/12/09 19:26:27 (15 years ago)
Author:
bspisic
Message:

#520 Implemented font changes of x-axis, legend and title

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization/Options/OptionsDialog.cs

    r1328 r1337  
    66  public partial class OptionsDialog : Form {
    77    private readonly IChartDataRowsModel model;
    8     private readonly LineChart lineChart;
     8    private readonly ViewPropertiesModel propertiesModel;
    99
    10     public OptionsDialog(IChartDataRowsModel model, LineChart lineChart) {
     10    public OptionsDialog(IChartDataRowsModel model, ViewPropertiesModel propertiesModel) {
    1111      InitializeComponent();
     12
    1213      this.model = model;
    13       this.lineChart = lineChart;
     14      this.propertiesModel = propertiesModel;
    1415    }
    1516
     
    7172        ((IDataRow)LineSelectCB.SelectedValue).Style = (DrawingStyle)LinestyleCB.SelectedItem;
    7273      }
    73 
    74       lineChart.Invalidate(true);
    7574    }
    7675
    7776    private void btnChangeTitleFont_Click(object sender, EventArgs e) {
    78       fdFont.Font = lineChart.Title.Font;
    79       fdFont.Color = lineChart.Title.Color;
     77      fdFont.Font = propertiesModel.TitleFont;
     78      fdFont.Color = propertiesModel.TitleColor;
    8079
    8180      DialogResult dr = fdFont.ShowDialog();
    8281
    8382      if(dr == DialogResult.OK) {
    84         lineChart.Title.Font = fdFont.Font;
    85         lineChart.Title.Color = fdFont.Color;
     83        propertiesModel.TitleFont = fdFont.Font;
     84        propertiesModel.TitleColor = fdFont.Color;
     85
     86        propertiesModel.UpdateView();
    8687      }
    8788    }
    8889
    8990    private void btnChangeLegendFont_Click(object sender, EventArgs e) {
    90 //      fdFont.Font = lineChart.Legend.Font;
    91 //      fdFont.Color = lineChart.Legend.Color;
     91      fdFont.Font = propertiesModel.LegendFont;
     92      fdFont.Color = propertiesModel.LegendColor;
    9293
    9394      DialogResult dr = fdFont.ShowDialog();
    9495
    9596      if (dr == DialogResult.OK) {
    96 //        lineChart.Legend.Font = fdFont.Font;
    97 //        lineChart.Legend.Color = fdFont.Color;
     97        propertiesModel.LegendFont = fdFont.Font;
     98        propertiesModel.LegendColor = fdFont.Color;
     99
     100        propertiesModel.UpdateView();
     101      }
     102    }
     103
     104    private void btnChangeXAxisFont_Click(object sender, EventArgs e) {
     105      fdFont.Font = propertiesModel.XAxisFont;
     106      fdFont.Color = propertiesModel.XAxisColor;
     107
     108      DialogResult dr = fdFont.ShowDialog();
     109
     110      if (dr == DialogResult.OK) {
     111        propertiesModel.XAxisFont = fdFont.Font;
     112        propertiesModel.XAxisColor = fdFont.Color;
     113
     114        propertiesModel.UpdateView();
    98115      }
    99116    }
Note: See TracChangeset for help on using the changeset viewer.