Changeset 7372 for branches/HeuristicLab.TreeSimplifierView/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Timestamp:
- 01/19/12 17:04:32 (13 years ago)
- Location:
- branches/HeuristicLab.TreeSimplifierView/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TreeSimplifierView/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r7365 r7372 211 211 </BootstrapperPackage> 212 212 </ItemGroup> 213 <ItemGroup> 214 <EmbeddedResource Include="InteractiveSymbolicDataAnalysisSolutionSimplifierView.resx"> 215 <DependentUpon>InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs</DependentUpon> 216 </EmbeddedResource> 217 </ItemGroup> 213 218 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 214 219 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
branches/HeuristicLab.TreeSimplifierView/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs
r6256 r7372 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.treeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();48 47 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 49 48 this.splitContainer = new System.Windows.Forms.SplitContainer(); … … 53 52 this.btnOptimizeConstants = new System.Windows.Forms.Button(); 54 53 this.grpViewHost = new System.Windows.Forms.GroupBox(); 54 this.treeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart(); 55 55 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 56 56 this.splitContainer.Panel1.SuspendLayout(); … … 61 61 this.grpViewHost.SuspendLayout(); 62 62 this.SuspendLayout(); 63 //64 // treeChart65 //66 this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)67 | System.Windows.Forms.AnchorStyles.Left)68 | System.Windows.Forms.AnchorStyles.Right)));69 this.treeChart.BackgroundColor = System.Drawing.Color.White;70 this.treeChart.LineColor = System.Drawing.Color.Black;71 this.treeChart.Location = new System.Drawing.Point(6, 16);72 this.treeChart.Name = "treeChart";73 this.treeChart.Size = new System.Drawing.Size(201, 291);74 this.treeChart.Spacing = 5;75 this.treeChart.TabIndex = 0;76 this.treeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);77 this.treeChart.Tree = null;78 this.treeChart.SymbolicExpressionTreeNodeDoubleClicked += new System.Windows.Forms.MouseEventHandler(this.treeChart_SymbolicExpressionTreeNodeDoubleClicked);79 63 // 80 64 // viewHost … … 168 152 this.grpViewHost.Text = "Details"; 169 153 // 154 // treeChart 155 // 156 this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 157 | System.Windows.Forms.AnchorStyles.Left) 158 | System.Windows.Forms.AnchorStyles.Right))); 159 this.treeChart.BackgroundColor = System.Drawing.Color.White; 160 this.treeChart.LineColor = System.Drawing.Color.Black; 161 this.treeChart.Location = new System.Drawing.Point(6, 16); 162 this.treeChart.Name = "treeChart"; 163 this.treeChart.Size = new System.Drawing.Size(201, 291); 164 this.treeChart.Spacing = 5; 165 this.treeChart.SuspendRepaint = false; 166 this.treeChart.TabIndex = 0; 167 this.treeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F); 168 this.treeChart.Tree = null; 169 this.treeChart.SymbolicExpressionTreeNodeClicked += new System.Windows.Forms.MouseEventHandler(this.treeChart_SymbolicExpressionTreeNodeClicked); 170 this.treeChart.SymbolicExpressionTreeNodeDoubleClicked += new System.Windows.Forms.MouseEventHandler(this.treeChart_SymbolicExpressionTreeNodeDoubleClicked); 171 // 170 172 // InteractiveSymbolicDataAnalysisSolutionSimplifierView 171 173 // -
branches/HeuristicLab.TreeSimplifierView/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r7259 r7372 146 146 updateInProgress = false; 147 147 return; // break all loops 148 } 149 } 150 } 151 } 152 153 private void treeChart_SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) { 154 if (e.Button == MouseButtons.Right) { 155 var visualTreeNode = sender as VisualSymbolicExpressionTreeNode; 156 var node = visualTreeNode.SymbolicExpressionTreeNode; 157 // on a right click we want to show the option of changing the node value (if the node is a constant) or the weight (if the node is a variable) 158 var menu = treeChart.ContextMenuStrip; 159 ToolStripItem[] items = menu.Items.Find("changeValueToolStripMenuItem", false); 160 ToolStripItem changeValueMenuItem = null; 161 if (items.Length > 0) { 162 changeValueMenuItem = items[0]; 163 } 164 165 if (node.Symbol is Constant || node.Symbol is Variable) { 166 if (changeValueMenuItem != null) { 167 changeValueMenuItem.Enabled = true; 168 changeValueMenuItem.Visible = true; 169 } 170 } else { 171 if (changeValueMenuItem != null) { 172 changeValueMenuItem.Enabled = false; 173 changeValueMenuItem.Visible = false; 148 174 } 149 175 }
Note: See TracChangeset
for help on using the changeset viewer.