Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/15/11 18:41:13 (13 years ago)
Author:
abeham
Message:

#1465

  • fine tuned UI for setting data(table|row) visual properties
  • added control for the data table visual properties
  • added a few more visual properties
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram/HeuristicLab.Analysis.Views/3.3/DataRowVisualPropertiesControl.cs

    r6011 r6012  
    4444      InitializeComponent();
    4545      chartTypeComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowChartType));
     46      lineStyleComboBox.DataSource = Enum.GetValues(typeof(DataRowVisualProperties.DataRowLineStyle));
    4647    }
    4748
     
    5253          chartTypeComboBox.SelectedIndex = -1;
    5354          colorButton.BackColor = SystemColors.Control;
    54           secondYAxisCheckBox.Checked = false;
    55           secondXAxisCheckBox.Checked = false;
     55          colorButton.Text = "?";
     56          yAxisPrimaryRadioButton.Checked = false;
     57          yAxisSecondaryRadioButton.Checked = false;
     58          xAxisPrimaryRadioButton.Checked = false;
     59          xAxisSecondaryRadioButton.Checked = false;
     60          lineStyleComboBox.SelectedIndex = -1;
    5661          startIndexZeroCheckBox.Checked = false;
     62          lineWidthNumericUpDown.Value = 1;
    5763          binsNumericUpDown.Value = 1;
    58           exactBinsCheckBox.Checked = false;
     64          binsApproximatelyRadioButton.Checked = false;
     65          binsExactRadioButton.Checked = false;
    5966        } else {
    6067          chartTypeComboBox.SelectedItem = Content.ChartType;
     
    6269            colorButton.BackColor = SystemColors.Control;
    6370            colorButton.Text = "?";
    64           } else colorButton.BackColor = Content.Color;
    65           secondYAxisCheckBox.Checked = Content.SecondYAxis;
    66           secondXAxisCheckBox.Checked = Content.SecondXAxis;
     71          } else {
     72            colorButton.BackColor = Content.Color;
     73            colorButton.Text = String.Empty;
     74          }
     75          yAxisPrimaryRadioButton.Checked = !Content.SecondYAxis;
     76          yAxisSecondaryRadioButton.Checked = Content.SecondYAxis;
     77          xAxisPrimaryRadioButton.Checked = !Content.SecondXAxis;
     78          xAxisSecondaryRadioButton.Checked = Content.SecondXAxis;
     79          lineStyleComboBox.SelectedItem = Content.LineStyle;
    6780          startIndexZeroCheckBox.Checked = Content.StartIndexZero;
     81          lineWidthNumericUpDown.Value = Content.LineWidth;
    6882          binsNumericUpDown.Value = Content.Bins;
    69           exactBinsCheckBox.Checked = Content.ExactBins;
     83          binsApproximatelyRadioButton.Checked = !Content.ExactBins;
     84          binsExactRadioButton.Checked = Content.ExactBins;
    7085        }
    7186      } finally { SuppressEvents = false; }
     
    7590    protected virtual void SetEnabledStateOfControls() {
    7691      commonGroupBox.Enabled = Content != null;
     92      lineChartGroupBox.Enabled = Content != null && Content.ChartType == DataRowVisualProperties.DataRowChartType.Line;
    7793      histoGramGroupBox.Enabled = Content != null && Content.ChartType == DataRowVisualProperties.DataRowChartType.Histogram;
    7894    }
     
    94110    }
    95111
    96     private void secondYAxisCheckBox_CheckedChanged(object sender, EventArgs e) {
     112    private void yAxisRadioButton_CheckedChanged(object sender, EventArgs e) {
    97113      if (!SuppressEvents && Content != null) {
    98         Content.SecondYAxis = secondYAxisCheckBox.Checked;
     114        SuppressEvents = true;
     115        try {
     116          if (sender == yAxisPrimaryRadioButton)
     117            yAxisSecondaryRadioButton.Checked = !yAxisPrimaryRadioButton.Checked;
     118          else yAxisPrimaryRadioButton.Checked = !yAxisSecondaryRadioButton.Checked;
     119          Content.SecondYAxis = yAxisSecondaryRadioButton.Checked;
     120        } finally { SuppressEvents = false; }
    99121      }
    100122    }
    101123
    102     private void secondXAxisCheckBox_CheckedChanged(object sender, EventArgs e) {
     124    private void xAxisRadioButton_CheckedChanged(object sender, EventArgs e) {
    103125      if (!SuppressEvents && Content != null) {
    104         Content.SecondXAxis = secondXAxisCheckBox.Checked;
     126        SuppressEvents = true;
     127        try {
     128          if (sender == xAxisPrimaryRadioButton)
     129            xAxisSecondaryRadioButton.Checked = !xAxisPrimaryRadioButton.Checked;
     130          else xAxisPrimaryRadioButton.Checked = !xAxisSecondaryRadioButton.Checked;
     131          Content.SecondXAxis = xAxisSecondaryRadioButton.Checked;
     132        } finally { SuppressEvents = false; }
     133      }
     134    }
     135
     136    private void lineStyleComboBox_SelectedValueChanged(object sender, EventArgs e) {
     137      if (!SuppressEvents && Content != null) {
     138        Content.LineStyle = (DataRowVisualProperties.DataRowLineStyle)lineStyleComboBox.SelectedValue;
    105139      }
    106140    }
     
    112146    }
    113147
     148    private void lineWidthNumericUpDown_ValueChanged(object sender, EventArgs e) {
     149      if (!SuppressEvents && Content != null) {
     150        Content.LineWidth = (int)lineWidthNumericUpDown.Value;
     151      }
     152    }
     153
    114154    private void binsNumericUpDown_ValueChanged(object sender, EventArgs e) {
    115155      if (!SuppressEvents && Content != null) {
     
    118158    }
    119159
    120     private void exactBinsCheckBox_CheckedChanged(object sender, EventArgs e) {
     160    private void binNumberRadioButton_CheckedChanged(object sender, EventArgs e) {
    121161      if (!SuppressEvents && Content != null) {
    122         Content.ExactBins = exactBinsCheckBox.Checked;
     162        SuppressEvents = true;
     163        try {
     164          if (sender == binsApproximatelyRadioButton)
     165            binsExactRadioButton.Checked = !binsApproximatelyRadioButton.Checked;
     166          else binsApproximatelyRadioButton.Checked = !binsExactRadioButton.Checked;
     167          Content.ExactBins = binsExactRadioButton.Checked;
     168        } finally { SuppressEvents = false; }
    123169      }
    124170    }
Note: See TracChangeset for help on using the changeset viewer.