Index: /trunk/sources/HeuristicLab.Functions/FunctionView.Designer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Functions/FunctionView.Designer.cs	(revision 409)
+++ /trunk/sources/HeuristicLab.Functions/FunctionView.Designer.cs	(revision 410)
@@ -50,5 +50,5 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
-      this.functionTreeView = new System.Windows.Forms.TreeView();
+      this.funTreeView = new System.Windows.Forms.TreeView();
       this.splitContainer = new System.Windows.Forms.SplitContainer();
       this.variablesGroupBox = new System.Windows.Forms.GroupBox();
@@ -69,13 +69,14 @@
       this.SuspendLayout();
       // 
-      // functionTreeView
-      // 
-      this.functionTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.functionTreeView.HideSelection = false;
-      this.functionTreeView.Location = new System.Drawing.Point(0, 0);
-      this.functionTreeView.Name = "functionTreeView";
-      this.functionTreeView.Size = new System.Drawing.Size(182, 532);
-      this.functionTreeView.TabIndex = 0;
-      this.functionTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.functionTreeView_AfterSelect);
+      // funTreeView
+      // 
+      this.funTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.funTreeView.HideSelection = false;
+      this.funTreeView.Location = new System.Drawing.Point(0, 0);
+      this.funTreeView.Name = "funTreeView";
+      this.funTreeView.Size = new System.Drawing.Size(182, 532);
+      this.funTreeView.TabIndex = 0;
+      this.funTreeView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.funTreeView_MouseUp);
+      this.funTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.functionTreeView_AfterSelect);
       // 
       // splitContainer
@@ -87,5 +88,5 @@
       // splitContainer.Panel1
       // 
-      this.splitContainer.Panel1.Controls.Add(this.functionTreeView);
+      this.splitContainer.Panel1.Controls.Add(this.funTreeView);
       // 
       // splitContainer.Panel2
@@ -167,19 +168,19 @@
             this.copyToClipboardMenuItem});
       this.treeNodeContextMenu.Name = "treeNodeContextMenu";
-      this.treeNodeContextMenu.Size = new System.Drawing.Size(248, 26);
+      this.treeNodeContextMenu.Size = new System.Drawing.Size(259, 26);
       // 
       // copyToClipboardMenuItem
       // 
       this.copyToClipboardMenuItem.Name = "copyToClipboardMenuItem";
-      this.copyToClipboardMenuItem.Size = new System.Drawing.Size(247, 22);
+      this.copyToClipboardMenuItem.Size = new System.Drawing.Size(258, 22);
       this.copyToClipboardMenuItem.Text = "Copy to clip-board (Model-Analyzer)";
       this.copyToClipboardMenuItem.Click += new System.EventHandler(this.copyToClipboardMenuItem_Click);
       // 
-      // FunctionView
+      // FunctionTreeView
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       this.Controls.Add(this.splitContainer);
-      this.Name = "FunctionView";
+      this.Name = "FunctionTreeView";
       this.Size = new System.Drawing.Size(735, 532);
       this.splitContainer.Panel1.ResumeLayout(false);
@@ -197,5 +198,5 @@
     #endregion
 
-    private System.Windows.Forms.TreeView functionTreeView;
+    private System.Windows.Forms.TreeView funTreeView;
     private System.Windows.Forms.SplitContainer splitContainer;
     private System.Windows.Forms.TextBox templateTextBox;
Index: /trunk/sources/HeuristicLab.Functions/FunctionView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Functions/FunctionView.cs	(revision 409)
+++ /trunk/sources/HeuristicLab.Functions/FunctionView.cs	(revision 410)
@@ -52,5 +52,5 @@
 
     protected override void UpdateControls() {
-      functionTreeView.Nodes.Clear();
+      funTreeView.Nodes.Clear();
       functionNameVisitor.Visit(functionTree);
       TreeNode rootNode = new TreeNode();
@@ -59,10 +59,10 @@
       rootNode.Tag = functionTree;
       rootNode.ContextMenuStrip = treeNodeContextMenu;
-      functionTreeView.Nodes.Add(rootNode);
+      funTreeView.Nodes.Add(rootNode);
 
       foreach(IFunctionTree subTree in functionTree.SubTrees) {
         CreateTree(rootNode, subTree);
       }
-      functionTreeView.ExpandAll();
+      funTreeView.ExpandAll();
     }
 
@@ -85,6 +85,6 @@
       templateTextBox.Clear();
       editButton.Enabled = false;
-      if(functionTreeView.SelectedNode != null && functionTreeView.SelectedNode.Tag != null) {
-        IFunctionTree selectedBranch = (IFunctionTree)functionTreeView.SelectedNode.Tag;
+      if(funTreeView.SelectedNode != null && funTreeView.SelectedNode.Tag != null) {
+        IFunctionTree selectedBranch = (IFunctionTree)funTreeView.SelectedNode.Tag;
         UpdateVariablesList(selectedBranch);
         templateTextBox.Text = selectedBranch.Function.Name;
@@ -120,6 +120,6 @@
 
     void selectedVariable_ValueChanged(object sender, EventArgs e) {
-      if(functionTreeView.SelectedNode != null && functionTreeView.SelectedNode.Tag != null) {
-        TreeNode node = functionTreeView.SelectedNode;
+      if(funTreeView.SelectedNode != null && funTreeView.SelectedNode.Tag != null) {
+        TreeNode node = funTreeView.SelectedNode;
         functionNameVisitor.Visit(selectedBranch);
         node.Text = functionNameVisitor.Name;
@@ -132,5 +132,5 @@
 
     private void copyToClipboardMenuItem_Click(object sender, EventArgs e) {
-      TreeNode node = functionTreeView.SelectedNode;
+      TreeNode node = funTreeView.SelectedNode;
       if(node == null || node.Tag == null) return;
 
@@ -138,4 +138,10 @@
       visitor.Visit((IFunctionTree)node.Tag);
       Clipboard.SetText(visitor.ModelAnalyzerPrefix);
+    }
+    private void funTreeView_MouseUp(object sender, MouseEventArgs e) {
+      if(e.Button == MouseButtons.Right) {
+        // Select the clicked node
+        funTreeView.SelectedNode = funTreeView.GetNodeAt(e.X, e.Y);
+      }
     }
 
