Changeset 17687 for branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs
- Timestamp:
- 07/19/20 19:07:40 (4 years ago)
- Location:
- branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed
-
branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs
r9708 r17687 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-2013Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using System.ComponentModel; 25 using System.Linq; 25 26 using System.Text; 26 27 using System.Windows.Forms; … … 30 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 31 32 public partial class InsertNodeDialog : Form { 33 public string SelectedVariableName { 34 get { 35 var variable = SelectedSymbol as Variable; 36 if (variable == null) 37 return string.Empty; 38 return variable.VariableNames.Any() ? variableNamesCombo.Text : variableNameTextBox.Text; 39 } 40 } 41 32 42 public InsertNodeDialog() { 33 43 InitializeComponent(); … … 40 50 } 41 51 42 public ISymbol SelectedSymbol (){43 return (ISymbol)allowedSymbolsCombo.SelectedItem;52 public ISymbol SelectedSymbol { 53 get { return (ISymbol)allowedSymbolsCombo.SelectedItem; } 44 54 } 45 55 … … 55 65 constantValueLabel.Visible = true; 56 66 constantValueTextBox.Visible = true; 57 } else if (symbol is Variable) { 58 var variable = (Variable)symbol; 59 foreach (var name in variable.VariableNames) variableNamesCombo.Items.Add(name); 60 variableNamesCombo.SelectedIndex = 0; 67 } else if (symbol is VariableBase) { 68 var variableSymbol = (VariableBase)symbol; 69 if (variableSymbol.VariableNames.Any()) { 70 foreach (var name in variableSymbol.VariableNames) 71 variableNamesCombo.Items.Add(name); 72 variableNamesCombo.SelectedIndex = 0; 73 variableNamesCombo.Visible = true; 74 variableNameTextBox.Visible = false; 75 } else { 76 variableNamesCombo.Visible = false; 77 variableNameTextBox.Visible = true; 78 } 61 79 variableNameLabel.Visible = true; 62 variableNamesCombo.Visible = true;63 80 variableWeightLabel.Visible = true; 64 81 variableWeightTextBox.Visible = true;
Note: See TracChangeset
for help on using the changeset viewer.