Fixed Issue 76.
1.1 --- a/GUI/MainForm.cs Sun Jun 27 10:24:27 2010 +0000
1.2 +++ b/GUI/MainForm.cs Sun Jun 27 10:54:19 2010 +0000
1.3 @@ -73,6 +73,7 @@
1.4 nodeTextBoxValue.DrawText += nodeTextBoxText_DrawText;
1.5 nodeTextBoxMin.DrawText += nodeTextBoxText_DrawText;
1.6 nodeTextBoxMax.DrawText += nodeTextBoxText_DrawText;
1.7 + nodeTextBoxText.EditorShowing += nodeTextBoxText_EditorShowing;
1.8
1.9 if (Utilities.Config.Contains("mainForm.Location.X")) {
1.10 int x = Utilities.Config.Get("mainForm.Location.X", Location.X);
1.11 @@ -227,6 +228,12 @@
1.12 plotPanel.SetSensors(selected, colors);
1.13 }
1.14
1.15 + private void nodeTextBoxText_EditorShowing(object sender, CancelEventArgs e)
1.16 + {
1.17 + e.Cancel = !(treeView.CurrentNode != null &&
1.18 + treeView.CurrentNode.Tag is SensorNode);
1.19 + }
1.20 +
1.21 private void nodeCheckBox_IsVisibleValueNeeded(object sender,
1.22 NodeControlValueEventArgs e) {
1.23 SensorNode node = e.Node.Tag as SensorNode;
1.24 @@ -310,6 +317,14 @@
1.25 };
1.26 sensorContextMenuStrip.Items.Add(item);
1.27 }
1.28 + EditableControl control = info.Control as EditableControl;
1.29 + if (control != null) {
1.30 + ToolStripMenuItem item = new ToolStripMenuItem("Rename");
1.31 + item.Click += delegate(object obj, EventArgs args) {
1.32 + control.BeginEdit();
1.33 + };
1.34 + sensorContextMenuStrip.Items.Add(item);
1.35 + }
1.36 if (node.IsVisible) {
1.37 ToolStripMenuItem item = new ToolStripMenuItem("Hide");
1.38 item.Click += delegate(object obj, EventArgs args) {