GUI/MainForm.cs
changeset 63 1a7c13ac7348
parent 57 142907c75be4
child 64 15181001ee61
     1.1 --- a/GUI/MainForm.cs	Tue Feb 23 19:45:40 2010 +0000
     1.2 +++ b/GUI/MainForm.cs	Sat Feb 27 15:55:17 2010 +0000
     1.3 @@ -63,7 +63,7 @@
     1.4        InitializeComponent();
     1.5        this.Font = SystemFonts.MessageBoxFont;
     1.6        treeView.Font = SystemFonts.MessageBoxFont;
     1.7 -      plotPanel.Font = SystemFonts.MessageBoxFont;      
     1.8 +      plotPanel.Font = SystemFonts.MessageBoxFont;
     1.9        
    1.10        nodeCheckBox.IsVisibleValueNeeded += 
    1.11          new EventHandler<NodeControlValueEventArgs>(
    1.12 @@ -320,6 +320,13 @@
    1.13          if (node != null && node.Sensor != null) {
    1.14  
    1.15            sensorContextMenuStrip.Items.Clear();
    1.16 +          if (node.Sensor.Parameters.Length > 0) {
    1.17 +            ToolStripMenuItem item = new ToolStripMenuItem("Parameters...");
    1.18 +            item.Click += delegate(object obj, EventArgs args) {
    1.19 +              ShowParameterForm(node.Sensor);
    1.20 +            };
    1.21 +            sensorContextMenuStrip.Items.Add(item);
    1.22 +          }
    1.23            if (sensorSystemTray.Contains(node.Sensor)) {
    1.24              ToolStripMenuItem item = new ToolStripMenuItem("Remove From Tray");
    1.25              item.Click += delegate(object obj, EventArgs args) {
    1.26 @@ -398,5 +405,21 @@
    1.27  
    1.28        sensorSystemTray.Remove(sensor);
    1.29      }
    1.30 +
    1.31 +    private void ShowParameterForm(ISensor sensor) {
    1.32 +      ParameterForm form = new ParameterForm();
    1.33 +      form.Parameters = sensor.Parameters;
    1.34 +      form.captionLabel.Text = sensor.Name;
    1.35 +      form.ShowDialog();
    1.36 +    }
    1.37 +
    1.38 +    private void treeView_NodeMouseDoubleClick(object sender, 
    1.39 +      TreeNodeAdvMouseEventArgs e) {
    1.40 +      SensorNode node = e.Node.Tag as SensorNode;
    1.41 +      if (node != null && node.Sensor != null && 
    1.42 +        node.Sensor.Parameters.Length > 0) {
    1.43 +        ShowParameterForm(node.Sensor);
    1.44 +      }
    1.45 +    }
    1.46    }
    1.47  }