Added some GUI improvements: Better handling of the row selection, minimal row spacing of 18 pixel (to get nice dotted lines) and 3 decimal digits for voltages. Also changed the tree view font rendering to get better quality without ClearType.
authormoel.mich
Sun, 15 May 2011 20:48:52 +0000
changeset 2871f5cf5d533e6
parent 286 48d7e8d6c0db
child 288 a35a89a35532
Added some GUI improvements: Better handling of the row selection, minimal row spacing of 18 pixel (to get nice dotted lines) and 3 decimal digits for voltages. Also changed the tree view font rendering to get better quality without ClearType.
GUI/MainForm.Designer.cs
GUI/MainForm.cs
GUI/MainForm.resx
GUI/SensorNode.cs
     1.1 --- a/GUI/MainForm.Designer.cs	Sun May 15 17:21:27 2011 +0000
     1.2 +++ b/GUI/MainForm.Designer.cs	Sun May 15 20:48:52 2011 +0000
     1.3 @@ -77,6 +77,8 @@
     1.4        this.saveReportMenuItem = new System.Windows.Forms.MenuItem();
     1.5        this.sumbitReportMenuItem = new System.Windows.Forms.MenuItem();
     1.6        this.MenuItem2 = new System.Windows.Forms.MenuItem();
     1.7 +      this.resetMenuItem = new System.Windows.Forms.MenuItem();
     1.8 +      this.menuItem6 = new System.Windows.Forms.MenuItem();
     1.9        this.exitMenuItem = new System.Windows.Forms.MenuItem();
    1.10        this.viewMenuItem = new System.Windows.Forms.MenuItem();
    1.11        this.resetMinMaxMenuItem = new System.Windows.Forms.MenuItem();
    1.12 @@ -108,8 +110,6 @@
    1.13        this.splitContainer = new OpenHardwareMonitor.GUI.SplitContainerAdv();
    1.14        this.treeView = new Aga.Controls.Tree.TreeViewAdv();
    1.15        this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel();
    1.16 -      this.resetMenuItem = new System.Windows.Forms.MenuItem();
    1.17 -      this.menuItem6 = new System.Windows.Forms.MenuItem();
    1.18        this.splitContainer.Panel1.SuspendLayout();
    1.19        this.splitContainer.Panel2.SuspendLayout();
    1.20        this.splitContainer.SuspendLayout();
    1.21 @@ -165,6 +165,7 @@
    1.22        this.nodeTextBoxText.LeftMargin = 3;
    1.23        this.nodeTextBoxText.ParentColumn = this.sensor;
    1.24        this.nodeTextBoxText.Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
    1.25 +      this.nodeTextBoxText.UseCompatibleTextRendering = true;
    1.26        // 
    1.27        // nodeTextBoxValue
    1.28        // 
    1.29 @@ -173,6 +174,7 @@
    1.30        this.nodeTextBoxValue.LeftMargin = 3;
    1.31        this.nodeTextBoxValue.ParentColumn = this.value;
    1.32        this.nodeTextBoxValue.Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
    1.33 +      this.nodeTextBoxValue.UseCompatibleTextRendering = true;
    1.34        // 
    1.35        // nodeTextBoxMin
    1.36        // 
    1.37 @@ -181,6 +183,7 @@
    1.38        this.nodeTextBoxMin.LeftMargin = 3;
    1.39        this.nodeTextBoxMin.ParentColumn = this.min;
    1.40        this.nodeTextBoxMin.Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
    1.41 +      this.nodeTextBoxMin.UseCompatibleTextRendering = true;
    1.42        // 
    1.43        // nodeTextBoxMax
    1.44        // 
    1.45 @@ -189,6 +192,7 @@
    1.46        this.nodeTextBoxMax.LeftMargin = 3;
    1.47        this.nodeTextBoxMax.ParentColumn = this.max;
    1.48        this.nodeTextBoxMax.Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
    1.49 +      this.nodeTextBoxMax.UseCompatibleTextRendering = true;
    1.50        // 
    1.51        // mainMenu
    1.52        // 
    1.53 @@ -227,6 +231,17 @@
    1.54        this.MenuItem2.Index = 2;
    1.55        this.MenuItem2.Text = "-";
    1.56        // 
    1.57 +      // resetMenuItem
    1.58 +      // 
    1.59 +      this.resetMenuItem.Index = 3;
    1.60 +      this.resetMenuItem.Text = "Reset";
    1.61 +      this.resetMenuItem.Click += new System.EventHandler(this.resetClick);
    1.62 +      // 
    1.63 +      // menuItem6
    1.64 +      // 
    1.65 +      this.menuItem6.Index = 4;
    1.66 +      this.menuItem6.Text = "-";
    1.67 +      // 
    1.68        // exitMenuItem
    1.69        // 
    1.70        this.exitMenuItem.Index = 5;
    1.71 @@ -448,6 +463,7 @@
    1.72        this.treeView.UseColumns = true;
    1.73        this.treeView.NodeMouseDoubleClick += new System.EventHandler<Aga.Controls.Tree.TreeNodeAdvMouseEventArgs>(this.treeView_NodeMouseDoubleClick);
    1.74        this.treeView.Click += new System.EventHandler(this.treeView_Click);
    1.75 +      this.treeView.MouseMove += new System.Windows.Forms.MouseEventHandler(this.treeView_MouseMove);
    1.76        // 
    1.77        // plotPanel
    1.78        // 
    1.79 @@ -457,17 +473,6 @@
    1.80        this.plotPanel.Size = new System.Drawing.Size(386, 124);
    1.81        this.plotPanel.TabIndex = 0;
    1.82        // 
    1.83 -      // resetMenuItem
    1.84 -      // 
    1.85 -      this.resetMenuItem.Index = 3;
    1.86 -      this.resetMenuItem.Text = "Reset";
    1.87 -      this.resetMenuItem.Click += new System.EventHandler(this.resetClick);
    1.88 -      // 
    1.89 -      // menuItem6
    1.90 -      // 
    1.91 -      this.menuItem6.Index = 4;
    1.92 -      this.menuItem6.Text = "-";
    1.93 -      // 
    1.94        // MainForm
    1.95        // 
    1.96        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     2.1 --- a/GUI/MainForm.cs	Sun May 15 17:21:27 2011 +0000
     2.2 +++ b/GUI/MainForm.cs	Sun May 15 20:48:52 2011 +0000
     2.3 @@ -120,7 +120,7 @@
     2.4  
     2.5        int p = (int)Environment.OSVersion.Platform;
     2.6        if ((p == 4) || (p == 128)) { // Unix
     2.7 -        treeView.RowHeight = Math.Max(treeView.RowHeight, 17); 
     2.8 +        treeView.RowHeight = Math.Max(treeView.RowHeight, 18); 
     2.9          splitContainer.BorderStyle = BorderStyle.None;
    2.10          splitContainer.Border3DStyle = Border3DStyle.Adjust;
    2.11          splitContainer.SplitterWidth = 4;
    2.12 @@ -131,7 +131,7 @@
    2.13          minTrayMenuItem.Visible = false;
    2.14          startMinMenuItem.Visible = false;
    2.15        } else { // Windows
    2.16 -        treeView.RowHeight = Math.Max(treeView.Font.Height + 1, 17); 
    2.17 +        treeView.RowHeight = Math.Max(treeView.Font.Height + 1, 18); 
    2.18  
    2.19          gadget = new SensorGadget(computer, settings, unitManager);
    2.20          gadget.HideShowCommand += hideShowClick;
    2.21 @@ -627,5 +627,11 @@
    2.22        // restore the MainIcon setting
    2.23        systemTray.IsMainIconEnabled = minimizeToTray.Value;
    2.24      }
    2.25 +
    2.26 +    private void treeView_MouseMove(object sender, MouseEventArgs e) {
    2.27 +      if ((e.Button & (MouseButtons.Left | MouseButtons.Right)) > 0) {
    2.28 +        treeView.SelectedNode = treeView.GetNodeAt(e.Location);
    2.29 +      }
    2.30 +    }
    2.31    }
    2.32  }
     3.1 --- a/GUI/MainForm.resx	Sun May 15 17:21:27 2011 +0000
     3.2 +++ b/GUI/MainForm.resx	Sun May 15 20:48:52 2011 +0000
     3.3 @@ -118,16 +118,16 @@
     3.4      <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     3.5    </resheader>
     3.6    <metadata name="mainMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     3.7 -    <value>226, 17</value>
     3.8 +    <value>373, 17</value>
     3.9    </metadata>
    3.10 -  <metadata name="sensorContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.11 -    <value>334, 17</value>
    3.12 +  <metadata name="treeContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.13 +    <value>17, 17</value>
    3.14    </metadata>
    3.15    <metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.16 -    <value>17, 17</value>
    3.17 +    <value>164, 17</value>
    3.18    </metadata>
    3.19    <metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    3.20 -    <value>146, 17</value>
    3.21 +    <value>293, 17</value>
    3.22    </metadata>
    3.23    <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    3.24    <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     4.1 --- a/GUI/SensorNode.cs	Sun May 15 17:21:27 2011 +0000
     4.2 +++ b/GUI/SensorNode.cs	Sun May 15 20:48:52 2011 +0000
     4.3 @@ -67,7 +67,7 @@
     4.4        this.settings = settings;
     4.5        this.unitManager = unitManager;
     4.6        switch (sensor.SensorType) {
     4.7 -        case SensorType.Voltage: format = "{0:F2} V"; break;
     4.8 +        case SensorType.Voltage: format = "{0:F3} V"; break;
     4.9          case SensorType.Clock: format = "{0:F0} MHz"; break;
    4.10          case SensorType.Load: format = "{0:F1} %"; break;
    4.11          case SensorType.Temperature: format = "{0:F1} °C"; break;