# HG changeset patch # User moel.mich # Date 1279456681 0 # Node ID 3e2ab626531ccea1b738c6aa3ab9ecc0339d9c75 # Parent 8ffea928daadccbd434e5590d541d822bafa5e0f Replaced all menus with the native implementations MainMenu and ContextMenu. Fixed a bug with the sensor renaming context menu. diff -r 8ffea928daad -r 3e2ab626531c GUI/MainForm.Designer.cs --- a/GUI/MainForm.Designer.cs Sat Jul 17 13:25:42 2010 +0000 +++ b/GUI/MainForm.Designer.cs Sun Jul 18 12:38:01 2010 +0000 @@ -73,40 +73,39 @@ this.nodeTextBoxValue = new Aga.Controls.Tree.NodeControls.NodeTextBox(); this.nodeTextBoxMin = new Aga.Controls.Tree.NodeControls.NodeTextBox(); this.nodeTextBoxMax = new Aga.Controls.Tree.NodeControls.NodeTextBox(); - this.menuStrip = new System.Windows.Forms.MenuStrip(); - this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.saveReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.sumbitReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.hiddenMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.plotMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); - this.columnsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.valueMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.minMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.maxMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.startMinMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.minTrayMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.startupMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.separatorMenuItem = new System.Windows.Forms.ToolStripSeparator(); - this.temperatureUnitsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.celciusToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.fahrenheitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); - this.hddMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mainMenu = new System.Windows.Forms.MainMenu(this.components); + this.fileMenuItem = new System.Windows.Forms.MenuItem(); + this.saveReportMenuItem = new System.Windows.Forms.MenuItem(); + this.sumbitReportMenuItem = new System.Windows.Forms.MenuItem(); + this.MenuItem2 = new System.Windows.Forms.MenuItem(); + this.exitMenuItem = new System.Windows.Forms.MenuItem(); + this.viewMenuItem = new System.Windows.Forms.MenuItem(); + this.resetMinMaxMenuItem = new System.Windows.Forms.MenuItem(); + this.MenuItem3 = new System.Windows.Forms.MenuItem(); + this.hiddenMenuItem = new System.Windows.Forms.MenuItem(); + this.plotMenuItem = new System.Windows.Forms.MenuItem(); + this.MenuItem1 = new System.Windows.Forms.MenuItem(); + this.columnsMenuItem = new System.Windows.Forms.MenuItem(); + this.valueMenuItem = new System.Windows.Forms.MenuItem(); + this.minMenuItem = new System.Windows.Forms.MenuItem(); + this.maxMenuItem = new System.Windows.Forms.MenuItem(); + this.optionsMenuItem = new System.Windows.Forms.MenuItem(); + this.startMinMenuItem = new System.Windows.Forms.MenuItem(); + this.minTrayMenuItem = new System.Windows.Forms.MenuItem(); + this.startupMenuItem = new System.Windows.Forms.MenuItem(); + this.separatorMenuItem = new System.Windows.Forms.MenuItem(); + this.temperatureUnitsMenuItem = new System.Windows.Forms.MenuItem(); + this.celciusMenuItem = new System.Windows.Forms.MenuItem(); + this.fahrenheitMenuItem = new System.Windows.Forms.MenuItem(); + this.MenuItem4 = new System.Windows.Forms.MenuItem(); + this.hddMenuItem = new System.Windows.Forms.MenuItem(); + this.helpMenuItem = new System.Windows.Forms.MenuItem(); + this.aboutMenuItem = new System.Windows.Forms.MenuItem(); this.splitContainer = new System.Windows.Forms.SplitContainer(); this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel(); - this.sensorContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + this.sensorContextMenu = new System.Windows.Forms.ContextMenu(); this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.timer = new System.Windows.Forms.Timer(this.components); - this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); - this.resetMinMaxMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.menuStrip.SuspendLayout(); this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.SuspendLayout(); @@ -136,7 +135,7 @@ this.treeView.NodeControls.Add(this.nodeTextBoxMax); this.treeView.RowHeight = 18; this.treeView.SelectedNode = null; - this.treeView.Size = new System.Drawing.Size(410, 488); + this.treeView.Size = new System.Drawing.Size(386, 488); this.treeView.TabIndex = 0; this.treeView.Text = "treeView"; this.treeView.UseColumns = true; @@ -214,229 +213,188 @@ this.nodeTextBoxMax.LeftMargin = 3; this.nodeTextBoxMax.ParentColumn = this.max; // - // menuStrip + // mainMenu // - this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.fileToolStripMenuItem, - this.viewToolStripMenuItem, - this.optionsToolStripMenuItem, - this.helpToolStripMenuItem}); - this.menuStrip.Location = new System.Drawing.Point(0, 0); - this.menuStrip.Name = "menuStrip"; - this.menuStrip.Size = new System.Drawing.Size(410, 24); - this.menuStrip.TabIndex = 1; - this.menuStrip.Text = "menuStrip1"; + this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.fileMenuItem, + this.viewMenuItem, + this.optionsMenuItem, + this.helpMenuItem}); // - // fileToolStripMenuItem + // fileMenuItem // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.saveReportToolStripMenuItem, - this.sumbitReportToolStripMenuItem, - this.toolStripMenuItem2, - this.exitToolStripMenuItem}); - this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; - this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); - this.fileToolStripMenuItem.Text = "File"; + this.fileMenuItem.Index = 0; + this.fileMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.saveReportMenuItem, + this.sumbitReportMenuItem, + this.MenuItem2, + this.exitMenuItem}); + this.fileMenuItem.Text = "File"; // - // saveReportToolStripMenuItem + // saveReportMenuItem // - this.saveReportToolStripMenuItem.Name = "saveReportToolStripMenuItem"; - this.saveReportToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.saveReportToolStripMenuItem.Text = "Save Report..."; - this.saveReportToolStripMenuItem.Click += new System.EventHandler(this.saveReportToolStripMenuItem_Click); + this.saveReportMenuItem.Index = 0; + this.saveReportMenuItem.Text = "Save Report..."; + this.saveReportMenuItem.Click += new System.EventHandler(this.saveReportMenuItem_Click); // - // sumbitReportToolStripMenuItem + // sumbitReportMenuItem // - this.sumbitReportToolStripMenuItem.Name = "sumbitReportToolStripMenuItem"; - this.sumbitReportToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.sumbitReportToolStripMenuItem.Text = "Submit Report..."; - this.sumbitReportToolStripMenuItem.Click += new System.EventHandler(this.sumbitReportToolStripMenuItem_Click); + this.sumbitReportMenuItem.Index = 1; + this.sumbitReportMenuItem.Text = "Submit Report..."; + this.sumbitReportMenuItem.Click += new System.EventHandler(this.sumbitReportMenuItem_Click); // - // toolStripMenuItem2 + // MenuItem2 // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(156, 6); + this.MenuItem2.Index = 2; + this.MenuItem2.Text = "-"; // - // exitToolStripMenuItem + // exitMenuItem // - this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; - this.exitToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.exitToolStripMenuItem.Text = "Exit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitClick); + this.exitMenuItem.Index = 3; + this.exitMenuItem.Text = "Exit"; + this.exitMenuItem.Click += new System.EventHandler(this.exitClick); // - // viewToolStripMenuItem + // viewMenuItem // - this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.viewMenuItem.Index = 1; + this.viewMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.resetMinMaxMenuItem, - this.toolStripMenuItem3, + this.MenuItem3, this.hiddenMenuItem, this.plotMenuItem, - this.toolStripMenuItem1, - this.columnsToolStripMenuItem}); - this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; - this.viewToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.viewToolStripMenuItem.Text = "View"; + this.MenuItem1, + this.columnsMenuItem}); + this.viewMenuItem.Text = "View"; + // + // resetMinMaxMenuItem + // + this.resetMinMaxMenuItem.Index = 0; + this.resetMinMaxMenuItem.Text = "Reset Min/Max"; + this.resetMinMaxMenuItem.Click += new System.EventHandler(this.resetMinMaxMenuItem_Click); + // + // MenuItem3 + // + this.MenuItem3.Index = 1; + this.MenuItem3.Text = "-"; // // hiddenMenuItem // - this.hiddenMenuItem.CheckOnClick = true; - this.hiddenMenuItem.Name = "hiddenMenuItem"; - this.hiddenMenuItem.Size = new System.Drawing.Size(188, 22); + this.hiddenMenuItem.Index = 2; this.hiddenMenuItem.Text = "Show Hidden Sensors"; - this.hiddenMenuItem.CheckedChanged += new System.EventHandler(this.hiddenSensorsMenuItem_CheckedChanged); // // plotMenuItem // - this.plotMenuItem.Checked = true; - this.plotMenuItem.CheckOnClick = true; - this.plotMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.plotMenuItem.Name = "plotMenuItem"; - this.plotMenuItem.Size = new System.Drawing.Size(188, 22); + this.plotMenuItem.Index = 3; this.plotMenuItem.Text = "Show Plot"; - this.plotMenuItem.CheckedChanged += new System.EventHandler(this.plotToolStripMenuItem_CheckedChanged); // - // toolStripMenuItem1 + // MenuItem1 // - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(185, 6); + this.MenuItem1.Index = 4; + this.MenuItem1.Text = "-"; // - // columnsToolStripMenuItem + // columnsMenuItem // - this.columnsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.columnsMenuItem.Index = 5; + this.columnsMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.valueMenuItem, this.minMenuItem, this.maxMenuItem}); - this.columnsToolStripMenuItem.Name = "columnsToolStripMenuItem"; - this.columnsToolStripMenuItem.Size = new System.Drawing.Size(188, 22); - this.columnsToolStripMenuItem.Text = "Columns"; + this.columnsMenuItem.Text = "Columns"; // // valueMenuItem // - this.valueMenuItem.Checked = true; - this.valueMenuItem.CheckOnClick = true; - this.valueMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.valueMenuItem.Name = "valueMenuItem"; - this.valueMenuItem.Size = new System.Drawing.Size(103, 22); + this.valueMenuItem.Index = 0; this.valueMenuItem.Text = "Value"; - this.valueMenuItem.CheckedChanged += new System.EventHandler(this.valueMenuItem_CheckedChanged); // // minMenuItem // - this.minMenuItem.Checked = true; - this.minMenuItem.CheckOnClick = true; - this.minMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.minMenuItem.Name = "minMenuItem"; - this.minMenuItem.Size = new System.Drawing.Size(103, 22); + this.minMenuItem.Index = 1; this.minMenuItem.Text = "Min"; - this.minMenuItem.CheckedChanged += new System.EventHandler(this.minMenuItem_CheckedChanged); // // maxMenuItem // - this.maxMenuItem.Checked = true; - this.maxMenuItem.CheckOnClick = true; - this.maxMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.maxMenuItem.Name = "maxMenuItem"; - this.maxMenuItem.Size = new System.Drawing.Size(103, 22); + this.maxMenuItem.Index = 2; this.maxMenuItem.Text = "Max"; - this.maxMenuItem.CheckedChanged += new System.EventHandler(this.maxMenuItem_CheckedChanged); // - // optionsToolStripMenuItem + // optionsMenuItem // - this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.optionsMenuItem.Index = 2; + this.optionsMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.startMinMenuItem, this.minTrayMenuItem, this.startupMenuItem, this.separatorMenuItem, - this.temperatureUnitsToolStripMenuItem, - this.toolStripMenuItem4, + this.temperatureUnitsMenuItem, + this.MenuItem4, this.hddMenuItem}); - this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; - this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); - this.optionsToolStripMenuItem.Text = "Options"; + this.optionsMenuItem.Text = "Options"; // // startMinMenuItem // - this.startMinMenuItem.CheckOnClick = true; - this.startMinMenuItem.Name = "startMinMenuItem"; - this.startMinMenuItem.Size = new System.Drawing.Size(207, 22); + this.startMinMenuItem.Index = 0; this.startMinMenuItem.Text = "Start Minimized"; // // minTrayMenuItem // - this.minTrayMenuItem.CheckOnClick = true; - this.minTrayMenuItem.Name = "minTrayMenuItem"; - this.minTrayMenuItem.Size = new System.Drawing.Size(207, 22); + this.minTrayMenuItem.Index = 1; this.minTrayMenuItem.Text = "Minimize To Tray"; - this.minTrayMenuItem.CheckedChanged += new System.EventHandler(this.minTrayMenuItem_CheckedChanged); // // startupMenuItem // - this.startupMenuItem.CheckOnClick = true; - this.startupMenuItem.Name = "startupMenuItem"; - this.startupMenuItem.Size = new System.Drawing.Size(207, 22); + this.startupMenuItem.Index = 2; this.startupMenuItem.Text = "Run On Windows Startup"; - this.startupMenuItem.CheckedChanged += new System.EventHandler(this.runOnWindowsStartupToolStripMenuItem_CheckedChanged); // // separatorMenuItem // - this.separatorMenuItem.Name = "separatorMenuItem"; - this.separatorMenuItem.Size = new System.Drawing.Size(204, 6); + this.separatorMenuItem.Index = 3; + this.separatorMenuItem.Text = "-"; // - // temperatureUnitsToolStripMenuItem + // temperatureUnitsMenuItem // - this.temperatureUnitsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.celciusToolStripMenuItem, - this.fahrenheitToolStripMenuItem}); - this.temperatureUnitsToolStripMenuItem.Name = "temperatureUnitsToolStripMenuItem"; - this.temperatureUnitsToolStripMenuItem.Size = new System.Drawing.Size(207, 22); - this.temperatureUnitsToolStripMenuItem.Text = "Temperature Unit"; + this.temperatureUnitsMenuItem.Index = 4; + this.temperatureUnitsMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.celciusMenuItem, + this.fahrenheitMenuItem}); + this.temperatureUnitsMenuItem.Text = "Temperature Unit"; // - // celciusToolStripMenuItem + // celciusMenuItem // - this.celciusToolStripMenuItem.Name = "celciusToolStripMenuItem"; - this.celciusToolStripMenuItem.Size = new System.Drawing.Size(130, 22); - this.celciusToolStripMenuItem.Text = "Celcius"; - this.celciusToolStripMenuItem.Click += new System.EventHandler(this.celciusToolStripMenuItem_Click); + this.celciusMenuItem.Index = 0; + this.celciusMenuItem.Text = "Celcius"; + this.celciusMenuItem.Click += new System.EventHandler(this.celciusMenuItem_Click); // - // fahrenheitToolStripMenuItem + // fahrenheitMenuItem // - this.fahrenheitToolStripMenuItem.Name = "fahrenheitToolStripMenuItem"; - this.fahrenheitToolStripMenuItem.Size = new System.Drawing.Size(130, 22); - this.fahrenheitToolStripMenuItem.Text = "Fahrenheit"; - this.fahrenheitToolStripMenuItem.Click += new System.EventHandler(this.fahrenheitToolStripMenuItem_Click); + this.fahrenheitMenuItem.Index = 1; + this.fahrenheitMenuItem.Text = "Fahrenheit"; + this.fahrenheitMenuItem.Click += new System.EventHandler(this.fahrenheitMenuItem_Click); // - // toolStripMenuItem4 + // MenuItem4 // - this.toolStripMenuItem4.Name = "toolStripMenuItem4"; - this.toolStripMenuItem4.Size = new System.Drawing.Size(204, 6); + this.MenuItem4.Index = 5; + this.MenuItem4.Text = "-"; // // hddMenuItem // - this.hddMenuItem.CheckOnClick = true; - this.hddMenuItem.Name = "hddMenuItem"; - this.hddMenuItem.Size = new System.Drawing.Size(207, 22); + this.hddMenuItem.Index = 6; this.hddMenuItem.Text = "Read HDD sensors"; - this.hddMenuItem.CheckedChanged += new System.EventHandler(this.hddsensorsToolStripMenuItem_CheckedChanged); // - // helpToolStripMenuItem + // helpMenuItem // - this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.aboutToolStripMenuItem}); - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.helpToolStripMenuItem.Text = "Help"; + this.helpMenuItem.Index = 3; + this.helpMenuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.aboutMenuItem}); + this.helpMenuItem.Text = "Help"; // - // aboutToolStripMenuItem + // aboutMenuItem // - this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22); - this.aboutToolStripMenuItem.Text = "About"; - this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); + this.aboutMenuItem.Index = 0; + this.aboutMenuItem.Text = "About"; + this.aboutMenuItem.Click += new System.EventHandler(this.aboutMenuItem_Click); // // splitContainer // - this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer.Location = new System.Drawing.Point(0, 24); + this.splitContainer.Location = new System.Drawing.Point(12, 12); this.splitContainer.Name = "splitContainer"; this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; // @@ -448,7 +406,7 @@ // this.splitContainer.Panel2.Controls.Add(this.plotPanel); this.splitContainer.Panel2.Cursor = System.Windows.Forms.Cursors.Default; - this.splitContainer.Size = new System.Drawing.Size(410, 662); + this.splitContainer.Size = new System.Drawing.Size(386, 662); this.splitContainer.SplitterDistance = 488; this.splitContainer.SplitterWidth = 3; this.splitContainer.TabIndex = 3; @@ -459,14 +417,9 @@ this.plotPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.plotPanel.Location = new System.Drawing.Point(0, 0); this.plotPanel.Name = "plotPanel"; - this.plotPanel.Size = new System.Drawing.Size(410, 171); + this.plotPanel.Size = new System.Drawing.Size(386, 171); this.plotPanel.TabIndex = 0; // - // sensorContextMenuStrip - // - this.sensorContextMenuStrip.Name = "sensorContextMenuStrip"; - this.sensorContextMenuStrip.Size = new System.Drawing.Size(61, 4); - // // saveFileDialog // this.saveFileDialog.DefaultExt = "txt"; @@ -480,47 +433,31 @@ this.timer.Interval = 1000; this.timer.Tick += new System.EventHandler(this.timer_Tick); // - // toolStripMenuItem3 - // - this.toolStripMenuItem3.Name = "toolStripMenuItem3"; - this.toolStripMenuItem3.Size = new System.Drawing.Size(185, 6); - // - // resetMinMaxMenuItem - // - this.resetMinMaxMenuItem.Name = "resetMinMaxMenuItem"; - this.resetMinMaxMenuItem.Size = new System.Drawing.Size(188, 22); - this.resetMinMaxMenuItem.Text = "Reset Min/Max"; - this.resetMinMaxMenuItem.Click += new System.EventHandler(this.resetMinMaxMenuItem_Click); - // // MainForm // + this.Menu = this.mainMenu; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(410, 686); this.Controls.Add(this.splitContainer); - this.Controls.Add(this.menuStrip); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MainMenuStrip = this.menuStrip; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Text = "Open Hardware Monitor"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed); - this.menuStrip.ResumeLayout(false); - this.menuStrip.PerformLayout(); this.splitContainer.Panel1.ResumeLayout(false); this.splitContainer.Panel2.ResumeLayout(false); this.splitContainer.ResumeLayout(false); this.ResumeLayout(false); - this.PerformLayout(); } #endregion private Aga.Controls.Tree.TreeViewAdv treeView; - private System.Windows.Forms.MenuStrip menuStrip; - private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.MainMenu mainMenu; + private System.Windows.Forms.MenuItem fileMenuItem; + private System.Windows.Forms.MenuItem exitMenuItem; private Aga.Controls.Tree.TreeColumn sensor; private Aga.Controls.Tree.TreeColumn value; private Aga.Controls.Tree.TreeColumn min; @@ -532,35 +469,35 @@ private Aga.Controls.Tree.NodeControls.NodeTextBox nodeTextBoxMax; private System.Windows.Forms.SplitContainer splitContainer; private PlotPanel plotPanel; - private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem plotMenuItem; + private System.Windows.Forms.MenuItem viewMenuItem; + private System.Windows.Forms.MenuItem plotMenuItem; private Aga.Controls.Tree.NodeControls.NodeCheckBox nodeCheckBox; - private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem saveReportToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem hddMenuItem; - private System.Windows.Forms.ToolStripMenuItem minTrayMenuItem; - private System.Windows.Forms.ToolStripSeparator separatorMenuItem; - private System.Windows.Forms.ContextMenuStrip sensorContextMenuStrip; - private System.Windows.Forms.ToolStripMenuItem startMinMenuItem; - private System.Windows.Forms.ToolStripMenuItem startupMenuItem; + private System.Windows.Forms.MenuItem helpMenuItem; + private System.Windows.Forms.MenuItem aboutMenuItem; + private System.Windows.Forms.MenuItem saveReportMenuItem; + private System.Windows.Forms.MenuItem optionsMenuItem; + private System.Windows.Forms.MenuItem hddMenuItem; + private System.Windows.Forms.MenuItem minTrayMenuItem; + private System.Windows.Forms.MenuItem separatorMenuItem; + private System.Windows.Forms.ContextMenu sensorContextMenu; + private System.Windows.Forms.MenuItem startMinMenuItem; + private System.Windows.Forms.MenuItem startupMenuItem; private System.Windows.Forms.SaveFileDialog saveFileDialog; private System.Windows.Forms.Timer timer; - private System.Windows.Forms.ToolStripMenuItem hiddenMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem columnsToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem valueMenuItem; - private System.Windows.Forms.ToolStripMenuItem minMenuItem; - private System.Windows.Forms.ToolStripMenuItem maxMenuItem; - private System.Windows.Forms.ToolStripMenuItem temperatureUnitsToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4; - private System.Windows.Forms.ToolStripMenuItem celciusToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem fahrenheitToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem sumbitReportToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; - private System.Windows.Forms.ToolStripMenuItem resetMinMaxMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; + private System.Windows.Forms.MenuItem hiddenMenuItem; + private System.Windows.Forms.MenuItem MenuItem1; + private System.Windows.Forms.MenuItem columnsMenuItem; + private System.Windows.Forms.MenuItem valueMenuItem; + private System.Windows.Forms.MenuItem minMenuItem; + private System.Windows.Forms.MenuItem maxMenuItem; + private System.Windows.Forms.MenuItem temperatureUnitsMenuItem; + private System.Windows.Forms.MenuItem MenuItem4; + private System.Windows.Forms.MenuItem celciusMenuItem; + private System.Windows.Forms.MenuItem fahrenheitMenuItem; + private System.Windows.Forms.MenuItem sumbitReportMenuItem; + private System.Windows.Forms.MenuItem MenuItem2; + private System.Windows.Forms.MenuItem resetMinMaxMenuItem; + private System.Windows.Forms.MenuItem MenuItem3; } } diff -r 8ffea928daad -r 3e2ab626531c GUI/MainForm.cs --- a/GUI/MainForm.cs Sat Jul 17 13:25:42 2010 +0000 +++ b/GUI/MainForm.cs Sun Jul 18 12:38:01 2010 +0000 @@ -61,8 +61,22 @@ private StartupManager startupManager = new StartupManager(); private UpdateVisitor updateVisitor = new UpdateVisitor(); + private UserOption showHiddenSensors; + private UserOption showPlot; + private UserOption showValue; + private UserOption showMin; + private UserOption showMax; + private UserOption startMinimized; + private UserOption minimizeToTray; + private UserOption autoStart; + private UserOption readHddSensors; + public MainForm() { InitializeComponent(); + + // set the DockStyle here, to avoid conflicts with the MainMenu + this.splitContainer.Dock = DockStyle.Fill; + this.Font = SystemFonts.MessageBoxFont; treeView.Font = SystemFonts.MessageBoxFont; plotPanel.Font = SystemFonts.MessageBoxFont; @@ -85,8 +99,9 @@ StartPosition = FormStartPosition.CenterScreen; } - Width = Utilities.Config.Get("mainForm.Width", Width); - Height = Utilities.Config.Get("mainForm.Height", Height); + ClientSize = new Size( + Utilities.Config.Get("mainForm.Width", ClientSize.Width), + Utilities.Config.Get("mainForm.Height", ClientSize.Height)); foreach (TreeColumn column in treeView.Columns) column.Width = Math.Max(20, Math.Min(400, @@ -125,21 +140,53 @@ plotColorPalette[11] = Color.Olive; plotColorPalette[12] = Color.Firebrick; - hiddenMenuItem.Checked = Config.Get(hiddenMenuItem.Name, false); - plotMenuItem.Checked = Config.Get(plotMenuItem.Name, false); + showHiddenSensors = new UserOption("hiddenMenuItem", false, hiddenMenuItem); + showHiddenSensors.Changed += delegate(object sender, EventArgs e) { + treeModel.ForceVisible = showHiddenSensors.Value; + }; - valueMenuItem.Checked = Config.Get(valueMenuItem.Name, true); - minMenuItem.Checked = Config.Get(minMenuItem.Name, false); - maxMenuItem.Checked = Config.Get(maxMenuItem.Name, true); + showPlot = new UserOption("plotMenuItem", false, plotMenuItem); + showPlot.Changed += delegate(object sender, EventArgs e) { + splitContainer.Panel2Collapsed = !showPlot.Value; + treeView.Invalidate(); + }; - startMinMenuItem.Checked = Config.Get(startMinMenuItem.Name, false); - minTrayMenuItem.Checked = Config.Get(minTrayMenuItem.Name, true); - startupMenuItem.Checked = startupManager.Startup; - hddMenuItem.Checked = Config.Get(hddMenuItem.Name, true); + showValue = new UserOption("valueMenuItem", true, valueMenuItem); + showValue.Changed += delegate(object sender, EventArgs e) { + treeView.Columns[1].IsVisible = showValue.Value; + }; - celciusToolStripMenuItem.Checked = + showMin = new UserOption("minMenuItem", false, minMenuItem); + showMin.Changed += delegate(object sender, EventArgs e) { + treeView.Columns[2].IsVisible = showMin.Value; + }; + + showMax = new UserOption("maxMenuItem", true, maxMenuItem); + showMax.Changed += delegate(object sender, EventArgs e) { + treeView.Columns[3].IsVisible = showMax.Value; + }; + + startMinimized = new UserOption("startMinMenuItem", false, startMinMenuItem); + + minimizeToTray = new UserOption("minTrayMenuItem", true, minTrayMenuItem); + minimizeToTray.Changed += delegate(object sender, EventArgs e) { + systemTray.IsMainIconEnabled = minimizeToTray.Value; + }; + + autoStart = new UserOption(null, startupManager.Startup, startupMenuItem); + autoStart.Changed += delegate(object sender, EventArgs e) { + startupManager.Startup = autoStart.Value; ; + }; + + readHddSensors = new UserOption("hddMenuItem", true, hddMenuItem); + readHddSensors.Changed += delegate(object sender, EventArgs e) { + computer.HDDEnabled = readHddSensors.Value; + UpdatePlotSelection(null, null); + }; + + celciusMenuItem.Checked = UnitManager.TemperatureUnit == TemperatureUnit.Celcius; - fahrenheitToolStripMenuItem.Checked = !celciusToolStripMenuItem.Checked; + fahrenheitMenuItem.Checked = !celciusMenuItem.Checked; startupMenuItem.Visible = startupManager.IsAvailable; @@ -250,22 +297,11 @@ } private void SaveConfiguration() { - Config.Set(hiddenMenuItem.Name, hiddenMenuItem.Checked); - Config.Set(plotMenuItem.Name, plotMenuItem.Checked); - - Config.Set(valueMenuItem.Name, valueMenuItem.Checked); - Config.Set(minMenuItem.Name, minMenuItem.Checked); - Config.Set(maxMenuItem.Name, maxMenuItem.Checked); - - Config.Set(startMinMenuItem.Name, startMinMenuItem.Checked); - Config.Set(minTrayMenuItem.Name, minTrayMenuItem.Checked); - Config.Set(hddMenuItem.Name, hddMenuItem.Checked); - if (WindowState != FormWindowState.Minimized) { Config.Set("mainForm.Location.X", Location.X); Config.Set("mainForm.Location.Y", Location.Y); - Config.Set("mainForm.Width", Width); - Config.Set("mainForm.Height", Height); + Config.Set("mainForm.Width", ClientSize.Width); + Config.Set("mainForm.Height", ClientSize.Height); } foreach (TreeColumn column in treeView.Columns) @@ -276,6 +312,7 @@ } private void MainForm_FormClosed(object sender, FormClosedEventArgs e) { + Visible = false; SaveConfiguration(); timer.Enabled = false; @@ -283,17 +320,10 @@ computer.Close(); } - private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { + private void aboutMenuItem_Click(object sender, EventArgs e) { new AboutBox().ShowDialog(); } - private void plotToolStripMenuItem_CheckedChanged(object sender, - EventArgs e) - { - splitContainer.Panel2Collapsed = !plotMenuItem.Checked; - treeView.Invalidate(); - } - private void treeView_Click(object sender, EventArgs e) { MouseEventArgs m = e as MouseEventArgs; @@ -301,58 +331,57 @@ return; NodeControlInfo info = treeView.GetNodeControlInfoAt(new Point(m.X, m.Y)); - if (info.Control != null) { + treeView.SelectedNode = info.Node; + if (info.Node != null) { SensorNode node = info.Node.Tag as SensorNode; if (node != null && node.Sensor != null) { - - sensorContextMenuStrip.Items.Clear(); + sensorContextMenu.MenuItems.Clear(); if (node.Sensor.Parameters.Length > 0) { - ToolStripMenuItem item = new ToolStripMenuItem("Parameters..."); + MenuItem item = new MenuItem("Parameters..."); item.Click += delegate(object obj, EventArgs args) { ShowParameterForm(node.Sensor); }; - sensorContextMenuStrip.Items.Add(item); + sensorContextMenu.MenuItems.Add(item); } - EditableControl control = info.Control as EditableControl; - if (control != null) { - ToolStripMenuItem item = new ToolStripMenuItem("Rename"); + if (nodeTextBoxText.EditEnabled) { + MenuItem item = new MenuItem("Rename"); item.Click += delegate(object obj, EventArgs args) { - control.BeginEdit(); + nodeTextBoxText.BeginEdit(); }; - sensorContextMenuStrip.Items.Add(item); + sensorContextMenu.MenuItems.Add(item); } if (node.IsVisible) { - ToolStripMenuItem item = new ToolStripMenuItem("Hide"); + MenuItem item = new MenuItem("Hide"); item.Click += delegate(object obj, EventArgs args) { node.IsVisible = false; }; - sensorContextMenuStrip.Items.Add(item); + sensorContextMenu.MenuItems.Add(item); } else { - ToolStripMenuItem item = new ToolStripMenuItem("Unhide"); + MenuItem item = new MenuItem("Unhide"); item.Click += delegate(object obj, EventArgs args) { node.IsVisible = true; }; - sensorContextMenuStrip.Items.Add(item); + sensorContextMenu.MenuItems.Add(item); } if (systemTray.Contains(node.Sensor)) { - ToolStripMenuItem item = new ToolStripMenuItem("Remove From Tray"); + MenuItem item = new MenuItem("Remove From Tray"); item.Click += delegate(object obj, EventArgs args) { systemTray.Remove(node.Sensor); }; - sensorContextMenuStrip.Items.Add(item); + sensorContextMenu.MenuItems.Add(item); } else { - ToolStripMenuItem item = new ToolStripMenuItem("Add To Tray"); + MenuItem item = new MenuItem("Add To Tray"); item.Click += delegate(object obj, EventArgs args) { systemTray.Add(node.Sensor, true); }; - sensorContextMenuStrip.Items.Add(item); + sensorContextMenu.MenuItems.Add(item); } - sensorContextMenuStrip.Show(treeView, m.X, m.Y); + sensorContextMenu.Show(treeView, new Point(m.X, m.Y)); } } } - private void saveReportToolStripMenuItem_Click(object sender, EventArgs e) { + private void saveReportMenuItem_Click(object sender, EventArgs e) { string report = computer.GetReport(); if (saveFileDialog.ShowDialog() == DialogResult.OK) { using (TextWriter w = new StreamWriter(saveFileDialog.FileName)) { @@ -361,13 +390,6 @@ } } - private void hddsensorsToolStripMenuItem_CheckedChanged(object sender, - EventArgs e) - { - computer.HDDEnabled = hddMenuItem.Checked; - UpdatePlotSelection(null, null); - } - private void SysTrayHideShow() { Visible = !Visible; if (Visible) @@ -377,7 +399,7 @@ protected override void WndProc(ref Message m) { const int WM_SYSCOMMAND = 0x112; const int SC_MINIMIZE = 0xF020; - if (minTrayMenuItem.Checked && + if (minimizeToTray.Value && m.Msg == WM_SYSCOMMAND && m.WParam.ToInt32() == SC_MINIMIZE) { SysTrayHideShow(); } else { @@ -389,12 +411,12 @@ SysTrayHideShow(); } - private void removeToolStripMenuItem_Click(object sender, EventArgs e) { - ToolStripMenuItem item = sender as ToolStripMenuItem; + private void removeMenuItem_Click(object sender, EventArgs e) { + MenuItem item = sender as MenuItem; if (item == null) return; - ISensor sensor = item.Owner.Tag as ISensor; + ISensor sensor = item.Parent.Tag as ISensor; if (sensor == null) return; @@ -417,46 +439,19 @@ } } - private void runOnWindowsStartupToolStripMenuItem_CheckedChanged( - object sender, EventArgs e) - { - startupManager.Startup = startupMenuItem.Checked; - } - - private void minTrayMenuItem_CheckedChanged(object sender, EventArgs e) { - systemTray.IsMainIconEnabled = minTrayMenuItem.Checked; - } - - private void hiddenSensorsMenuItem_CheckedChanged(object sender, - EventArgs e) { - treeModel.ForceVisible = hiddenMenuItem.Checked; - } - - private void valueMenuItem_CheckedChanged(object sender, EventArgs e) { - treeView.Columns[1].IsVisible = valueMenuItem.Checked; - } - - private void minMenuItem_CheckedChanged(object sender, EventArgs e) { - treeView.Columns[2].IsVisible = minMenuItem.Checked; - } - - private void maxMenuItem_CheckedChanged(object sender, EventArgs e) { - treeView.Columns[3].IsVisible = maxMenuItem.Checked; - } - - private void celciusToolStripMenuItem_Click(object sender, EventArgs e) { - celciusToolStripMenuItem.Checked = true; - fahrenheitToolStripMenuItem.Checked = false; + private void celciusMenuItem_Click(object sender, EventArgs e) { + celciusMenuItem.Checked = true; + fahrenheitMenuItem.Checked = false; UnitManager.TemperatureUnit = TemperatureUnit.Celcius; } - private void fahrenheitToolStripMenuItem_Click(object sender, EventArgs e) { - celciusToolStripMenuItem.Checked = false; - fahrenheitToolStripMenuItem.Checked = true; + private void fahrenheitMenuItem_Click(object sender, EventArgs e) { + celciusMenuItem.Checked = false; + fahrenheitMenuItem.Checked = true; UnitManager.TemperatureUnit = TemperatureUnit.Fahrenheit; } - private void sumbitReportToolStripMenuItem_Click(object sender, EventArgs e) + private void sumbitReportMenuItem_Click(object sender, EventArgs e) { ReportForm form = new ReportForm(); form.Report = computer.GetReport(); diff -r 8ffea928daad -r 3e2ab626531c GUI/MainForm.resx --- a/GUI/MainForm.resx Sat Jul 17 13:25:42 2010 +0000 +++ b/GUI/MainForm.resx Sun Jul 18 12:38:01 2010 +0000 @@ -117,20 +117,17 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + 226, 17 + + + 334, 17 + + 17, 17 - - 125, 17 - - - 311, 17 - - 440, 17 - - - 55 + 146, 17 diff -r 8ffea928daad -r 3e2ab626531c GUI/SensorNotifyIcon.cs --- a/GUI/SensorNotifyIcon.cs Sat Jul 17 13:25:42 2010 +0000 +++ b/GUI/SensorNotifyIcon.cs Sun Jul 18 12:38:01 2010 +0000 @@ -77,19 +77,19 @@ this.pen = new Pen(Color.FromArgb(96, Color.Black)); this.font = SystemFonts.MessageBoxFont; - ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); - ToolStripMenuItem hideShowItem = new ToolStripMenuItem("Hide/Show"); + ContextMenu contextMenu = new ContextMenu(); + MenuItem hideShowItem = new MenuItem("Hide/Show"); hideShowItem.Click += delegate(object obj, EventArgs args) { sensorSystemTray.SendHideShowCommand(); }; - contextMenuStrip.Items.Add(hideShowItem); - contextMenuStrip.Items.Add(new ToolStripSeparator()); - ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove Sensor"); + contextMenu.MenuItems.Add(hideShowItem); + contextMenu.MenuItems.Add(new MenuItem("-")); + MenuItem removeItem = new MenuItem("Remove Sensor"); removeItem.Click += delegate(object obj, EventArgs args) { sensorSystemTray.Remove(this.sensor); }; - contextMenuStrip.Items.Add(removeItem); - ToolStripMenuItem colorItem = new ToolStripMenuItem("Change Color..."); + contextMenu.MenuItems.Add(removeItem); + MenuItem colorItem = new MenuItem("Change Color..."); colorItem.Click += delegate(object obj, EventArgs args) { ColorDialog dialog = new ColorDialog(); dialog.Color = Color; @@ -99,14 +99,14 @@ "traycolor").ToString(), Color); } }; - contextMenuStrip.Items.Add(colorItem); - contextMenuStrip.Items.Add(new ToolStripSeparator()); - ToolStripMenuItem exitItem = new ToolStripMenuItem("Exit"); + contextMenu.MenuItems.Add(colorItem); + contextMenu.MenuItems.Add(new MenuItem("-")); + MenuItem exitItem = new MenuItem("Exit"); exitItem.Click += delegate(object obj, EventArgs args) { sensorSystemTray.SendExitCommand(); }; - contextMenuStrip.Items.Add(exitItem); - this.notifyIcon.ContextMenuStrip = contextMenuStrip; + contextMenu.MenuItems.Add(exitItem); + this.notifyIcon.ContextMenu = contextMenu; this.notifyIcon.DoubleClick += delegate(object obj, EventArgs args) { sensorSystemTray.SendHideShowCommand(); }; diff -r 8ffea928daad -r 3e2ab626531c GUI/SystemTray.cs --- a/GUI/SystemTray.cs Sat Jul 17 13:25:42 2010 +0000 +++ b/GUI/SystemTray.cs Sun Jul 18 12:38:01 2010 +0000 @@ -57,19 +57,19 @@ this.mainIcon = new NotifyIcon(); - ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); - ToolStripMenuItem hideShowItem = new ToolStripMenuItem("Hide/Show"); + ContextMenu contextMenu = new ContextMenu(); + MenuItem hideShowItem = new MenuItem("Hide/Show"); hideShowItem.Click += delegate(object obj, EventArgs args) { SendHideShowCommand(); }; - contextMenuStrip.Items.Add(hideShowItem); - contextMenuStrip.Items.Add(new ToolStripSeparator()); - ToolStripMenuItem exitItem = new ToolStripMenuItem("Exit"); + contextMenu.MenuItems.Add(hideShowItem); + contextMenu.MenuItems.Add(new MenuItem("-")); + MenuItem exitItem = new MenuItem("Exit"); exitItem.Click += delegate(object obj, EventArgs args) { SendExitCommand(); }; - contextMenuStrip.Items.Add(exitItem); - this.mainIcon.ContextMenuStrip = contextMenuStrip; + contextMenu.MenuItems.Add(exitItem); + this.mainIcon.ContextMenu = contextMenu; this.mainIcon.DoubleClick += delegate(object obj, EventArgs args) { SendHideShowCommand(); }; diff -r 8ffea928daad -r 3e2ab626531c GUI/UserOption.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GUI/UserOption.cs Sun Jul 18 12:38:01 2010 +0000 @@ -0,0 +1,92 @@ +/* + + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + + The contents of this file are subject to the Mozilla Public License Version + 1.1 (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the License. + + The Original Code is the Open Hardware Monitor code. + + The Initial Developer of the Original Code is + Michael Möller . + Portions created by the Initial Developer are Copyright (C) 2009-2010 + the Initial Developer. All Rights Reserved. + + Contributor(s): + + Alternatively, the contents of this file may be used under the terms of + either the GNU General Public License Version 2 or later (the "GPL"), or + the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + in which case the provisions of the GPL or the LGPL are applicable instead + of those above. If you wish to allow use of your version of this file only + under the terms of either the GPL or the LGPL, and not to allow others to + use your version of this file under the terms of the MPL, indicate your + decision by deleting the provisions above and replace them with the notice + and other provisions required by the GPL or the LGPL. If you do not delete + the provisions above, a recipient may use your version of this file under + the terms of any one of the MPL, the GPL or the LGPL. + +*/ + +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using OpenHardwareMonitor.Utilities; + +namespace OpenHardwareMonitor.GUI { + public class UserOption { + private string name; + private bool value; + private MenuItem menuItem; + private event EventHandler changed; + + public UserOption(string name, bool value, + MenuItem menuItem) { + + this.name = name; + if (name != null) + this.value = Config.Get(name, value); + else + this.value = value; + this.menuItem = menuItem; + this.menuItem.Checked = this.value; + this.menuItem.Click += new EventHandler(menuItem_Click); + } + + private void menuItem_Click(object sender, EventArgs e) { + this.Value = !this.Value; + } + + public bool Value { + get { return value; } + set { + if (this.value != value) { + this.value = value; + if (this.name != null) + Config.Set(name, value); + this.menuItem.Checked = value; + if (changed != null) + changed(this, null); + } + } + } + + public event EventHandler Changed { + add { + changed += value; + if (changed != null) + changed(this, null); + } + remove { + changed -= value; + } + } + } +} diff -r 8ffea928daad -r 3e2ab626531c OpenHardwareMonitor.csproj --- a/OpenHardwareMonitor.csproj Sat Jul 17 13:25:42 2010 +0000 +++ b/OpenHardwareMonitor.csproj Sun Jul 18 12:38:01 2010 +0000 @@ -89,6 +89,7 @@ + @@ -169,10 +170,6 @@ AboutBox.cs Designer - - MainForm.cs - Designer - PlotPanel.cs Designer @@ -213,6 +210,9 @@ + + MainForm.cs + ReportForm.cs diff -r 8ffea928daad -r 3e2ab626531c Properties/AssemblyInfo.cs --- a/Properties/AssemblyInfo.cs Sat Jul 17 13:25:42 2010 +0000 +++ b/Properties/AssemblyInfo.cs Sun Jul 18 12:38:01 2010 +0000 @@ -69,5 +69,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.37.1")] -[assembly: AssemblyFileVersion("0.1.37.1")] +[assembly: AssemblyVersion("0.1.37.2")] +[assembly: AssemblyFileVersion("0.1.37.2")]