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).

Location:
trunk/sources/HeuristicLab.Analysis.Views/3.3
Files:
2 edited

Legend:

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

    r14493 r14984  
    6565      this.regressionLegendTextBox = new System.Windows.Forms.TextBox();
    6666      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     67      this.clearColorButton = new System.Windows.Forms.Button();
    6768      ((System.ComponentModel.ISupportInitialize)(this.pointSizeNumericUpDown)).BeginInit();
    6869      this.regressionGroupBox.SuspendLayout();
     
    278279      this.regressionLegendTextBox.Validated += new System.EventHandler(this.regressionLegendTextBox_Validated);
    279280      //
     281      // clearColorButton
     282      //
     283      this.clearColorButton.BackColor = System.Drawing.SystemColors.ActiveCaption;
     284      this.clearColorButton.Cursor = System.Windows.Forms.Cursors.Default;
     285      this.clearColorButton.FlatAppearance.BorderSize = 0;
     286      this.clearColorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     287      this.clearColorButton.ForeColor = System.Drawing.Color.Transparent;
     288      this.clearColorButton.Location = new System.Drawing.Point(125, 65);
     289      this.clearColorButton.Margin = new System.Windows.Forms.Padding(0);
     290      this.clearColorButton.Name = "clearColorButton";
     291      this.clearColorButton.Size = new System.Drawing.Size(15, 16);
     292      this.clearColorButton.TabIndex = 11;
     293      this.clearColorButton.TabStop = false;
     294      this.clearColorButton.UseVisualStyleBackColor = false;
     295      this.clearColorButton.Click += new System.EventHandler(this.clearColorButton_Click);
     296      //
    280297      // ScatterPlotDataRowVisualPropertiesControl
    281298      //
    282299      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     300      this.Controls.Add(this.clearColorButton);
    283301      this.Controls.Add(this.regressionGroupBox);
    284302      this.Controls.Add(this.pointSizeNumericUpDown);
     
    324342    private System.Windows.Forms.ToolTip toolTip;
    325343    private System.Windows.Forms.CheckBox isRegressionVisibleInLegendCheckBox;
     344    private System.Windows.Forms.Button clearColorButton;
    326345  }
    327346}
  • 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.