Changeset 13855
- Timestamp:
- 05/20/16 13:01:24 (9 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs
r13850 r13855 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.radioButton = new System.Windows.Forms.RadioButton(); 48 49 this.trackBar = new System.Windows.Forms.TrackBar(); … … 51 52 this.groupBox = new System.Windows.Forms.GroupBox(); 52 53 this.doubleLimitView = new HeuristicLab.Problems.DataAnalysis.Views.DoubleLimitView(); 54 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 53 55 ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit(); 54 56 this.groupBox.SuspendLayout(); 57 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 55 58 this.SuspendLayout(); 56 59 // … … 96 99 this.textBox.Location = new System.Drawing.Point(6, 35); 97 100 this.textBox.Name = "textBox"; 98 this.textBox.ReadOnly = true;99 101 this.textBox.Size = new System.Drawing.Size(132, 20); 100 102 this.textBox.TabIndex = 4; 103 this.textBox.Validating += new System.ComponentModel.CancelEventHandler(this.textBox_Validating); 104 this.textBox.Validated += new System.EventHandler(this.textBox_Validated); 101 105 // 102 106 // groupBox … … 125 129 this.doubleLimitView.TabIndex = 2; 126 130 // 131 // errorProvider 132 // 133 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 134 this.errorProvider.ContainerControl = this; 135 // 127 136 // DensityTrackbar 128 137 // … … 134 143 this.groupBox.ResumeLayout(false); 135 144 this.groupBox.PerformLayout(); 145 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 136 146 this.ResumeLayout(false); 137 147 … … 146 156 private System.Windows.Forms.TextBox textBox; 147 157 private System.Windows.Forms.GroupBox groupBox; 158 private System.Windows.Forms.ErrorProvider errorProvider; 148 159 } 149 160 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.cs
r13853 r13855 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Drawing; 25 26 using System.Globalization; … … 49 50 private IList<double> trainingValues; 50 51 51 // For VisualStudio Designer52 internal DensityTrackbar() {53 InitializeComponent();54 }55 56 52 public DensityTrackbar(string name, DoubleLimit limit, IList<double> trainingValues) { 57 53 InitializeComponent(); … … 80 76 #region Event Handlers 81 77 private void trackBar_ValueChanged(object sender, EventArgs e) { 82 textBox.Text = Value.ToString(CultureInfo.InvariantCulture); 78 textBox.Text = Value.ToString(CultureInfo.CurrentUICulture); 79 textBox.Update(); 83 80 OnValueChanged(); 84 81 } … … 91 88 Checked = radioButton.Checked; 92 89 trackBar.Enabled = !Checked; 93 textBox.Text = Checked ? "Plotted" : Value.ToString(CultureInfo.InvariantCulture); 90 textBox.Enabled = !Checked; 91 textBox.Text = Checked ? "Plotted" : Value.ToString(CultureInfo.CurrentUICulture); 94 92 radioButton.BackColor = Checked ? SystemColors.ActiveCaption : SystemColors.Control; 95 93 OnCheckedChanged(); … … 98 96 base.OnTextChanged(e); 99 97 radioButton.Text = Text; 98 } 99 100 private void textBox_Validating(object sender, CancelEventArgs e) { 101 if (Checked) return; 102 decimal number; 103 if (!decimal.TryParse(textBox.Text, NumberStyles.Any, CultureInfo.CurrentUICulture.NumberFormat, out number)) { 104 e.Cancel = true; 105 errorProvider.SetIconAlignment(textBox, ErrorIconAlignment.MiddleLeft); 106 errorProvider.SetIconPadding(textBox, 2); 107 errorProvider.SetError(textBox, "Illegal number format"); 108 } 109 } 110 111 private void textBox_Validated(object sender, EventArgs e) { 112 if (Checked) return; 113 errorProvider.SetError(textBox, string.Empty); 114 Value = decimal.Parse(textBox.Text, NumberStyles.Any, CultureInfo.CurrentUICulture.NumberFormat); 100 115 } 101 116 #endregion -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.Designer.cs
r13853 r13855 25 25 private void InitializeComponent() { 26 26 this.components = new System.ComponentModel.Container(); 27 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GradientChart)); 27 28 System.Windows.Forms.DataVisualization.Charting.VerticalLineAnnotation verticalLineAnnotation1 = new System.Windows.Forms.DataVisualization.Charting.VerticalLineAnnotation(); 28 29 System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); … … 33 34 this.calculationPendingTimer = new System.Windows.Forms.Timer(this.components); 34 35 this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart(); 36 this.configurationButton = new System.Windows.Forms.Button(); 37 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 35 38 ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit(); 36 39 this.SuspendLayout(); … … 90 93 this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 91 94 // 95 // configurationButton 96 // 97 this.configurationButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 98 this.configurationButton.AutoSize = true; 99 this.configurationButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Properties; 100 this.configurationButton.Location = new System.Drawing.Point(426, 3); 101 this.configurationButton.Name = "configurationButton"; 102 this.configurationButton.Size = new System.Drawing.Size(24, 24); 103 this.configurationButton.TabIndex = 2; 104 this.configurationButton.TabStop = false; 105 this.toolTip.SetToolTip(this.configurationButton, "Configuration"); 106 this.configurationButton.UseVisualStyleBackColor = true; 107 this.configurationButton.Click += new System.EventHandler(this.config_Click); 108 // 92 109 // GradientChart 93 110 // 94 111 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 95 112 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 113 this.Controls.Add(this.configurationButton); 96 114 this.Controls.Add(this.calculationPendingLabel); 97 115 this.Controls.Add(this.chart); … … 100 118 ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit(); 101 119 this.ResumeLayout(false); 120 this.PerformLayout(); 102 121 103 122 } … … 108 127 private System.Windows.Forms.Label calculationPendingLabel; 109 128 private System.Windows.Forms.Timer calculationPendingTimer; 129 private System.Windows.Forms.Button configurationButton; 130 private System.Windows.Forms.ToolTip toolTip; 110 131 } 111 132 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChart.cs
r13853 r13855 60 60 } 61 61 62 public bool ShowConfigButton { 63 get { return configurationButton.Visible; } 64 set { configurationButton.Visible = value; } 65 } 66 62 67 private int xAxisTicks = 5; 63 68 public int XAxisTicks { … … 190 195 191 196 configToolStripMenuItem = new ToolStripMenuItem("Configuration"); 192 configToolStripMenuItem.Click += config ToolStripMenuItem_Click;197 configToolStripMenuItem.Click += config_Click; 193 198 chart.ContextMenuStrip.Items.Add(new ToolStripSeparator()); 194 199 chart.ContextMenuStrip.Items.Add(configToolStripMenuItem); … … 596 601 } 597 602 598 private void config ToolStripMenuItem_Click(object sender, EventArgs e) {603 private void config_Click(object sender, EventArgs e) { 599 604 configurationDialog.ShowDialog(this); 600 605 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChartConfigurationDialog.Designer.cs
r13853 r13855 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 47 48 this.xAxisGroupBox = new System.Windows.Forms.GroupBox(); 48 49 this.maxXTextBox = new System.Windows.Forms.TextBox(); 50 this.xAutomaticCheckBox = new System.Windows.Forms.CheckBox(); 49 51 this.minXTextBox = new System.Windows.Forms.TextBox(); 50 52 this.maxXLabel = new System.Windows.Forms.Label(); … … 57 59 this.minYLabel = new System.Windows.Forms.Label(); 58 60 this.miscGroupBox = new System.Windows.Forms.GroupBox(); 61 this.StepsNumericUpDown = new System.Windows.Forms.NumericUpDown(); 59 62 this.stepsLabel = new System.Windows.Forms.Label(); 60 63 this.applyButton = new System.Windows.Forms.Button(); 61 64 this.cancelButton = new System.Windows.Forms.Button(); 62 this.xAutomaticCheckBox = new System.Windows.Forms.CheckBox(); 63 this.StepsNumericUpDown = new System.Windows.Forms.NumericUpDown(); 65 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 64 66 this.xAxisGroupBox.SuspendLayout(); 65 67 this.yAxisGroupBox.SuspendLayout(); 66 68 this.miscGroupBox.SuspendLayout(); 67 69 ((System.ComponentModel.ISupportInitialize)(this.StepsNumericUpDown)).BeginInit(); 70 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 68 71 this.SuspendLayout(); 69 72 // … … 92 95 this.maxXTextBox.Size = new System.Drawing.Size(167, 20); 93 96 this.maxXTextBox.TabIndex = 3; 97 this.maxXTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.numberTextBox_Validating); 98 this.maxXTextBox.Validated += new System.EventHandler(this.numberTextBox_Validated); 99 // 100 // xAutomaticCheckBox 101 // 102 this.xAutomaticCheckBox.AutoSize = true; 103 this.xAutomaticCheckBox.Location = new System.Drawing.Point(48, -1); 104 this.xAutomaticCheckBox.Name = "xAutomaticCheckBox"; 105 this.xAutomaticCheckBox.Size = new System.Drawing.Size(73, 17); 106 this.xAutomaticCheckBox.TabIndex = 1; 107 this.xAutomaticCheckBox.Text = "Automatic"; 108 this.xAutomaticCheckBox.UseVisualStyleBackColor = true; 109 this.xAutomaticCheckBox.CheckedChanged += new System.EventHandler(this.automaticCheckBox_CheckedChanged); 94 110 // 95 111 // minXTextBox … … 101 117 this.minXTextBox.Size = new System.Drawing.Size(167, 20); 102 118 this.minXTextBox.TabIndex = 2; 119 this.minXTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.numberTextBox_Validating); 120 this.minXTextBox.Validated += new System.EventHandler(this.numberTextBox_Validated); 103 121 // 104 122 // maxXLabel … … 144 162 this.maxYTextBox.Size = new System.Drawing.Size(167, 20); 145 163 this.maxYTextBox.TabIndex = 3; 164 this.maxYTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.numberTextBox_Validating); 165 this.maxYTextBox.Validated += new System.EventHandler(this.numberTextBox_Validated); 146 166 // 147 167 // yAutomaticCheckBox … … 164 184 this.minYTextBox.Size = new System.Drawing.Size(167, 20); 165 185 this.minYTextBox.TabIndex = 2; 186 this.minYTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.numberTextBox_Validating); 187 this.minYTextBox.Validated += new System.EventHandler(this.numberTextBox_Validated); 166 188 // 167 189 // maxYLabel … … 194 216 this.miscGroupBox.TabIndex = 4; 195 217 this.miscGroupBox.TabStop = false; 196 //197 // stepsLabel198 //199 this.stepsLabel.AutoSize = true;200 this.stepsLabel.Location = new System.Drawing.Point(6, 22);201 this.stepsLabel.Name = "stepsLabel";202 this.stepsLabel.Size = new System.Drawing.Size(34, 13);203 this.stepsLabel.TabIndex = 1;204 this.stepsLabel.Text = "Steps";205 //206 // applyButton207 //208 this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));209 this.applyButton.Location = new System.Drawing.Point(91, 239);210 this.applyButton.Name = "applyButton";211 this.applyButton.Size = new System.Drawing.Size(75, 23);212 this.applyButton.TabIndex = 5;213 this.applyButton.Text = "Apply";214 this.applyButton.UseVisualStyleBackColor = true;215 this.applyButton.Click += new System.EventHandler(this.okButton_Click);216 //217 // cancelButton218 //219 this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));220 this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;221 this.cancelButton.Location = new System.Drawing.Point(172, 239);222 this.cancelButton.Name = "cancelButton";223 this.cancelButton.Size = new System.Drawing.Size(75, 23);224 this.cancelButton.TabIndex = 6;225 this.cancelButton.Text = "Cancel";226 this.cancelButton.UseVisualStyleBackColor = true;227 //228 // xAutomaticCheckBox229 //230 this.xAutomaticCheckBox.AutoSize = true;231 this.xAutomaticCheckBox.Location = new System.Drawing.Point(48, -1);232 this.xAutomaticCheckBox.Name = "xAutomaticCheckBox";233 this.xAutomaticCheckBox.Size = new System.Drawing.Size(73, 17);234 this.xAutomaticCheckBox.TabIndex = 1;235 this.xAutomaticCheckBox.Text = "Automatic";236 this.xAutomaticCheckBox.UseVisualStyleBackColor = true;237 this.xAutomaticCheckBox.CheckedChanged += new System.EventHandler(this.automaticCheckBox_CheckedChanged);238 218 // 239 219 // StepsNumericUpDown … … 255 235 this.StepsNumericUpDown.Size = new System.Drawing.Size(166, 20); 256 236 this.StepsNumericUpDown.TabIndex = 4; 237 // 238 // stepsLabel 239 // 240 this.stepsLabel.AutoSize = true; 241 this.stepsLabel.Location = new System.Drawing.Point(6, 22); 242 this.stepsLabel.Name = "stepsLabel"; 243 this.stepsLabel.Size = new System.Drawing.Size(34, 13); 244 this.stepsLabel.TabIndex = 1; 245 this.stepsLabel.Text = "Steps"; 246 // 247 // applyButton 248 // 249 this.applyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 250 this.applyButton.Location = new System.Drawing.Point(91, 239); 251 this.applyButton.Name = "applyButton"; 252 this.applyButton.Size = new System.Drawing.Size(75, 23); 253 this.applyButton.TabIndex = 5; 254 this.applyButton.Text = "Apply"; 255 this.applyButton.UseVisualStyleBackColor = true; 256 this.applyButton.Click += new System.EventHandler(this.okButton_Click); 257 // 258 // cancelButton 259 // 260 this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 261 this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; 262 this.cancelButton.Location = new System.Drawing.Point(172, 239); 263 this.cancelButton.Name = "cancelButton"; 264 this.cancelButton.Size = new System.Drawing.Size(75, 23); 265 this.cancelButton.TabIndex = 6; 266 this.cancelButton.Text = "Cancel"; 267 this.cancelButton.UseVisualStyleBackColor = true; 268 // 269 // errorProvider 270 // 271 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 272 this.errorProvider.ContainerControl = this; 257 273 // 258 274 // GradientChartConfigurationDialog … … 279 295 this.miscGroupBox.PerformLayout(); 280 296 ((System.ComponentModel.ISupportInitialize)(this.StepsNumericUpDown)).EndInit(); 297 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 281 298 this.ResumeLayout(false); 282 299 … … 302 319 private System.Windows.Forms.CheckBox xAutomaticCheckBox; 303 320 private System.Windows.Forms.NumericUpDown StepsNumericUpDown; 321 private System.Windows.Forms.ErrorProvider errorProvider; 304 322 } 305 323 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/GradientChartConfigurationDialog.cs
r13853 r13855 21 21 22 22 using System; 23 using System.ComponentModel; 23 24 using System.Globalization; 24 25 using System.Windows.Forms; … … 28 29 public partial class GradientChartConfigurationDialog : Form { 29 30 private readonly GradientChart chart; 30 31 private IFormatProvider FormatProvider {32 get { return CultureInfo.CurrentUICulture.NumberFormat; }33 }34 31 35 32 public GradientChartConfigurationDialog(GradientChart chart) { … … 41 38 if (chart.FixedXAxisMin.HasValue && chart.FixedXAxisMax.HasValue) { 42 39 xAutomaticCheckBox.Checked = false; 43 minXTextBox.Text = chart.FixedXAxisMin.Value.ToString( FormatProvider);44 maxXTextBox.Text = chart.FixedXAxisMax.Value.ToString( FormatProvider);40 minXTextBox.Text = chart.FixedXAxisMin.Value.ToString(CultureInfo.CurrentUICulture); 41 maxXTextBox.Text = chart.FixedXAxisMax.Value.ToString(CultureInfo.CurrentUICulture); 45 42 } else xAutomaticCheckBox.Checked = true; 46 43 if (chart.FixedYAxisMin.HasValue && chart.FixedYAxisMax.HasValue) { 47 44 yAutomaticCheckBox.Checked = false; 48 minYTextBox.Text = chart.FixedYAxisMin.Value.ToString( FormatProvider);49 maxYTextBox.Text = chart.FixedYAxisMax.Value.ToString( FormatProvider);45 minYTextBox.Text = chart.FixedYAxisMin.Value.ToString(CultureInfo.CurrentUICulture); 46 maxYTextBox.Text = chart.FixedYAxisMax.Value.ToString(CultureInfo.CurrentUICulture); 50 47 } else yAutomaticCheckBox.Checked = true; 51 48 StepsNumericUpDown.Value = chart.DrawingSteps; … … 59 56 chart.FixedXAxisMax = null; 60 57 } else { 61 var min = Convert.ToDouble(minXTextBox.Text, FormatProvider);62 var max = Convert.ToDouble(maxXTextBox.Text, FormatProvider);58 var min = double.Parse(minXTextBox.Text, CultureInfo.CurrentUICulture); 59 var max = double.Parse(maxXTextBox.Text, CultureInfo.CurrentUICulture); 63 60 chart.FixedXAxisMin = min; 64 61 chart.FixedXAxisMax = max; … … 69 66 chart.FixedYAxisMax = null; 70 67 } else { 71 var min = Convert.ToDouble(minYTextBox.Text, FormatProvider);72 var max = Convert.ToDouble(maxYTextBox.Text, FormatProvider);68 var min = double.Parse(minYTextBox.Text, CultureInfo.CurrentUICulture); 69 var max = double.Parse(maxYTextBox.Text, CultureInfo.CurrentUICulture); 73 70 chart.FixedYAxisMin = min; 74 71 chart.FixedYAxisMax = max; … … 81 78 Close(); 82 79 } 83 catch (FormatException fe) {84 MessageBox.Show(this, "Illegal number format : {0}", fe.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);80 catch (FormatException) { 81 MessageBox.Show(this, "Illegal number format", "Wrong format", MessageBoxButtons.OK, MessageBoxIcon.Error); 85 82 } 86 83 finally { … … 96 93 maxYTextBox.Enabled = !yAutomaticCheckBox.Checked; 97 94 } 95 96 private void numberTextBox_Validating(object sender, CancelEventArgs e) { 97 var textBox = sender as TextBox; 98 if (textBox != null) { 99 double number; 100 if (!double.TryParse(textBox.Text, NumberStyles.Any, CultureInfo.CurrentUICulture, out number)) { 101 e.Cancel = true; 102 applyButton.Enabled = false; 103 errorProvider.SetIconAlignment(textBox, ErrorIconAlignment.MiddleLeft); 104 errorProvider.SetIconPadding(textBox, 2); 105 errorProvider.SetError(textBox, "Illegal number format"); 106 textBox.SelectAll(); 107 } 108 } 109 } 110 111 private void numberTextBox_Validated(object sender, EventArgs e) { 112 var textBox = sender as TextBox; 113 if (textBox != null) { 114 errorProvider.SetError(textBox, string.Empty); 115 applyButton.Enabled = true; 116 } 117 } 98 118 } 99 119 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionTargetResponseGradientView.cs
r13853 r13855 126 126 127 127 var densityChart = new DensityChart() { 128 //Dock = DockStyle.Top,129 //Location = new Point(0, 0),130 128 Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right, 131 129 Margin = Padding.Empty, … … 160 158 ShowLegend = false, 161 159 ShowCursor = true, 160 ShowConfigButton = false, 162 161 YAxisTicks = 5, 163 162 };
Note: See TracChangeset
for help on using the changeset viewer.