Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/28/09 21:21:59 (16 years ago)
Author:
mstoeger
Message:

General housekeeping (#498) Removed some old unused Z-Order values. Replaced some var types by concrete types. Renamed some LineShape properties. Added caching of Pens and Brushes in LineShape and RectangleShape. Put axis tick calculation algorithm into its own class.

File:
1 edited

Legend:

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

    r1195 r1233  
    11using System;
    22using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Data;
    5 using System.Drawing;
    6 using System.Linq;
    7 using System.Text;
    83using System.Windows.Forms;
    94
    105namespace HeuristicLab.Visualization.Options {
    116  public partial class OptionsDialog : Form {
    12 
    137    private LineChart lc;
    148
     
    1812    }
    1913
    20 
    2114    private void button1_Click(object sender, EventArgs e) {
    22       var dlg = new ColorDialog();
     15      ColorDialog dlg = new ColorDialog();
    2316      dlg.ShowDialog();
    2417      this.ColorPreviewTB.BackColor = dlg.Color;
     
    4437
    4538    private void LineSelectCB_SelectedIndexChanged(object sender, EventArgs e) {
    46       int index = this.LineThicknessCB.FindStringExact(((IDataRow) this.LineSelectCB.SelectedValue).Thickness.ToString());
     39      IDataRow datarow = (IDataRow)this.LineSelectCB.SelectedValue;
     40
     41      int index = this.LineThicknessCB.FindStringExact(datarow.Thickness.ToString());
    4742      this.LineThicknessCB.SelectedIndex = index;
    48       index = this.LinestyleCB.FindStringExact(((IDataRow) this.LineSelectCB.SelectedValue).Style.ToString());
     43      index = this.LinestyleCB.FindStringExact(datarow.Style.ToString());
    4944      LinestyleCB.SelectedIndex = index;
    50       this.ColorPreviewTB.BackColor = ((IDataRow) this.LineSelectCB.SelectedValue).Color;
     45      this.ColorPreviewTB.BackColor = datarow.Color;
    5146    }
    5247
     
    5651
    5752    private void OptionsDialogOkButton_Click(object sender, EventArgs e) {
    58       ((IDataRow) this.LineSelectCB.SelectedValue).Thickness = (int) this.LineThicknessCB.SelectedItem;
    59       ((IDataRow) this.LineSelectCB.SelectedValue).Color = this.ColorPreviewTB.BackColor;
    60       ((IDataRow) this.LineSelectCB.SelectedValue).Style = (DrawingStyle) this.LineThicknessCB.SelectedItem;
    61       this.lc.ApplyChangesToRow((IDataRow) this.LineSelectCB.SelectedValue);
     53      IDataRow datarow = (IDataRow)this.LineSelectCB.SelectedValue;
     54
     55      datarow.Thickness = (int)this.LineThicknessCB.SelectedItem;
     56      datarow.Color = this.ColorPreviewTB.BackColor;
     57      datarow.Style = (DrawingStyle)this.LineThicknessCB.SelectedItem;
     58
     59      this.lc.ApplyChangesToRow(datarow);
    6260      this.Close();
    6361    }
Note: See TracChangeset for help on using the changeset viewer.