Replaced all menus with the native implementations MainMenu and ContextMenu. Fixed a bug with the sensor renaming context menu.
authormoel.mich
Sun, 18 Jul 2010 12:38:01 +0000
changeset 1563e2ab626531c
parent 155 8ffea928daad
child 157 0b5cc38501e1
Replaced all menus with the native implementations MainMenu and ContextMenu. Fixed a bug with the sensor renaming context menu.
GUI/MainForm.Designer.cs
GUI/MainForm.cs
GUI/MainForm.resx
GUI/SensorNotifyIcon.cs
GUI/SystemTray.cs
GUI/UserOption.cs
OpenHardwareMonitor.csproj
Properties/AssemblyInfo.cs
     1.1 --- a/GUI/MainForm.Designer.cs	Sat Jul 17 13:25:42 2010 +0000
     1.2 +++ b/GUI/MainForm.Designer.cs	Sun Jul 18 12:38:01 2010 +0000
     1.3 @@ -73,40 +73,39 @@
     1.4        this.nodeTextBoxValue = new Aga.Controls.Tree.NodeControls.NodeTextBox();
     1.5        this.nodeTextBoxMin = new Aga.Controls.Tree.NodeControls.NodeTextBox();
     1.6        this.nodeTextBoxMax = new Aga.Controls.Tree.NodeControls.NodeTextBox();
     1.7 -      this.menuStrip = new System.Windows.Forms.MenuStrip();
     1.8 -      this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     1.9 -      this.saveReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.10 -      this.sumbitReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.11 -      this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
    1.12 -      this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.13 -      this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.14 -      this.hiddenMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.15 -      this.plotMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.16 -      this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
    1.17 -      this.columnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.18 -      this.valueMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.19 -      this.minMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.20 -      this.maxMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.21 -      this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.22 -      this.startMinMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.23 -      this.minTrayMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.24 -      this.startupMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.25 -      this.separatorMenuItem = new System.Windows.Forms.ToolStripSeparator();
    1.26 -      this.temperatureUnitsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.27 -      this.celciusToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.28 -      this.fahrenheitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.29 -      this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
    1.30 -      this.hddMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.31 -      this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.32 -      this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.33 +      this.mainMenu = new System.Windows.Forms.MainMenu(this.components);
    1.34 +      this.fileMenuItem = new System.Windows.Forms.MenuItem();
    1.35 +      this.saveReportMenuItem = new System.Windows.Forms.MenuItem();
    1.36 +      this.sumbitReportMenuItem = new System.Windows.Forms.MenuItem();
    1.37 +      this.MenuItem2 = new System.Windows.Forms.MenuItem();
    1.38 +      this.exitMenuItem = new System.Windows.Forms.MenuItem();
    1.39 +      this.viewMenuItem = new System.Windows.Forms.MenuItem();
    1.40 +      this.resetMinMaxMenuItem = new System.Windows.Forms.MenuItem();
    1.41 +      this.MenuItem3 = new System.Windows.Forms.MenuItem();
    1.42 +      this.hiddenMenuItem = new System.Windows.Forms.MenuItem();
    1.43 +      this.plotMenuItem = new System.Windows.Forms.MenuItem();
    1.44 +      this.MenuItem1 = new System.Windows.Forms.MenuItem();
    1.45 +      this.columnsMenuItem = new System.Windows.Forms.MenuItem();
    1.46 +      this.valueMenuItem = new System.Windows.Forms.MenuItem();
    1.47 +      this.minMenuItem = new System.Windows.Forms.MenuItem();
    1.48 +      this.maxMenuItem = new System.Windows.Forms.MenuItem();
    1.49 +      this.optionsMenuItem = new System.Windows.Forms.MenuItem();
    1.50 +      this.startMinMenuItem = new System.Windows.Forms.MenuItem();
    1.51 +      this.minTrayMenuItem = new System.Windows.Forms.MenuItem();
    1.52 +      this.startupMenuItem = new System.Windows.Forms.MenuItem();
    1.53 +      this.separatorMenuItem = new System.Windows.Forms.MenuItem();
    1.54 +      this.temperatureUnitsMenuItem = new System.Windows.Forms.MenuItem();
    1.55 +      this.celciusMenuItem = new System.Windows.Forms.MenuItem();
    1.56 +      this.fahrenheitMenuItem = new System.Windows.Forms.MenuItem();
    1.57 +      this.MenuItem4 = new System.Windows.Forms.MenuItem();
    1.58 +      this.hddMenuItem = new System.Windows.Forms.MenuItem();
    1.59 +      this.helpMenuItem = new System.Windows.Forms.MenuItem();
    1.60 +      this.aboutMenuItem = new System.Windows.Forms.MenuItem();
    1.61        this.splitContainer = new System.Windows.Forms.SplitContainer();
    1.62        this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel();
    1.63 -      this.sensorContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
    1.64 +      this.sensorContextMenu = new System.Windows.Forms.ContextMenu();
    1.65        this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
    1.66        this.timer = new System.Windows.Forms.Timer(this.components);
    1.67 -      this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
    1.68 -      this.resetMinMaxMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.69 -      this.menuStrip.SuspendLayout();
    1.70        this.splitContainer.Panel1.SuspendLayout();
    1.71        this.splitContainer.Panel2.SuspendLayout();
    1.72        this.splitContainer.SuspendLayout();
    1.73 @@ -136,7 +135,7 @@
    1.74        this.treeView.NodeControls.Add(this.nodeTextBoxMax);
    1.75        this.treeView.RowHeight = 18;
    1.76        this.treeView.SelectedNode = null;
    1.77 -      this.treeView.Size = new System.Drawing.Size(410, 488);
    1.78 +      this.treeView.Size = new System.Drawing.Size(386, 488);
    1.79        this.treeView.TabIndex = 0;
    1.80        this.treeView.Text = "treeView";
    1.81        this.treeView.UseColumns = true;
    1.82 @@ -214,229 +213,188 @@
    1.83        this.nodeTextBoxMax.LeftMargin = 3;
    1.84        this.nodeTextBoxMax.ParentColumn = this.max;
    1.85        // 
    1.86 -      // menuStrip
    1.87 +      // mainMenu
    1.88        // 
    1.89 -      this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
    1.90 -            this.fileToolStripMenuItem,
    1.91 -            this.viewToolStripMenuItem,
    1.92 -            this.optionsToolStripMenuItem,
    1.93 -            this.helpToolStripMenuItem});
    1.94 -      this.menuStrip.Location = new System.Drawing.Point(0, 0);
    1.95 -      this.menuStrip.Name = "menuStrip";
    1.96 -      this.menuStrip.Size = new System.Drawing.Size(410, 24);
    1.97 -      this.menuStrip.TabIndex = 1;
    1.98 -      this.menuStrip.Text = "menuStrip1";
    1.99 +      this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.100 +            this.fileMenuItem,
   1.101 +            this.viewMenuItem,
   1.102 +            this.optionsMenuItem,
   1.103 +            this.helpMenuItem});
   1.104        // 
   1.105 -      // fileToolStripMenuItem
   1.106 +      // fileMenuItem
   1.107        // 
   1.108 -      this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
   1.109 -            this.saveReportToolStripMenuItem,
   1.110 -            this.sumbitReportToolStripMenuItem,
   1.111 -            this.toolStripMenuItem2,
   1.112 -            this.exitToolStripMenuItem});
   1.113 -      this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
   1.114 -      this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
   1.115 -      this.fileToolStripMenuItem.Text = "File";
   1.116 +      this.fileMenuItem.Index = 0;
   1.117 +      this.fileMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.118 +            this.saveReportMenuItem,
   1.119 +            this.sumbitReportMenuItem,
   1.120 +            this.MenuItem2,
   1.121 +            this.exitMenuItem});
   1.122 +      this.fileMenuItem.Text = "File";
   1.123        // 
   1.124 -      // saveReportToolStripMenuItem
   1.125 +      // saveReportMenuItem
   1.126        // 
   1.127 -      this.saveReportToolStripMenuItem.Name = "saveReportToolStripMenuItem";
   1.128 -      this.saveReportToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
   1.129 -      this.saveReportToolStripMenuItem.Text = "Save Report...";
   1.130 -      this.saveReportToolStripMenuItem.Click += new System.EventHandler(this.saveReportToolStripMenuItem_Click);
   1.131 +      this.saveReportMenuItem.Index = 0;
   1.132 +      this.saveReportMenuItem.Text = "Save Report...";
   1.133 +      this.saveReportMenuItem.Click += new System.EventHandler(this.saveReportMenuItem_Click);
   1.134        // 
   1.135 -      // sumbitReportToolStripMenuItem
   1.136 +      // sumbitReportMenuItem
   1.137        // 
   1.138 -      this.sumbitReportToolStripMenuItem.Name = "sumbitReportToolStripMenuItem";
   1.139 -      this.sumbitReportToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
   1.140 -      this.sumbitReportToolStripMenuItem.Text = "Submit Report...";
   1.141 -      this.sumbitReportToolStripMenuItem.Click += new System.EventHandler(this.sumbitReportToolStripMenuItem_Click);
   1.142 +      this.sumbitReportMenuItem.Index = 1;
   1.143 +      this.sumbitReportMenuItem.Text = "Submit Report...";
   1.144 +      this.sumbitReportMenuItem.Click += new System.EventHandler(this.sumbitReportMenuItem_Click);
   1.145        // 
   1.146 -      // toolStripMenuItem2
   1.147 +      // MenuItem2
   1.148        // 
   1.149 -      this.toolStripMenuItem2.Name = "toolStripMenuItem2";
   1.150 -      this.toolStripMenuItem2.Size = new System.Drawing.Size(156, 6);
   1.151 +      this.MenuItem2.Index = 2;
   1.152 +      this.MenuItem2.Text = "-";
   1.153        // 
   1.154 -      // exitToolStripMenuItem
   1.155 +      // exitMenuItem
   1.156        // 
   1.157 -      this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
   1.158 -      this.exitToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
   1.159 -      this.exitToolStripMenuItem.Text = "Exit";
   1.160 -      this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitClick);
   1.161 +      this.exitMenuItem.Index = 3;
   1.162 +      this.exitMenuItem.Text = "Exit";
   1.163 +      this.exitMenuItem.Click += new System.EventHandler(this.exitClick);
   1.164        // 
   1.165 -      // viewToolStripMenuItem
   1.166 +      // viewMenuItem
   1.167        // 
   1.168 -      this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
   1.169 +      this.viewMenuItem.Index = 1;
   1.170 +      this.viewMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.171              this.resetMinMaxMenuItem,
   1.172 -            this.toolStripMenuItem3,
   1.173 +            this.MenuItem3,
   1.174              this.hiddenMenuItem,
   1.175              this.plotMenuItem,
   1.176 -            this.toolStripMenuItem1,
   1.177 -            this.columnsToolStripMenuItem});
   1.178 -      this.viewToolStripMenuItem.Name = "viewToolStripMenuItem";
   1.179 -      this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
   1.180 -      this.viewToolStripMenuItem.Text = "View";
   1.181 +            this.MenuItem1,
   1.182 +            this.columnsMenuItem});
   1.183 +      this.viewMenuItem.Text = "View";
   1.184 +      // 
   1.185 +      // resetMinMaxMenuItem
   1.186 +      // 
   1.187 +      this.resetMinMaxMenuItem.Index = 0;
   1.188 +      this.resetMinMaxMenuItem.Text = "Reset Min/Max";
   1.189 +      this.resetMinMaxMenuItem.Click += new System.EventHandler(this.resetMinMaxMenuItem_Click);
   1.190 +      // 
   1.191 +      // MenuItem3
   1.192 +      // 
   1.193 +      this.MenuItem3.Index = 1;
   1.194 +      this.MenuItem3.Text = "-";
   1.195        // 
   1.196        // hiddenMenuItem
   1.197        // 
   1.198 -      this.hiddenMenuItem.CheckOnClick = true;
   1.199 -      this.hiddenMenuItem.Name = "hiddenMenuItem";
   1.200 -      this.hiddenMenuItem.Size = new System.Drawing.Size(188, 22);
   1.201 +      this.hiddenMenuItem.Index = 2;
   1.202        this.hiddenMenuItem.Text = "Show Hidden Sensors";
   1.203 -      this.hiddenMenuItem.CheckedChanged += new System.EventHandler(this.hiddenSensorsMenuItem_CheckedChanged);
   1.204        // 
   1.205        // plotMenuItem
   1.206        // 
   1.207 -      this.plotMenuItem.Checked = true;
   1.208 -      this.plotMenuItem.CheckOnClick = true;
   1.209 -      this.plotMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
   1.210 -      this.plotMenuItem.Name = "plotMenuItem";
   1.211 -      this.plotMenuItem.Size = new System.Drawing.Size(188, 22);
   1.212 +      this.plotMenuItem.Index = 3;
   1.213        this.plotMenuItem.Text = "Show Plot";
   1.214 -      this.plotMenuItem.CheckedChanged += new System.EventHandler(this.plotToolStripMenuItem_CheckedChanged);
   1.215        // 
   1.216 -      // toolStripMenuItem1
   1.217 +      // MenuItem1
   1.218        // 
   1.219 -      this.toolStripMenuItem1.Name = "toolStripMenuItem1";
   1.220 -      this.toolStripMenuItem1.Size = new System.Drawing.Size(185, 6);
   1.221 +      this.MenuItem1.Index = 4;
   1.222 +      this.MenuItem1.Text = "-";
   1.223        // 
   1.224 -      // columnsToolStripMenuItem
   1.225 +      // columnsMenuItem
   1.226        // 
   1.227 -      this.columnsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
   1.228 +      this.columnsMenuItem.Index = 5;
   1.229 +      this.columnsMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.230              this.valueMenuItem,
   1.231              this.minMenuItem,
   1.232              this.maxMenuItem});
   1.233 -      this.columnsToolStripMenuItem.Name = "columnsToolStripMenuItem";
   1.234 -      this.columnsToolStripMenuItem.Size = new System.Drawing.Size(188, 22);
   1.235 -      this.columnsToolStripMenuItem.Text = "Columns";
   1.236 +      this.columnsMenuItem.Text = "Columns";
   1.237        // 
   1.238        // valueMenuItem
   1.239        // 
   1.240 -      this.valueMenuItem.Checked = true;
   1.241 -      this.valueMenuItem.CheckOnClick = true;
   1.242 -      this.valueMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
   1.243 -      this.valueMenuItem.Name = "valueMenuItem";
   1.244 -      this.valueMenuItem.Size = new System.Drawing.Size(103, 22);
   1.245 +      this.valueMenuItem.Index = 0;
   1.246        this.valueMenuItem.Text = "Value";
   1.247 -      this.valueMenuItem.CheckedChanged += new System.EventHandler(this.valueMenuItem_CheckedChanged);
   1.248        // 
   1.249        // minMenuItem
   1.250        // 
   1.251 -      this.minMenuItem.Checked = true;
   1.252 -      this.minMenuItem.CheckOnClick = true;
   1.253 -      this.minMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
   1.254 -      this.minMenuItem.Name = "minMenuItem";
   1.255 -      this.minMenuItem.Size = new System.Drawing.Size(103, 22);
   1.256 +      this.minMenuItem.Index = 1;
   1.257        this.minMenuItem.Text = "Min";
   1.258 -      this.minMenuItem.CheckedChanged += new System.EventHandler(this.minMenuItem_CheckedChanged);
   1.259        // 
   1.260        // maxMenuItem
   1.261        // 
   1.262 -      this.maxMenuItem.Checked = true;
   1.263 -      this.maxMenuItem.CheckOnClick = true;
   1.264 -      this.maxMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
   1.265 -      this.maxMenuItem.Name = "maxMenuItem";
   1.266 -      this.maxMenuItem.Size = new System.Drawing.Size(103, 22);
   1.267 +      this.maxMenuItem.Index = 2;
   1.268        this.maxMenuItem.Text = "Max";
   1.269 -      this.maxMenuItem.CheckedChanged += new System.EventHandler(this.maxMenuItem_CheckedChanged);
   1.270        // 
   1.271 -      // optionsToolStripMenuItem
   1.272 +      // optionsMenuItem
   1.273        // 
   1.274 -      this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
   1.275 +      this.optionsMenuItem.Index = 2;
   1.276 +      this.optionsMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.277              this.startMinMenuItem,
   1.278              this.minTrayMenuItem,
   1.279              this.startupMenuItem,
   1.280              this.separatorMenuItem,
   1.281 -            this.temperatureUnitsToolStripMenuItem,
   1.282 -            this.toolStripMenuItem4,
   1.283 +            this.temperatureUnitsMenuItem,
   1.284 +            this.MenuItem4,
   1.285              this.hddMenuItem});
   1.286 -      this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
   1.287 -      this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
   1.288 -      this.optionsToolStripMenuItem.Text = "Options";
   1.289 +      this.optionsMenuItem.Text = "Options";
   1.290        // 
   1.291        // startMinMenuItem
   1.292        // 
   1.293 -      this.startMinMenuItem.CheckOnClick = true;
   1.294 -      this.startMinMenuItem.Name = "startMinMenuItem";
   1.295 -      this.startMinMenuItem.Size = new System.Drawing.Size(207, 22);
   1.296 +      this.startMinMenuItem.Index = 0;
   1.297        this.startMinMenuItem.Text = "Start Minimized";
   1.298        // 
   1.299        // minTrayMenuItem
   1.300        // 
   1.301 -      this.minTrayMenuItem.CheckOnClick = true;
   1.302 -      this.minTrayMenuItem.Name = "minTrayMenuItem";
   1.303 -      this.minTrayMenuItem.Size = new System.Drawing.Size(207, 22);
   1.304 +      this.minTrayMenuItem.Index = 1;
   1.305        this.minTrayMenuItem.Text = "Minimize To Tray";
   1.306 -      this.minTrayMenuItem.CheckedChanged += new System.EventHandler(this.minTrayMenuItem_CheckedChanged);
   1.307        // 
   1.308        // startupMenuItem
   1.309        // 
   1.310 -      this.startupMenuItem.CheckOnClick = true;
   1.311 -      this.startupMenuItem.Name = "startupMenuItem";
   1.312 -      this.startupMenuItem.Size = new System.Drawing.Size(207, 22);
   1.313 +      this.startupMenuItem.Index = 2;
   1.314        this.startupMenuItem.Text = "Run On Windows Startup";
   1.315 -      this.startupMenuItem.CheckedChanged += new System.EventHandler(this.runOnWindowsStartupToolStripMenuItem_CheckedChanged);
   1.316        // 
   1.317        // separatorMenuItem
   1.318        // 
   1.319 -      this.separatorMenuItem.Name = "separatorMenuItem";
   1.320 -      this.separatorMenuItem.Size = new System.Drawing.Size(204, 6);
   1.321 +      this.separatorMenuItem.Index = 3;
   1.322 +      this.separatorMenuItem.Text = "-";
   1.323        // 
   1.324 -      // temperatureUnitsToolStripMenuItem
   1.325 +      // temperatureUnitsMenuItem
   1.326        // 
   1.327 -      this.temperatureUnitsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
   1.328 -            this.celciusToolStripMenuItem,
   1.329 -            this.fahrenheitToolStripMenuItem});
   1.330 -      this.temperatureUnitsToolStripMenuItem.Name = "temperatureUnitsToolStripMenuItem";
   1.331 -      this.temperatureUnitsToolStripMenuItem.Size = new System.Drawing.Size(207, 22);
   1.332 -      this.temperatureUnitsToolStripMenuItem.Text = "Temperature Unit";
   1.333 +      this.temperatureUnitsMenuItem.Index = 4;
   1.334 +      this.temperatureUnitsMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.335 +            this.celciusMenuItem,
   1.336 +            this.fahrenheitMenuItem});
   1.337 +      this.temperatureUnitsMenuItem.Text = "Temperature Unit";
   1.338        // 
   1.339 -      // celciusToolStripMenuItem
   1.340 +      // celciusMenuItem
   1.341        // 
   1.342 -      this.celciusToolStripMenuItem.Name = "celciusToolStripMenuItem";
   1.343 -      this.celciusToolStripMenuItem.Size = new System.Drawing.Size(130, 22);
   1.344 -      this.celciusToolStripMenuItem.Text = "Celcius";
   1.345 -      this.celciusToolStripMenuItem.Click += new System.EventHandler(this.celciusToolStripMenuItem_Click);
   1.346 +      this.celciusMenuItem.Index = 0;
   1.347 +      this.celciusMenuItem.Text = "Celcius";
   1.348 +      this.celciusMenuItem.Click += new System.EventHandler(this.celciusMenuItem_Click);
   1.349        // 
   1.350 -      // fahrenheitToolStripMenuItem
   1.351 +      // fahrenheitMenuItem
   1.352        // 
   1.353 -      this.fahrenheitToolStripMenuItem.Name = "fahrenheitToolStripMenuItem";
   1.354 -      this.fahrenheitToolStripMenuItem.Size = new System.Drawing.Size(130, 22);
   1.355 -      this.fahrenheitToolStripMenuItem.Text = "Fahrenheit";
   1.356 -      this.fahrenheitToolStripMenuItem.Click += new System.EventHandler(this.fahrenheitToolStripMenuItem_Click);
   1.357 +      this.fahrenheitMenuItem.Index = 1;
   1.358 +      this.fahrenheitMenuItem.Text = "Fahrenheit";
   1.359 +      this.fahrenheitMenuItem.Click += new System.EventHandler(this.fahrenheitMenuItem_Click);
   1.360        // 
   1.361 -      // toolStripMenuItem4
   1.362 +      // MenuItem4
   1.363        // 
   1.364 -      this.toolStripMenuItem4.Name = "toolStripMenuItem4";
   1.365 -      this.toolStripMenuItem4.Size = new System.Drawing.Size(204, 6);
   1.366 +      this.MenuItem4.Index = 5;
   1.367 +      this.MenuItem4.Text = "-";
   1.368        // 
   1.369        // hddMenuItem
   1.370        // 
   1.371 -      this.hddMenuItem.CheckOnClick = true;
   1.372 -      this.hddMenuItem.Name = "hddMenuItem";
   1.373 -      this.hddMenuItem.Size = new System.Drawing.Size(207, 22);
   1.374 +      this.hddMenuItem.Index = 6;
   1.375        this.hddMenuItem.Text = "Read HDD sensors";
   1.376 -      this.hddMenuItem.CheckedChanged += new System.EventHandler(this.hddsensorsToolStripMenuItem_CheckedChanged);
   1.377        // 
   1.378 -      // helpToolStripMenuItem
   1.379 +      // helpMenuItem
   1.380        // 
   1.381 -      this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
   1.382 -            this.aboutToolStripMenuItem});
   1.383 -      this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
   1.384 -      this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
   1.385 -      this.helpToolStripMenuItem.Text = "Help";
   1.386 +      this.helpMenuItem.Index = 3;
   1.387 +      this.helpMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
   1.388 +            this.aboutMenuItem});
   1.389 +      this.helpMenuItem.Text = "Help";
   1.390        // 
   1.391 -      // aboutToolStripMenuItem
   1.392 +      // aboutMenuItem
   1.393        // 
   1.394 -      this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
   1.395 -      this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
   1.396 -      this.aboutToolStripMenuItem.Text = "About";
   1.397 -      this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
   1.398 +      this.aboutMenuItem.Index = 0;
   1.399 +      this.aboutMenuItem.Text = "About";
   1.400 +      this.aboutMenuItem.Click += new System.EventHandler(this.aboutMenuItem_Click);
   1.401        // 
   1.402        // splitContainer
   1.403        // 
   1.404 -      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
   1.405 -      this.splitContainer.Location = new System.Drawing.Point(0, 24);
   1.406 +      this.splitContainer.Location = new System.Drawing.Point(12, 12);
   1.407        this.splitContainer.Name = "splitContainer";
   1.408        this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
   1.409        // 
   1.410 @@ -448,7 +406,7 @@
   1.411        // 
   1.412        this.splitContainer.Panel2.Controls.Add(this.plotPanel);
   1.413        this.splitContainer.Panel2.Cursor = System.Windows.Forms.Cursors.Default;
   1.414 -      this.splitContainer.Size = new System.Drawing.Size(410, 662);
   1.415 +      this.splitContainer.Size = new System.Drawing.Size(386, 662);
   1.416        this.splitContainer.SplitterDistance = 488;
   1.417        this.splitContainer.SplitterWidth = 3;
   1.418        this.splitContainer.TabIndex = 3;
   1.419 @@ -459,14 +417,9 @@
   1.420        this.plotPanel.Dock = System.Windows.Forms.DockStyle.Fill;
   1.421        this.plotPanel.Location = new System.Drawing.Point(0, 0);
   1.422        this.plotPanel.Name = "plotPanel";
   1.423 -      this.plotPanel.Size = new System.Drawing.Size(410, 171);
   1.424 +      this.plotPanel.Size = new System.Drawing.Size(386, 171);
   1.425        this.plotPanel.TabIndex = 0;
   1.426        // 
   1.427 -      // sensorContextMenuStrip
   1.428 -      // 
   1.429 -      this.sensorContextMenuStrip.Name = "sensorContextMenuStrip";
   1.430 -      this.sensorContextMenuStrip.Size = new System.Drawing.Size(61, 4);
   1.431 -      // 
   1.432        // saveFileDialog
   1.433        // 
   1.434        this.saveFileDialog.DefaultExt = "txt";
   1.435 @@ -480,47 +433,31 @@
   1.436        this.timer.Interval = 1000;
   1.437        this.timer.Tick += new System.EventHandler(this.timer_Tick);
   1.438        // 
   1.439 -      // toolStripMenuItem3
   1.440 -      // 
   1.441 -      this.toolStripMenuItem3.Name = "toolStripMenuItem3";
   1.442 -      this.toolStripMenuItem3.Size = new System.Drawing.Size(185, 6);
   1.443 -      // 
   1.444 -      // resetMinMaxMenuItem
   1.445 -      // 
   1.446 -      this.resetMinMaxMenuItem.Name = "resetMinMaxMenuItem";
   1.447 -      this.resetMinMaxMenuItem.Size = new System.Drawing.Size(188, 22);
   1.448 -      this.resetMinMaxMenuItem.Text = "Reset Min/Max";
   1.449 -      this.resetMinMaxMenuItem.Click += new System.EventHandler(this.resetMinMaxMenuItem_Click);
   1.450 -      // 
   1.451        // MainForm
   1.452        // 
   1.453 +      this.Menu = this.mainMenu;
   1.454        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
   1.455        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
   1.456        this.ClientSize = new System.Drawing.Size(410, 686);
   1.457        this.Controls.Add(this.splitContainer);
   1.458 -      this.Controls.Add(this.menuStrip);
   1.459 -      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
   1.460 -      this.MainMenuStrip = this.menuStrip;
   1.461 +      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));      
   1.462        this.Name = "MainForm";
   1.463        this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
   1.464        this.Text = "Open Hardware Monitor";
   1.465        this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
   1.466 -      this.menuStrip.ResumeLayout(false);
   1.467 -      this.menuStrip.PerformLayout();
   1.468        this.splitContainer.Panel1.ResumeLayout(false);
   1.469        this.splitContainer.Panel2.ResumeLayout(false);
   1.470        this.splitContainer.ResumeLayout(false);
   1.471        this.ResumeLayout(false);
   1.472 -      this.PerformLayout();
   1.473  
   1.474      }
   1.475  
   1.476      #endregion
   1.477  
   1.478      private Aga.Controls.Tree.TreeViewAdv treeView;
   1.479 -    private System.Windows.Forms.MenuStrip menuStrip;
   1.480 -    private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
   1.481 -    private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
   1.482 +    private System.Windows.Forms.MainMenu mainMenu;
   1.483 +    private System.Windows.Forms.MenuItem fileMenuItem;
   1.484 +    private System.Windows.Forms.MenuItem exitMenuItem;
   1.485      private Aga.Controls.Tree.TreeColumn sensor;
   1.486      private Aga.Controls.Tree.TreeColumn value;
   1.487      private Aga.Controls.Tree.TreeColumn min;
   1.488 @@ -532,35 +469,35 @@
   1.489      private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxMax;
   1.490      private System.Windows.Forms.SplitContainer splitContainer;
   1.491      private PlotPanel plotPanel;
   1.492 -    private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
   1.493 -    private System.Windows.Forms.ToolStripMenuItem plotMenuItem;
   1.494 +    private System.Windows.Forms.MenuItem viewMenuItem;
   1.495 +    private System.Windows.Forms.MenuItem plotMenuItem;
   1.496      private Aga.Controls.Tree.NodeControls.NodeCheckBox nodeCheckBox;
   1.497 -    private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
   1.498 -    private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
   1.499 -    private System.Windows.Forms.ToolStripMenuItem saveReportToolStripMenuItem;
   1.500 -    private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
   1.501 -    private System.Windows.Forms.ToolStripMenuItem hddMenuItem;
   1.502 -    private System.Windows.Forms.ToolStripMenuItem minTrayMenuItem;
   1.503 -    private System.Windows.Forms.ToolStripSeparator separatorMenuItem;
   1.504 -    private System.Windows.Forms.ContextMenuStrip sensorContextMenuStrip;
   1.505 -    private System.Windows.Forms.ToolStripMenuItem startMinMenuItem;
   1.506 -    private System.Windows.Forms.ToolStripMenuItem startupMenuItem;
   1.507 +    private System.Windows.Forms.MenuItem helpMenuItem;
   1.508 +    private System.Windows.Forms.MenuItem aboutMenuItem;
   1.509 +    private System.Windows.Forms.MenuItem saveReportMenuItem;
   1.510 +    private System.Windows.Forms.MenuItem optionsMenuItem;
   1.511 +    private System.Windows.Forms.MenuItem hddMenuItem;
   1.512 +    private System.Windows.Forms.MenuItem minTrayMenuItem;
   1.513 +    private System.Windows.Forms.MenuItem separatorMenuItem;
   1.514 +    private System.Windows.Forms.ContextMenu sensorContextMenu;
   1.515 +    private System.Windows.Forms.MenuItem startMinMenuItem;
   1.516 +    private System.Windows.Forms.MenuItem startupMenuItem;
   1.517      private System.Windows.Forms.SaveFileDialog saveFileDialog;
   1.518      private System.Windows.Forms.Timer timer;
   1.519 -    private System.Windows.Forms.ToolStripMenuItem hiddenMenuItem;
   1.520 -    private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
   1.521 -    private System.Windows.Forms.ToolStripMenuItem columnsToolStripMenuItem;
   1.522 -    private System.Windows.Forms.ToolStripMenuItem valueMenuItem;
   1.523 -    private System.Windows.Forms.ToolStripMenuItem minMenuItem;
   1.524 -    private System.Windows.Forms.ToolStripMenuItem maxMenuItem;
   1.525 -    private System.Windows.Forms.ToolStripMenuItem temperatureUnitsToolStripMenuItem;
   1.526 -    private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
   1.527 -    private System.Windows.Forms.ToolStripMenuItem celciusToolStripMenuItem;
   1.528 -    private System.Windows.Forms.ToolStripMenuItem fahrenheitToolStripMenuItem;
   1.529 -    private System.Windows.Forms.ToolStripMenuItem sumbitReportToolStripMenuItem;
   1.530 -    private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
   1.531 -    private System.Windows.Forms.ToolStripMenuItem resetMinMaxMenuItem;
   1.532 -    private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
   1.533 +    private System.Windows.Forms.MenuItem hiddenMenuItem;
   1.534 +    private System.Windows.Forms.MenuItem MenuItem1;
   1.535 +    private System.Windows.Forms.MenuItem columnsMenuItem;
   1.536 +    private System.Windows.Forms.MenuItem valueMenuItem;
   1.537 +    private System.Windows.Forms.MenuItem minMenuItem;
   1.538 +    private System.Windows.Forms.MenuItem maxMenuItem;
   1.539 +    private System.Windows.Forms.MenuItem temperatureUnitsMenuItem;
   1.540 +    private System.Windows.Forms.MenuItem MenuItem4;
   1.541 +    private System.Windows.Forms.MenuItem celciusMenuItem;
   1.542 +    private System.Windows.Forms.MenuItem fahrenheitMenuItem;
   1.543 +    private System.Windows.Forms.MenuItem sumbitReportMenuItem;
   1.544 +    private System.Windows.Forms.MenuItem MenuItem2;
   1.545 +    private System.Windows.Forms.MenuItem resetMinMaxMenuItem;
   1.546 +    private System.Windows.Forms.MenuItem MenuItem3;
   1.547    }
   1.548  }
   1.549  
     2.1 --- a/GUI/MainForm.cs	Sat Jul 17 13:25:42 2010 +0000
     2.2 +++ b/GUI/MainForm.cs	Sun Jul 18 12:38:01 2010 +0000
     2.3 @@ -61,8 +61,22 @@
     2.4      private StartupManager startupManager = new StartupManager();
     2.5      private UpdateVisitor updateVisitor = new UpdateVisitor();
     2.6  
     2.7 +    private UserOption showHiddenSensors;
     2.8 +    private UserOption showPlot;
     2.9 +    private UserOption showValue;
    2.10 +    private UserOption showMin;
    2.11 +    private UserOption showMax;
    2.12 +    private UserOption startMinimized;
    2.13 +    private UserOption minimizeToTray;
    2.14 +    private UserOption autoStart;
    2.15 +    private UserOption readHddSensors;
    2.16 +
    2.17      public MainForm() {      
    2.18        InitializeComponent();
    2.19 +
    2.20 +      // set the DockStyle here, to avoid conflicts with the MainMenu
    2.21 +      this.splitContainer.Dock = DockStyle.Fill;
    2.22 +      
    2.23        this.Font = SystemFonts.MessageBoxFont;
    2.24        treeView.Font = SystemFonts.MessageBoxFont;
    2.25        plotPanel.Font = SystemFonts.MessageBoxFont;
    2.26 @@ -85,8 +99,9 @@
    2.27          StartPosition = FormStartPosition.CenterScreen;
    2.28        }
    2.29  
    2.30 -      Width = Utilities.Config.Get("mainForm.Width", Width);
    2.31 -      Height = Utilities.Config.Get("mainForm.Height", Height);
    2.32 +      ClientSize = new Size(
    2.33 +        Utilities.Config.Get("mainForm.Width", ClientSize.Width),
    2.34 +        Utilities.Config.Get("mainForm.Height", ClientSize.Height));
    2.35  
    2.36        foreach (TreeColumn column in treeView.Columns) 
    2.37          column.Width = Math.Max(20, Math.Min(400, 
    2.38 @@ -125,21 +140,53 @@
    2.39        plotColorPalette[11] = Color.Olive;
    2.40        plotColorPalette[12] = Color.Firebrick;
    2.41  
    2.42 -      hiddenMenuItem.Checked = Config.Get(hiddenMenuItem.Name, false);
    2.43 -      plotMenuItem.Checked = Config.Get(plotMenuItem.Name, false);
    2.44 +      showHiddenSensors = new UserOption("hiddenMenuItem", false, hiddenMenuItem);
    2.45 +      showHiddenSensors.Changed += delegate(object sender, EventArgs e) {
    2.46 +        treeModel.ForceVisible = showHiddenSensors.Value;
    2.47 +      };
    2.48  
    2.49 -      valueMenuItem.Checked = Config.Get(valueMenuItem.Name, true);
    2.50 -      minMenuItem.Checked = Config.Get(minMenuItem.Name, false);
    2.51 -      maxMenuItem.Checked = Config.Get(maxMenuItem.Name, true);
    2.52 +      showPlot = new UserOption("plotMenuItem", false, plotMenuItem);
    2.53 +      showPlot.Changed += delegate(object sender, EventArgs e) {
    2.54 +        splitContainer.Panel2Collapsed = !showPlot.Value;
    2.55 +        treeView.Invalidate();
    2.56 +      };
    2.57  
    2.58 -      startMinMenuItem.Checked = Config.Get(startMinMenuItem.Name, false); 
    2.59 -      minTrayMenuItem.Checked = Config.Get(minTrayMenuItem.Name, true);
    2.60 -      startupMenuItem.Checked = startupManager.Startup;
    2.61 -      hddMenuItem.Checked = Config.Get(hddMenuItem.Name, true);
    2.62 +      showValue = new UserOption("valueMenuItem", true, valueMenuItem);
    2.63 +      showValue.Changed += delegate(object sender, EventArgs e) {
    2.64 +        treeView.Columns[1].IsVisible = showValue.Value;
    2.65 +      };
    2.66  
    2.67 -      celciusToolStripMenuItem.Checked = 
    2.68 +      showMin = new UserOption("minMenuItem", false, minMenuItem);
    2.69 +      showMin.Changed += delegate(object sender, EventArgs e) {
    2.70 +        treeView.Columns[2].IsVisible = showMin.Value;
    2.71 +      };
    2.72 +
    2.73 +      showMax = new UserOption("maxMenuItem", true, maxMenuItem);
    2.74 +      showMax.Changed += delegate(object sender, EventArgs e) {
    2.75 +        treeView.Columns[3].IsVisible = showMax.Value;
    2.76 +      };
    2.77 +
    2.78 +      startMinimized = new UserOption("startMinMenuItem", false, startMinMenuItem);
    2.79 +
    2.80 +      minimizeToTray = new UserOption("minTrayMenuItem", true, minTrayMenuItem);
    2.81 +      minimizeToTray.Changed += delegate(object sender, EventArgs e) {
    2.82 +        systemTray.IsMainIconEnabled = minimizeToTray.Value;
    2.83 +      };
    2.84 +
    2.85 +      autoStart = new UserOption(null, startupManager.Startup, startupMenuItem);
    2.86 +      autoStart.Changed += delegate(object sender, EventArgs e) {
    2.87 +        startupManager.Startup = autoStart.Value; ;
    2.88 +      };
    2.89 +
    2.90 +      readHddSensors = new UserOption("hddMenuItem", true, hddMenuItem);
    2.91 +      readHddSensors.Changed += delegate(object sender, EventArgs e) {
    2.92 +        computer.HDDEnabled = readHddSensors.Value;
    2.93 +        UpdatePlotSelection(null, null);
    2.94 +      };
    2.95 +
    2.96 +      celciusMenuItem.Checked = 
    2.97          UnitManager.TemperatureUnit == TemperatureUnit.Celcius;
    2.98 -      fahrenheitToolStripMenuItem.Checked = !celciusToolStripMenuItem.Checked;
    2.99 +      fahrenheitMenuItem.Checked = !celciusMenuItem.Checked;
   2.100  
   2.101        startupMenuItem.Visible = startupManager.IsAvailable;
   2.102        
   2.103 @@ -250,22 +297,11 @@
   2.104      }
   2.105  
   2.106      private void SaveConfiguration() {
   2.107 -      Config.Set(hiddenMenuItem.Name, hiddenMenuItem.Checked);
   2.108 -      Config.Set(plotMenuItem.Name, plotMenuItem.Checked);
   2.109 -
   2.110 -      Config.Set(valueMenuItem.Name, valueMenuItem.Checked);
   2.111 -      Config.Set(minMenuItem.Name, minMenuItem.Checked);
   2.112 -      Config.Set(maxMenuItem.Name, maxMenuItem.Checked);
   2.113 -
   2.114 -      Config.Set(startMinMenuItem.Name, startMinMenuItem.Checked);
   2.115 -      Config.Set(minTrayMenuItem.Name, minTrayMenuItem.Checked);
   2.116 -      Config.Set(hddMenuItem.Name, hddMenuItem.Checked);
   2.117 -
   2.118        if (WindowState != FormWindowState.Minimized) {
   2.119          Config.Set("mainForm.Location.X", Location.X);
   2.120          Config.Set("mainForm.Location.Y", Location.Y);
   2.121 -        Config.Set("mainForm.Width", Width);
   2.122 -        Config.Set("mainForm.Height", Height);
   2.123 +        Config.Set("mainForm.Width", ClientSize.Width);
   2.124 +        Config.Set("mainForm.Height", ClientSize.Height);
   2.125        }
   2.126  
   2.127        foreach (TreeColumn column in treeView.Columns)
   2.128 @@ -276,6 +312,7 @@
   2.129      }
   2.130  
   2.131      private void MainForm_FormClosed(object sender, FormClosedEventArgs e) {
   2.132 +      Visible = false;
   2.133        SaveConfiguration();
   2.134  
   2.135        timer.Enabled = false;
   2.136 @@ -283,17 +320,10 @@
   2.137        computer.Close();
   2.138      }
   2.139  
   2.140 -    private void aboutToolStripMenuItem_Click(object sender, EventArgs e) {
   2.141 +    private void aboutMenuItem_Click(object sender, EventArgs e) {
   2.142        new AboutBox().ShowDialog();
   2.143      }
   2.144  
   2.145 -    private void plotToolStripMenuItem_CheckedChanged(object sender, 
   2.146 -      EventArgs e) 
   2.147 -    {
   2.148 -      splitContainer.Panel2Collapsed = !plotMenuItem.Checked;
   2.149 -      treeView.Invalidate();
   2.150 -    }
   2.151 -
   2.152      private void treeView_Click(object sender, EventArgs e) {
   2.153        
   2.154        MouseEventArgs m = e as MouseEventArgs;
   2.155 @@ -301,58 +331,57 @@
   2.156          return;
   2.157  
   2.158        NodeControlInfo info = treeView.GetNodeControlInfoAt(new Point(m.X, m.Y));
   2.159 -      if (info.Control != null) {
   2.160 +      treeView.SelectedNode = info.Node;
   2.161 +      if (info.Node != null) {
   2.162          SensorNode node = info.Node.Tag as SensorNode;
   2.163          if (node != null && node.Sensor != null) {
   2.164 -
   2.165 -          sensorContextMenuStrip.Items.Clear();
   2.166 +          sensorContextMenu.MenuItems.Clear();
   2.167            if (node.Sensor.Parameters.Length > 0) {
   2.168 -            ToolStripMenuItem item = new ToolStripMenuItem("Parameters...");
   2.169 +            MenuItem item = new MenuItem("Parameters...");
   2.170              item.Click += delegate(object obj, EventArgs args) {
   2.171                ShowParameterForm(node.Sensor);
   2.172              };
   2.173 -            sensorContextMenuStrip.Items.Add(item);
   2.174 +            sensorContextMenu.MenuItems.Add(item);
   2.175            }
   2.176 -          EditableControl control = info.Control as EditableControl;
   2.177 -          if (control != null) {
   2.178 -            ToolStripMenuItem item = new ToolStripMenuItem("Rename");
   2.179 +          if (nodeTextBoxText.EditEnabled) {
   2.180 +            MenuItem item = new MenuItem("Rename");
   2.181              item.Click += delegate(object obj, EventArgs args) {
   2.182 -              control.BeginEdit();
   2.183 +              nodeTextBoxText.BeginEdit();
   2.184              };
   2.185 -            sensorContextMenuStrip.Items.Add(item);
   2.186 +            sensorContextMenu.MenuItems.Add(item);
   2.187            }          
   2.188            if (node.IsVisible) {
   2.189 -            ToolStripMenuItem item = new ToolStripMenuItem("Hide");
   2.190 +            MenuItem item = new MenuItem("Hide");
   2.191              item.Click += delegate(object obj, EventArgs args) {
   2.192                node.IsVisible = false;
   2.193              };
   2.194 -            sensorContextMenuStrip.Items.Add(item);
   2.195 +            sensorContextMenu.MenuItems.Add(item);
   2.196            } else {
   2.197 -            ToolStripMenuItem item = new ToolStripMenuItem("Unhide");
   2.198 +            MenuItem item = new MenuItem("Unhide");
   2.199              item.Click += delegate(object obj, EventArgs args) {
   2.200                node.IsVisible = true;
   2.201              };
   2.202 -            sensorContextMenuStrip.Items.Add(item);
   2.203 +            sensorContextMenu.MenuItems.Add(item);
   2.204            }         
   2.205            if (systemTray.Contains(node.Sensor)) {
   2.206 -            ToolStripMenuItem item = new ToolStripMenuItem("Remove From Tray");
   2.207 +            MenuItem item = new MenuItem("Remove From Tray");
   2.208              item.Click += delegate(object obj, EventArgs args) {
   2.209                systemTray.Remove(node.Sensor);
   2.210              };
   2.211 -            sensorContextMenuStrip.Items.Add(item);
   2.212 +            sensorContextMenu.MenuItems.Add(item);
   2.213            } else {
   2.214 -            ToolStripMenuItem item = new ToolStripMenuItem("Add To Tray");
   2.215 +            MenuItem item = new MenuItem("Add To Tray");
   2.216              item.Click += delegate(object obj, EventArgs args) {
   2.217                systemTray.Add(node.Sensor, true);
   2.218              };
   2.219 -            sensorContextMenuStrip.Items.Add(item);
   2.220 +            sensorContextMenu.MenuItems.Add(item);
   2.221            }
   2.222 -          sensorContextMenuStrip.Show(treeView, m.X, m.Y);
   2.223 +          sensorContextMenu.Show(treeView, new Point(m.X, m.Y));
   2.224          }
   2.225        }
   2.226      }
   2.227  
   2.228 -    private void saveReportToolStripMenuItem_Click(object sender, EventArgs e) {
   2.229 +    private void saveReportMenuItem_Click(object sender, EventArgs e) {
   2.230        string report = computer.GetReport();
   2.231        if (saveFileDialog.ShowDialog() == DialogResult.OK) {
   2.232          using (TextWriter w = new StreamWriter(saveFileDialog.FileName)) {
   2.233 @@ -361,13 +390,6 @@
   2.234        }
   2.235      }
   2.236  
   2.237 -    private void hddsensorsToolStripMenuItem_CheckedChanged(object sender, 
   2.238 -      EventArgs e) 
   2.239 -    {
   2.240 -      computer.HDDEnabled = hddMenuItem.Checked;
   2.241 -      UpdatePlotSelection(null, null);      
   2.242 -    }
   2.243 -
   2.244      private void SysTrayHideShow() {
   2.245        Visible = !Visible;
   2.246        if (Visible)
   2.247 @@ -377,7 +399,7 @@
   2.248      protected override void WndProc(ref Message m) {
   2.249        const int WM_SYSCOMMAND = 0x112;
   2.250        const int SC_MINIMIZE = 0xF020;
   2.251 -      if (minTrayMenuItem.Checked && 
   2.252 +      if (minimizeToTray.Value && 
   2.253          m.Msg == WM_SYSCOMMAND && m.WParam.ToInt32() == SC_MINIMIZE) {
   2.254          SysTrayHideShow();
   2.255        } else {      
   2.256 @@ -389,12 +411,12 @@
   2.257        SysTrayHideShow();
   2.258      }
   2.259  
   2.260 -    private void removeToolStripMenuItem_Click(object sender, EventArgs e) {
   2.261 -      ToolStripMenuItem item = sender as ToolStripMenuItem;
   2.262 +    private void removeMenuItem_Click(object sender, EventArgs e) {
   2.263 +      MenuItem item = sender as MenuItem;
   2.264        if (item == null)
   2.265          return;
   2.266  
   2.267 -      ISensor sensor = item.Owner.Tag as ISensor;
   2.268 +      ISensor sensor = item.Parent.Tag as ISensor;
   2.269        if (sensor == null)
   2.270          return;
   2.271  
   2.272 @@ -417,46 +439,19 @@
   2.273        }
   2.274      }
   2.275  
   2.276 -    private void runOnWindowsStartupToolStripMenuItem_CheckedChanged(
   2.277 -      object sender, EventArgs e) 
   2.278 -    {
   2.279 -      startupManager.Startup = startupMenuItem.Checked;
   2.280 -    }
   2.281 -
   2.282 -    private void minTrayMenuItem_CheckedChanged(object sender, EventArgs e) {
   2.283 -      systemTray.IsMainIconEnabled = minTrayMenuItem.Checked;
   2.284 -    }
   2.285 -
   2.286 -    private void hiddenSensorsMenuItem_CheckedChanged(object sender, 
   2.287 -      EventArgs e) {
   2.288 -      treeModel.ForceVisible = hiddenMenuItem.Checked;
   2.289 -    }
   2.290 -
   2.291 -    private void valueMenuItem_CheckedChanged(object sender, EventArgs e) {
   2.292 -      treeView.Columns[1].IsVisible = valueMenuItem.Checked;
   2.293 -    }
   2.294 -
   2.295 -    private void minMenuItem_CheckedChanged(object sender, EventArgs e) {
   2.296 -      treeView.Columns[2].IsVisible = minMenuItem.Checked;
   2.297 -    }
   2.298 -
   2.299 -    private void maxMenuItem_CheckedChanged(object sender, EventArgs e) {
   2.300 -      treeView.Columns[3].IsVisible = maxMenuItem.Checked;
   2.301 -    }
   2.302 -
   2.303 -    private void celciusToolStripMenuItem_Click(object sender, EventArgs e) {
   2.304 -      celciusToolStripMenuItem.Checked = true;
   2.305 -      fahrenheitToolStripMenuItem.Checked = false;
   2.306 +    private void celciusMenuItem_Click(object sender, EventArgs e) {
   2.307 +      celciusMenuItem.Checked = true;
   2.308 +      fahrenheitMenuItem.Checked = false;
   2.309        UnitManager.TemperatureUnit = TemperatureUnit.Celcius;
   2.310      }
   2.311  
   2.312 -    private void fahrenheitToolStripMenuItem_Click(object sender, EventArgs e) {
   2.313 -      celciusToolStripMenuItem.Checked = false;
   2.314 -      fahrenheitToolStripMenuItem.Checked = true;
   2.315 +    private void fahrenheitMenuItem_Click(object sender, EventArgs e) {
   2.316 +      celciusMenuItem.Checked = false;
   2.317 +      fahrenheitMenuItem.Checked = true;
   2.318        UnitManager.TemperatureUnit = TemperatureUnit.Fahrenheit;
   2.319      }
   2.320  
   2.321 -    private void sumbitReportToolStripMenuItem_Click(object sender, EventArgs e) 
   2.322 +    private void sumbitReportMenuItem_Click(object sender, EventArgs e) 
   2.323      {
   2.324        ReportForm form = new ReportForm();
   2.325        form.Report = computer.GetReport();
     3.1 --- a/GUI/MainForm.resx	Sat Jul 17 13:25:42 2010 +0000
     3.2 +++ b/GUI/MainForm.resx	Sun Jul 18 12:38:01 2010 +0000
     3.3 @@ -117,20 +117,17 @@
     3.4    <resheader name="writer">
     3.5      <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     3.6    </resheader>
     3.7 -  <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     3.8 +  <metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     3.9 +    <value>226, 17</value>
    3.10 +  </metadata>
    3.11 +  <metadata name="sensorContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.12 +    <value>334, 17</value>
    3.13 +  </metadata>
    3.14 +  <metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.15      <value>17, 17</value>
    3.16    </metadata>
    3.17 -  <metadata name="sensorContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.18 -    <value>125, 17</value>
    3.19 -  </metadata>
    3.20 -  <metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.21 -    <value>311, 17</value>
    3.22 -  </metadata>
    3.23    <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.24 -    <value>440, 17</value>
    3.25 -  </metadata>
    3.26 -  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    3.27 -    <value>55</value>
    3.28 +    <value>146, 17</value>
    3.29    </metadata>
    3.30    <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    3.31    <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     4.1 --- a/GUI/SensorNotifyIcon.cs	Sat Jul 17 13:25:42 2010 +0000
     4.2 +++ b/GUI/SensorNotifyIcon.cs	Sun Jul 18 12:38:01 2010 +0000
     4.3 @@ -77,19 +77,19 @@
     4.4        this.pen = new Pen(Color.FromArgb(96, Color.Black));
     4.5        this.font = SystemFonts.MessageBoxFont;
     4.6  
     4.7 -      ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
     4.8 -      ToolStripMenuItem hideShowItem = new ToolStripMenuItem("Hide/Show");
     4.9 +      ContextMenu contextMenu = new ContextMenu();
    4.10 +      MenuItem hideShowItem = new MenuItem("Hide/Show");
    4.11        hideShowItem.Click += delegate(object obj, EventArgs args) {
    4.12          sensorSystemTray.SendHideShowCommand();
    4.13        };
    4.14 -      contextMenuStrip.Items.Add(hideShowItem);
    4.15 -      contextMenuStrip.Items.Add(new ToolStripSeparator());
    4.16 -      ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove Sensor");
    4.17 +      contextMenu.MenuItems.Add(hideShowItem);
    4.18 +      contextMenu.MenuItems.Add(new MenuItem("-"));
    4.19 +      MenuItem removeItem = new MenuItem("Remove Sensor");
    4.20        removeItem.Click += delegate(object obj, EventArgs args) {
    4.21          sensorSystemTray.Remove(this.sensor);
    4.22        };
    4.23 -      contextMenuStrip.Items.Add(removeItem);
    4.24 -      ToolStripMenuItem colorItem = new ToolStripMenuItem("Change Color...");
    4.25 +      contextMenu.MenuItems.Add(removeItem);
    4.26 +      MenuItem colorItem = new MenuItem("Change Color...");
    4.27        colorItem.Click += delegate(object obj, EventArgs args) {
    4.28          ColorDialog dialog = new ColorDialog();
    4.29          dialog.Color = Color;
    4.30 @@ -99,14 +99,14 @@
    4.31              "traycolor").ToString(), Color);
    4.32          }
    4.33        };
    4.34 -      contextMenuStrip.Items.Add(colorItem);
    4.35 -      contextMenuStrip.Items.Add(new ToolStripSeparator());
    4.36 -      ToolStripMenuItem exitItem = new ToolStripMenuItem("Exit");
    4.37 +      contextMenu.MenuItems.Add(colorItem);
    4.38 +      contextMenu.MenuItems.Add(new MenuItem("-"));
    4.39 +      MenuItem exitItem = new MenuItem("Exit");
    4.40        exitItem.Click += delegate(object obj, EventArgs args) {
    4.41          sensorSystemTray.SendExitCommand();
    4.42        };
    4.43 -      contextMenuStrip.Items.Add(exitItem);
    4.44 -      this.notifyIcon.ContextMenuStrip = contextMenuStrip;
    4.45 +      contextMenu.MenuItems.Add(exitItem);
    4.46 +      this.notifyIcon.ContextMenu = contextMenu;
    4.47        this.notifyIcon.DoubleClick += delegate(object obj, EventArgs args) {
    4.48          sensorSystemTray.SendHideShowCommand();
    4.49        };
     5.1 --- a/GUI/SystemTray.cs	Sat Jul 17 13:25:42 2010 +0000
     5.2 +++ b/GUI/SystemTray.cs	Sun Jul 18 12:38:01 2010 +0000
     5.3 @@ -57,19 +57,19 @@
     5.4  
     5.5        this.mainIcon = new NotifyIcon();
     5.6  
     5.7 -      ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
     5.8 -      ToolStripMenuItem hideShowItem = new ToolStripMenuItem("Hide/Show");
     5.9 +      ContextMenu contextMenu = new ContextMenu();
    5.10 +      MenuItem hideShowItem = new MenuItem("Hide/Show");
    5.11        hideShowItem.Click += delegate(object obj, EventArgs args) {
    5.12          SendHideShowCommand();
    5.13        };
    5.14 -      contextMenuStrip.Items.Add(hideShowItem);
    5.15 -      contextMenuStrip.Items.Add(new ToolStripSeparator());      
    5.16 -      ToolStripMenuItem exitItem = new ToolStripMenuItem("Exit");
    5.17 +      contextMenu.MenuItems.Add(hideShowItem);
    5.18 +      contextMenu.MenuItems.Add(new MenuItem("-"));      
    5.19 +      MenuItem exitItem = new MenuItem("Exit");
    5.20        exitItem.Click += delegate(object obj, EventArgs args) {
    5.21          SendExitCommand();
    5.22        };
    5.23 -      contextMenuStrip.Items.Add(exitItem);
    5.24 -      this.mainIcon.ContextMenuStrip = contextMenuStrip;
    5.25 +      contextMenu.MenuItems.Add(exitItem);
    5.26 +      this.mainIcon.ContextMenu = contextMenu;
    5.27        this.mainIcon.DoubleClick += delegate(object obj, EventArgs args) {
    5.28          SendHideShowCommand();
    5.29        };
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/GUI/UserOption.cs	Sun Jul 18 12:38:01 2010 +0000
     6.3 @@ -0,0 +1,92 @@
     6.4 +/*
     6.5 +  
     6.6 +  Version: MPL 1.1/GPL 2.0/LGPL 2.1
     6.7 +
     6.8 +  The contents of this file are subject to the Mozilla Public License Version
     6.9 +  1.1 (the "License"); you may not use this file except in compliance with
    6.10 +  the License. You may obtain a copy of the License at
    6.11 + 
    6.12 +  http://www.mozilla.org/MPL/
    6.13 +
    6.14 +  Software distributed under the License is distributed on an "AS IS" basis,
    6.15 +  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    6.16 +  for the specific language governing rights and limitations under the License.
    6.17 +
    6.18 +  The Original Code is the Open Hardware Monitor code.
    6.19 +
    6.20 +  The Initial Developer of the Original Code is 
    6.21 +  Michael Möller <m.moeller@gmx.ch>.
    6.22 +  Portions created by the Initial Developer are Copyright (C) 2009-2010
    6.23 +  the Initial Developer. All Rights Reserved.
    6.24 +
    6.25 +  Contributor(s):
    6.26 +
    6.27 +  Alternatively, the contents of this file may be used under the terms of
    6.28 +  either the GNU General Public License Version 2 or later (the "GPL"), or
    6.29 +  the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    6.30 +  in which case the provisions of the GPL or the LGPL are applicable instead
    6.31 +  of those above. If you wish to allow use of your version of this file only
    6.32 +  under the terms of either the GPL or the LGPL, and not to allow others to
    6.33 +  use your version of this file under the terms of the MPL, indicate your
    6.34 +  decision by deleting the provisions above and replace them with the notice
    6.35 +  and other provisions required by the GPL or the LGPL. If you do not delete
    6.36 +  the provisions above, a recipient may use your version of this file under
    6.37 +  the terms of any one of the MPL, the GPL or the LGPL.
    6.38 + 
    6.39 +*/
    6.40 +
    6.41 +using System;
    6.42 +using System.Collections.Generic;
    6.43 +using System.Windows.Forms;
    6.44 +using OpenHardwareMonitor.Utilities;
    6.45 +
    6.46 +namespace OpenHardwareMonitor.GUI {
    6.47 +  public class UserOption {
    6.48 +    private string name;
    6.49 +    private bool value;
    6.50 +    private MenuItem menuItem;
    6.51 +    private event EventHandler changed;
    6.52 +
    6.53 +    public UserOption(string name, bool value,
    6.54 +      MenuItem menuItem) {
    6.55 +
    6.56 +      this.name = name;
    6.57 +      if (name != null)
    6.58 +        this.value = Config.Get(name, value);
    6.59 +      else
    6.60 +        this.value = value;
    6.61 +      this.menuItem = menuItem;
    6.62 +      this.menuItem.Checked = this.value;
    6.63 +      this.menuItem.Click += new EventHandler(menuItem_Click);
    6.64 +    }
    6.65 +
    6.66 +    private void menuItem_Click(object sender, EventArgs e) {
    6.67 +      this.Value = !this.Value;
    6.68 +    }    
    6.69 +
    6.70 +    public bool Value {
    6.71 +      get { return value; }
    6.72 +      set {
    6.73 +        if (this.value != value) {
    6.74 +          this.value = value;
    6.75 +          if (this.name != null)
    6.76 +            Config.Set(name, value);
    6.77 +          this.menuItem.Checked = value;
    6.78 +          if (changed != null)
    6.79 +            changed(this, null);
    6.80 +        }
    6.81 +      }
    6.82 +    }
    6.83 +
    6.84 +    public event EventHandler Changed {
    6.85 +      add {
    6.86 +        changed += value;
    6.87 +        if (changed != null)
    6.88 +          changed(this, null);
    6.89 +      }
    6.90 +      remove {
    6.91 +        changed -= value;
    6.92 +      }
    6.93 +    }
    6.94 +  }
    6.95 +}
     7.1 --- a/OpenHardwareMonitor.csproj	Sat Jul 17 13:25:42 2010 +0000
     7.2 +++ b/OpenHardwareMonitor.csproj	Sun Jul 18 12:38:01 2010 +0000
     7.3 @@ -89,6 +89,7 @@
     7.4      <Compile Include="GUI\TypeNode.cs" />
     7.5      <Compile Include="GUI\UnitManager.cs" />
     7.6      <Compile Include="GUI\UpdateVisitor.cs" />
     7.7 +    <Compile Include="GUI\UserOption.cs" />
     7.8      <Compile Include="Hardware\CPU\AMD10CPU.cs" />
     7.9      <Compile Include="Hardware\CPU\AMD0FCPU.cs" />
    7.10      <Compile Include="Hardware\CPU\CPUID.cs" />
    7.11 @@ -169,10 +170,6 @@
    7.12        <DependentUpon>AboutBox.cs</DependentUpon>
    7.13        <SubType>Designer</SubType>
    7.14      </EmbeddedResource>
    7.15 -    <EmbeddedResource Include="GUI\MainForm.resx">
    7.16 -      <DependentUpon>MainForm.cs</DependentUpon>
    7.17 -      <SubType>Designer</SubType>
    7.18 -    </EmbeddedResource>
    7.19      <EmbeddedResource Include="GUI\PlotPanel.resx">
    7.20        <DependentUpon>PlotPanel.cs</DependentUpon>
    7.21        <SubType>Designer</SubType>
    7.22 @@ -213,6 +210,9 @@
    7.23      <EmbeddedResource Include="Resources\mainboard.png" />
    7.24    </ItemGroup>
    7.25    <ItemGroup>
    7.26 +    <EmbeddedResource Include="GUI\MainForm.resx">
    7.27 +      <DependentUpon>MainForm.cs</DependentUpon>
    7.28 +    </EmbeddedResource>
    7.29      <EmbeddedResource Include="GUI\ReportForm.resx">
    7.30        <DependentUpon>ReportForm.cs</DependentUpon>
    7.31      </EmbeddedResource>
     8.1 --- a/Properties/AssemblyInfo.cs	Sat Jul 17 13:25:42 2010 +0000
     8.2 +++ b/Properties/AssemblyInfo.cs	Sun Jul 18 12:38:01 2010 +0000
     8.3 @@ -69,5 +69,5 @@
     8.4  // You can specify all the values or you can default the Build and Revision Numbers 
     8.5  // by using the '*' as shown below:
     8.6  // [assembly: AssemblyVersion("1.0.*")]
     8.7 -[assembly: AssemblyVersion("0.1.37.1")]
     8.8 -[assembly: AssemblyFileVersion("0.1.37.1")]
     8.9 +[assembly: AssemblyVersion("0.1.37.2")]
    8.10 +[assembly: AssemblyFileVersion("0.1.37.2")]