Attached plot panel fixed width plot or sensor panel (#1179)
* Plot panel right fixed width when chnaging window width * Fixed with plot panel or sensor panel as an option * Fixed capitalisation of menu items. Edited the names of menu items added for split panel scaling options. Corrected some variable names to corrospond to menu item name changes.
This commit is contained in:
+40
@@ -87,6 +87,10 @@ namespace LibreHardwareMonitor.UI
|
||||
this.plotWindowMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem();
|
||||
this.plotBottomMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem();
|
||||
this.plotRightMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem();
|
||||
this.splitPlotPanelScalingMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.splitPanelPercentageScalingMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem();
|
||||
this.splitPanelFixedPlotScalingMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem();
|
||||
this.splitPanelFixedSensorScalingMenuItem = new LibreHardwareMonitor.UI.ToolStripRadioButtonMenuItem();
|
||||
this.logSeparatorMenuItem = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.logSensorsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.loggingIntervalMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -437,6 +441,7 @@ namespace LibreHardwareMonitor.UI
|
||||
this.separatorMenuItem,
|
||||
this.temperatureUnitsMenuItem,
|
||||
this.plotLocationMenuItem,
|
||||
this.splitPlotPanelScalingMenuItem,
|
||||
this.logSeparatorMenuItem,
|
||||
this.logSensorsMenuItem,
|
||||
this.loggingIntervalMenuItem,
|
||||
@@ -533,6 +538,37 @@ namespace LibreHardwareMonitor.UI
|
||||
this.plotRightMenuItem.Size = new System.Drawing.Size(118, 22);
|
||||
this.plotRightMenuItem.Text = "Right";
|
||||
//
|
||||
// attachedPlotPanelScalingMenuItem
|
||||
//
|
||||
this.splitPlotPanelScalingMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.splitPanelPercentageScalingMenuItem,
|
||||
this.splitPanelFixedPlotScalingMenuItem,
|
||||
this.splitPanelFixedSensorScalingMenuItem});
|
||||
this.splitPlotPanelScalingMenuItem.Name = "attachedPlotPanelScalingMenuItem";
|
||||
this.splitPlotPanelScalingMenuItem.Size = new System.Drawing.Size(221, 22);
|
||||
this.splitPlotPanelScalingMenuItem.Text = "Split Panel Scaling Mode";
|
||||
//
|
||||
// attachedPanelPercentageScalingMenuItem
|
||||
//
|
||||
this.splitPanelPercentageScalingMenuItem.CheckOnClick = true;
|
||||
this.splitPanelPercentageScalingMenuItem.Name = "attachedPlotPanelPercentageScalingMenuItem";
|
||||
this.splitPanelPercentageScalingMenuItem.Size = new System.Drawing.Size(118, 22);
|
||||
this.splitPanelPercentageScalingMenuItem.Text = "Percentage Scaling";
|
||||
//
|
||||
// attachedPanelFixedWidthPlotPanelScalingMenuItem
|
||||
//
|
||||
this.splitPanelFixedPlotScalingMenuItem.CheckOnClick = true;
|
||||
this.splitPanelFixedPlotScalingMenuItem.Name = "attachedBottomMenuItem";
|
||||
this.splitPanelFixedPlotScalingMenuItem.Size = new System.Drawing.Size(118, 22);
|
||||
this.splitPanelFixedPlotScalingMenuItem.Text = "Fixed Size Plot Panel";
|
||||
//
|
||||
// attachedPanelFixedWidthSensorPanelScalingMenuItem
|
||||
//
|
||||
this.splitPanelFixedSensorScalingMenuItem.CheckOnClick = true;
|
||||
this.splitPanelFixedSensorScalingMenuItem.Name = "attachedRightMenuItem";
|
||||
this.splitPanelFixedSensorScalingMenuItem.Size = new System.Drawing.Size(118, 22);
|
||||
this.splitPanelFixedSensorScalingMenuItem.Text = "Fixed Size Sensor Panel";
|
||||
//
|
||||
// logSeparatorMenuItem
|
||||
//
|
||||
this.logSeparatorMenuItem.Name = "logSeparatorMenuItem";
|
||||
@@ -1012,6 +1048,10 @@ namespace LibreHardwareMonitor.UI
|
||||
private ToolStripRadioButtonMenuItem plotWindowMenuItem;
|
||||
private ToolStripRadioButtonMenuItem plotBottomMenuItem;
|
||||
private ToolStripRadioButtonMenuItem plotRightMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem splitPlotPanelScalingMenuItem;
|
||||
private ToolStripRadioButtonMenuItem splitPanelPercentageScalingMenuItem;
|
||||
private ToolStripRadioButtonMenuItem splitPanelFixedPlotScalingMenuItem;
|
||||
private ToolStripRadioButtonMenuItem splitPanelFixedSensorScalingMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem webMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem runWebServerMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem serverPortMenuItem;
|
||||
|
||||
@@ -55,6 +55,7 @@ public sealed partial class MainForm : Form
|
||||
private int _delayCount;
|
||||
private Form _plotForm;
|
||||
private UserRadioGroup _plotLocation;
|
||||
private UserRadioGroup _splitPanelScalingSetting;
|
||||
private bool _selectionDragging;
|
||||
private IDictionary<ISensor, Color> _sensorPlotColors = new Dictionary<ISensor, Color>();
|
||||
private UserOption _showPlot;
|
||||
@@ -507,6 +508,7 @@ public sealed partial class MainForm : Form
|
||||
|
||||
_showPlot = new UserOption("plotMenuItem", false, plotMenuItem, _settings);
|
||||
_plotLocation = new UserRadioGroup("plotLocation", 0, new[] { plotWindowMenuItem, plotBottomMenuItem, plotRightMenuItem }, _settings);
|
||||
_splitPanelScalingSetting = new UserRadioGroup("splitPanelScalingSetting", 0, new[] { splitPanelPercentageScalingMenuItem, splitPanelFixedPlotScalingMenuItem, splitPanelFixedSensorScalingMenuItem }, _settings);
|
||||
|
||||
_showPlot.Changed += delegate
|
||||
{
|
||||
@@ -535,7 +537,6 @@ public sealed partial class MainForm : Form
|
||||
_plotForm.Controls.Add(_plotPanel);
|
||||
if (_showPlot.Value && Visible)
|
||||
_plotForm.Show();
|
||||
|
||||
break;
|
||||
case 1:
|
||||
_plotForm.Controls.Clear();
|
||||
@@ -554,6 +555,22 @@ public sealed partial class MainForm : Form
|
||||
}
|
||||
};
|
||||
|
||||
_splitPanelScalingSetting.Changed += delegate
|
||||
{
|
||||
switch (_splitPanelScalingSetting.Value)
|
||||
{
|
||||
case 0:
|
||||
splitContainer.FixedPanel = FixedPanel.None;
|
||||
break;
|
||||
case 1:
|
||||
splitContainer.FixedPanel = FixedPanel.Panel2;
|
||||
break;
|
||||
case 2:
|
||||
splitContainer.FixedPanel = FixedPanel.Panel1;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
_plotForm.FormClosing += delegate(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (e.CloseReason == CloseReason.UserClosing)
|
||||
@@ -1155,4 +1172,4 @@ public sealed partial class MainForm : Form
|
||||
{
|
||||
new AuthForm(this).ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user