Changeset 16777
- Timestamp:
- 04/12/19 10:32:44 (6 years ago)
- Location:
- branches/2971_named_intervals
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.Designer.cs
r16776 r16777 39 39 this.numberderivationInput = new System.Windows.Forms.TextBox(); 40 40 this.groupBox1 = new System.Windows.Forms.GroupBox(); 41 this.ischeckedCheckBox = new System.Windows.Forms.CheckBox(); 42 this.expressionInput = new System.Windows.Forms.TextBox(); 43 this.expressionLabel = new System.Windows.Forms.Label(); 41 44 this.inclupperboundInput = new System.Windows.Forms.CheckBox(); 42 45 this.incllowerboundInput = new System.Windows.Forms.CheckBox(); 43 46 this.derivationInput = new System.Windows.Forms.CheckBox(); 44 this.expressionLabel = new System.Windows.Forms.Label();45 this.expressionInput = new System.Windows.Forms.TextBox();46 47 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 47 48 this.groupBox1.SuspendLayout(); … … 174 175 // groupBox1 175 176 // 177 this.groupBox1.Controls.Add(this.ischeckedCheckBox); 176 178 this.groupBox1.Controls.Add(this.expressionInput); 177 179 this.groupBox1.Controls.Add(this.expressionLabel); … … 200 202 this.groupBox1.Text = "Interval Constraints Detail"; 201 203 // 204 // ischeckedCheckBox 205 // 206 this.ischeckedCheckBox.AutoSize = true; 207 this.ischeckedCheckBox.Location = new System.Drawing.Point(14, 257); 208 this.ischeckedCheckBox.Name = "ischeckedCheckBox"; 209 this.ischeckedCheckBox.Size = new System.Drawing.Size(65, 17); 210 this.ischeckedCheckBox.TabIndex = 26; 211 this.ischeckedCheckBox.Text = "Enabled"; 212 this.ischeckedCheckBox.UseVisualStyleBackColor = true; 213 this.ischeckedCheckBox.CheckStateChanged += new System.EventHandler(this.ischeckedCheckBox_CheckStateChanged); 214 // 215 // expressionInput 216 // 217 this.expressionInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 218 | System.Windows.Forms.AnchorStyles.Right))); 219 this.expressionInput.Location = new System.Drawing.Point(108, 17); 220 this.expressionInput.Name = "expressionInput"; 221 this.expressionInput.Size = new System.Drawing.Size(473, 20); 222 this.expressionInput.TabIndex = 25; 223 // 224 // expressionLabel 225 // 226 this.expressionLabel.AutoSize = true; 227 this.expressionLabel.Location = new System.Drawing.Point(11, 20); 228 this.expressionLabel.Name = "expressionLabel"; 229 this.expressionLabel.Size = new System.Drawing.Size(61, 13); 230 this.expressionLabel.TabIndex = 24; 231 this.expressionLabel.Text = "Expression:"; 232 // 202 233 // inclupperboundInput 203 234 // … … 228 259 this.derivationInput.TabIndex = 21; 229 260 this.derivationInput.UseVisualStyleBackColor = true; 230 //231 // expressionLabel232 //233 this.expressionLabel.AutoSize = true;234 this.expressionLabel.Location = new System.Drawing.Point(11, 20);235 this.expressionLabel.Name = "expressionLabel";236 this.expressionLabel.Size = new System.Drawing.Size(61, 13);237 this.expressionLabel.TabIndex = 24;238 this.expressionLabel.Text = "Expression:";239 //240 // expressionInput241 //242 this.expressionInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)243 | System.Windows.Forms.AnchorStyles.Right)));244 this.expressionInput.Location = new System.Drawing.Point(108, 17);245 this.expressionInput.Name = "expressionInput";246 this.expressionInput.Size = new System.Drawing.Size(473, 20);247 this.expressionInput.TabIndex = 25;248 261 // 249 262 // errorProvider … … 286 299 private System.Windows.Forms.Label expressionLabel; 287 300 private System.Windows.Forms.ErrorProvider errorProvider; 301 private System.Windows.Forms.CheckBox ischeckedCheckBox; 288 302 } 289 303 } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs
r16776 r16777 86 86 variableInput.Text = Content.Variable; 87 87 numberderivationInput.Text = Content.NumberOfDerivation.ToString(); 88 ischeckedCheckBox.Checked = Content.IsChecked; 89 //Content.Changed += Content_Changed; 90 88 91 } 89 92 SetEnabledStateOfControls(); … … 116 119 #endregion 117 120 118 #region cont entevent handlers121 #region control event handlers 119 122 120 123 private void numberderivationInput_Validating(object sender, CancelEventArgs e) { … … 196 199 197 200 private void inclupperboundInput_CheckedChanged(object sender, EventArgs e) { 198 if (Content.InclusiveUpperBound != incllowerboundInput.Checked) { 199 Content.InclusiveUpperBound = incllowerboundInput.Checked; 200 UpdateExpression(); 201 } 202 } 201 if (Content.InclusiveUpperBound != inclupperboundInput.Checked) { 202 Content.InclusiveUpperBound = inclupperboundInput.Checked; 203 UpdateExpression(); 204 } 205 } 206 207 private void ischeckedCheckBox_CheckStateChanged(object sender, EventArgs e) { 208 if (Content.IsChecked != ischeckedCheckBox.Checked) { 209 Content.IsChecked = ischeckedCheckBox.Checked; 210 UpdateControls(); 211 } 212 } 213 203 214 #endregion 204 215 205 216 #region content event handlers 217 218 private void Content_Changed(object sender, EventArgs e) { 219 UpdateControls(); 220 } 221 222 #endregion 206 223 } 207 224 } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ParsedConstraintView.cs
r16776 r16777 1 1 using System; 2 2 using HeuristicLab.Collections; 3 3 using HeuristicLab.Core; 4 4 using HeuristicLab.MainForm; … … 19 19 errorOutput.Text = ""; 20 20 intervalConstraints = new CheckedItemList<IntervalConstraint>(); 21 } 22 23 private void Content_Changed(object sender, EventArgs e) { 24 constraintsOutput.Content = intervalConstraints; 21 intervalConstraints.CheckedItemsChanged += constraints_CheckedItemsChanged; 25 22 } 26 23 … … 37 34 private void parseBtn_Click(object sender, EventArgs e) { 38 35 if (constraintsInput.Text != null) { 39 var constaints = ParseConstraints(constraintsInput.Text); 40 constraintsOutput.Content = constaints; 41 Content.Constraints = constaints; 36 intervalConstraints = ParseConstraints(constraintsInput.Text); 37 intervalConstraints.CheckedItemsChanged += constraints_CheckedItemsChanged; 38 constraintsOutput.Content = intervalConstraints; 39 Content.Constraints = intervalConstraints; 42 40 Content.Input = constraintsInput.Text; 43 41 errorOutput.Text = ""; … … 57 55 foreach (var constraint in Content.Constraints) { 58 56 constraint.Changed += new EventHandler(Content_Changed); 59 intervalConstraints.Add(constraint, true);57 intervalConstraints.Add(constraint, constraint.IsChecked); 60 58 } 61 59 } 60 constraintsOutput.Content = intervalConstraints; 62 61 } 63 62 64 63 private void constraintsInput_TextChanged(object sender, EventArgs e) { 65 64 errorOutput.Text = "Unparsed changes! Press parse button to save changes."; 65 } 66 67 private void Content_Changed(object sender, EventArgs e) { 68 var constraint = (IntervalConstraint) sender; 69 intervalConstraints.SetItemCheckedState(constraint, constraint.IsChecked); 70 constraintsOutput.Content = intervalConstraints; 71 } 72 73 private void constraints_CheckedItemsChanged(object sender, 74 CollectionItemsChangedEventArgs<IndexedItem<IntervalConstraint>> e) { 75 var checkedItemList = (ICheckedItemList<IntervalConstraint>) sender; 76 foreach (var indexedItem in e.Items) { 77 indexedItem.Value.IsChecked = checkedItemList.ItemChecked(indexedItem.Value); 78 } 66 79 } 67 80 -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs
r16776 r16777 49 49 public int NumberOfDerivation { get; set; } 50 50 51 public IntervalConstraint() {} 51 private bool isChecked; 52 public bool IsChecked { 53 get => isChecked; 54 set { 55 if (value != isChecked) { 56 isChecked = value; 57 OnChanged(EventArgs.Empty); 58 } 59 } 60 } 61 62 public IntervalConstraint() { 63 name = "Empty"; 64 expression = "Empty"; 65 Interval = new Interval(0, 0); 66 inclusiveLowerBound = true; 67 inclusiveLowerBound = true; 68 IsDerivation = false; 69 isChecked = false; 70 } 52 71 53 72 public IntervalConstraint(string name) { 54 73 base.name = name; 74 IsChecked = true; 55 75 } 56 76 57 77 public IntervalConstraint(string expression, string definition, Interval interval, bool inclusiveLowerBound, 58 bool inclusiveUpperBound, bool isDerivation, string variable, int numberOfDerivation ) {78 bool inclusiveUpperBound, bool isDerivation, string variable, int numberOfDerivation, bool isChecked) { 59 79 base.name = expression; 60 80 Expression = expression; … … 66 86 Variable = variable; 67 87 NumberOfDerivation = numberOfDerivation; 88 IsChecked = isChecked; 68 89 } 69 90 … … 82 103 this.Variable = original.Variable; 83 104 this.NumberOfDerivation = original.NumberOfDerivation; 105 this.isChecked = original.isChecked; 84 106 } 85 107 -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ParsedConstraint.cs
r16776 r16777 42 42 this.input = original.Input ?? string.Empty; 43 43 this.constraints = original.Constraints ?? new CheckedItemList<IntervalConstraint>(); 44 44 this.problemData = original.problemData; 45 45 } 46 46
Note: See TracChangeset
for help on using the changeset viewer.