Changeset 410 for trunk/sources
- Timestamp:
- 07/30/08 13:16:34 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Functions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Functions/FunctionView.Designer.cs
r155 r410 50 50 private void InitializeComponent() { 51 51 this.components = new System.ComponentModel.Container(); 52 this.fun ctionTreeView = new System.Windows.Forms.TreeView();52 this.funTreeView = new System.Windows.Forms.TreeView(); 53 53 this.splitContainer = new System.Windows.Forms.SplitContainer(); 54 54 this.variablesGroupBox = new System.Windows.Forms.GroupBox(); … … 69 69 this.SuspendLayout(); 70 70 // 71 // functionTreeView 72 // 73 this.functionTreeView.Dock = System.Windows.Forms.DockStyle.Fill; 74 this.functionTreeView.HideSelection = false; 75 this.functionTreeView.Location = new System.Drawing.Point(0, 0); 76 this.functionTreeView.Name = "functionTreeView"; 77 this.functionTreeView.Size = new System.Drawing.Size(182, 532); 78 this.functionTreeView.TabIndex = 0; 79 this.functionTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.functionTreeView_AfterSelect); 71 // funTreeView 72 // 73 this.funTreeView.Dock = System.Windows.Forms.DockStyle.Fill; 74 this.funTreeView.HideSelection = false; 75 this.funTreeView.Location = new System.Drawing.Point(0, 0); 76 this.funTreeView.Name = "funTreeView"; 77 this.funTreeView.Size = new System.Drawing.Size(182, 532); 78 this.funTreeView.TabIndex = 0; 79 this.funTreeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.funTreeView_MouseUp); 80 this.funTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.functionTreeView_AfterSelect); 80 81 // 81 82 // splitContainer … … 87 88 // splitContainer.Panel1 88 89 // 89 this.splitContainer.Panel1.Controls.Add(this.fun ctionTreeView);90 this.splitContainer.Panel1.Controls.Add(this.funTreeView); 90 91 // 91 92 // splitContainer.Panel2 … … 167 168 this.copyToClipboardMenuItem}); 168 169 this.treeNodeContextMenu.Name = "treeNodeContextMenu"; 169 this.treeNodeContextMenu.Size = new System.Drawing.Size(2 48, 26);170 this.treeNodeContextMenu.Size = new System.Drawing.Size(259, 26); 170 171 // 171 172 // copyToClipboardMenuItem 172 173 // 173 174 this.copyToClipboardMenuItem.Name = "copyToClipboardMenuItem"; 174 this.copyToClipboardMenuItem.Size = new System.Drawing.Size(2 47, 22);175 this.copyToClipboardMenuItem.Size = new System.Drawing.Size(258, 22); 175 176 this.copyToClipboardMenuItem.Text = "Copy to clip-board (Model-Analyzer)"; 176 177 this.copyToClipboardMenuItem.Click += new System.EventHandler(this.copyToClipboardMenuItem_Click); 177 178 // 178 // Function View179 // FunctionTreeView 179 180 // 180 181 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 181 182 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 182 183 this.Controls.Add(this.splitContainer); 183 this.Name = "Function View";184 this.Name = "FunctionTreeView"; 184 185 this.Size = new System.Drawing.Size(735, 532); 185 186 this.splitContainer.Panel1.ResumeLayout(false); … … 197 198 #endregion 198 199 199 private System.Windows.Forms.TreeView fun ctionTreeView;200 private System.Windows.Forms.TreeView funTreeView; 200 201 private System.Windows.Forms.SplitContainer splitContainer; 201 202 private System.Windows.Forms.TextBox templateTextBox; -
trunk/sources/HeuristicLab.Functions/FunctionView.cs
r365 r410 52 52 53 53 protected override void UpdateControls() { 54 fun ctionTreeView.Nodes.Clear();54 funTreeView.Nodes.Clear(); 55 55 functionNameVisitor.Visit(functionTree); 56 56 TreeNode rootNode = new TreeNode(); … … 59 59 rootNode.Tag = functionTree; 60 60 rootNode.ContextMenuStrip = treeNodeContextMenu; 61 fun ctionTreeView.Nodes.Add(rootNode);61 funTreeView.Nodes.Add(rootNode); 62 62 63 63 foreach(IFunctionTree subTree in functionTree.SubTrees) { 64 64 CreateTree(rootNode, subTree); 65 65 } 66 fun ctionTreeView.ExpandAll();66 funTreeView.ExpandAll(); 67 67 } 68 68 … … 85 85 templateTextBox.Clear(); 86 86 editButton.Enabled = false; 87 if(fun ctionTreeView.SelectedNode != null && functionTreeView.SelectedNode.Tag != null) {88 IFunctionTree selectedBranch = (IFunctionTree)fun ctionTreeView.SelectedNode.Tag;87 if(funTreeView.SelectedNode != null && funTreeView.SelectedNode.Tag != null) { 88 IFunctionTree selectedBranch = (IFunctionTree)funTreeView.SelectedNode.Tag; 89 89 UpdateVariablesList(selectedBranch); 90 90 templateTextBox.Text = selectedBranch.Function.Name; … … 120 120 121 121 void selectedVariable_ValueChanged(object sender, EventArgs e) { 122 if(fun ctionTreeView.SelectedNode != null && functionTreeView.SelectedNode.Tag != null) {123 TreeNode node = fun ctionTreeView.SelectedNode;122 if(funTreeView.SelectedNode != null && funTreeView.SelectedNode.Tag != null) { 123 TreeNode node = funTreeView.SelectedNode; 124 124 functionNameVisitor.Visit(selectedBranch); 125 125 node.Text = functionNameVisitor.Name; … … 132 132 133 133 private void copyToClipboardMenuItem_Click(object sender, EventArgs e) { 134 TreeNode node = fun ctionTreeView.SelectedNode;134 TreeNode node = funTreeView.SelectedNode; 135 135 if(node == null || node.Tag == null) return; 136 136 … … 138 138 visitor.Visit((IFunctionTree)node.Tag); 139 139 Clipboard.SetText(visitor.ModelAnalyzerPrefix); 140 } 141 private void funTreeView_MouseUp(object sender, MouseEventArgs e) { 142 if(e.Button == MouseButtons.Right) { 143 // Select the clicked node 144 funTreeView.SelectedNode = funTreeView.GetNodeAt(e.X, e.Y); 145 } 140 146 } 141 147
Note: See TracChangeset
for help on using the changeset viewer.