Free cookie consent management tool by TermsFeed Policy Generator

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

#2715 Added a Clear-Color button (like in the DataTableVisualPropertiesControl).

File:
1 edited

Legend:

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

    r14493 r14984  
    2323using System.Drawing;
    2424using System.Windows.Forms;
     25using HeuristicLab.Common.Resources;
    2526using HeuristicLab.MainForm;
    2627using HeuristicLab.MainForm.WindowsForms;
     
    4546      pointStyleComboBox.DataSource = Enum.GetValues(typeof(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle));
    4647      regressionTypeComboBox.DataSource = Enum.GetValues(typeof(ScatterPlotDataRowVisualProperties.ScatterPlotDataRowRegressionType));
     48      clearColorButton.BackColor = Color.Transparent;
     49      clearColorButton.BackgroundImage = VSImageLibrary.Delete;
    4750      SetEnabledStateOfControls();
    4851    }
     
    8790      pointStyleComboBox.Enabled = Content != null;
    8891      colorButton.Enabled = Content != null;
    89       colorButton.Enabled = Content != null;
     92      clearColorButton.Visible = Content != null && !Content.Color.IsEmpty;
    9093      isVisibleInLegendCheckBox.Enabled = Content != null;
    9194      pointSizeNumericUpDown.Enabled = Content != null;
     
    111114        colorButton.BackColor = Content.Color;
    112115        colorButton.Text = String.Empty;
     116        clearColorButton.Visible = true;
     117      }
     118    }
     119
     120    private void clearColorButton_Click(object sender, EventArgs e) {
     121      if (!SuppressEvents && Content != null) {
     122        Content.Color = Color.Empty;
     123        colorButton.BackColor = SystemColors.Control;
     124        colorButton.Text = "?";
     125        clearColorButton.Visible = false;
    113126      }
    114127    }
Note: See TracChangeset for help on using the changeset viewer.