Changeset 8935 for branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs
- Timestamp:
- 11/22/12 15:03:32 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs
r8409 r8935 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.ComponentModel; … … 9 30 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 10 31 public partial class InsertNodeDialog : Form { 11 public string Caption {12 get { return this.Text; }13 set {14 if (InvokeRequired)15 Invoke(new Action<string>(x => this.Caption = x), value);16 else17 this.Text = value;18 }19 }20 21 32 public InsertNodeDialog() { 22 33 InitializeComponent(); … … 55 66 constantValueTextBox.Visible = false; 56 67 // add controls to the dialog for changing the variable name or weight 68 } else { 69 variableNameLabel.Visible = false; 70 variableNamesCombo.Visible = false; 71 variableWeightLabel.Visible = false; 72 variableWeightTextBox.Visible = false; 73 constantValueLabel.Visible = false; 74 constantValueTextBox.Visible = false; 57 75 } 58 76 } … … 90 108 91 109 public event EventHandler DialogValidated; 110 private void OnDialogValidated(object sender, EventArgs e) { 111 var dialogValidated = DialogValidated; 112 if (dialogValidated != null) 113 dialogValidated(sender, e); 114 } 92 115 93 116 private void childControl_KeyDown(object sender, KeyEventArgs e) { … … 98 121 if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Return) { 99 122 if (ValidateChildren()) { 100 DialogValidated(this, e);123 OnDialogValidated(this, e); 101 124 Close(); 102 125 } 103 126 } 104 127 } 128 129 private void okButton_Click(object sender, EventArgs e) { 130 if (ValidateChildren()) { 131 OnDialogValidated(this, e); 132 Close(); 133 } 134 } 135 136 private void cancelButton_Click(object sender, EventArgs e) { 137 Close(); 138 } 105 139 } 106 140 }
Note: See TracChangeset
for help on using the changeset viewer.