diff --git a/PanelMaterial.Designer.cs b/PanelMaterial.Designer.cs index 8618487..bea3616 100644 --- a/PanelMaterial.Designer.cs +++ b/PanelMaterial.Designer.cs @@ -59,7 +59,7 @@ // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(10, 424); + this.label3.Location = new System.Drawing.Point(10, 339); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(86, 12); this.label3.TabIndex = 6; @@ -67,8 +67,7 @@ // // lvSpring // - this.lvSpring.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.lvSpring.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lvSpring.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.lvchSpring}); @@ -76,7 +75,7 @@ this.lvSpring.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.lvSpring.Location = new System.Drawing.Point(12, 61); this.lvSpring.Name = "lvSpring"; - this.lvSpring.Size = new System.Drawing.Size(326, 343); + this.lvSpring.Size = new System.Drawing.Size(326, 263); this.lvSpring.TabIndex = 7; this.lvSpring.UseCompatibleStateImageBehavior = false; this.lvSpring.View = System.Windows.Forms.View.Details; @@ -90,15 +89,16 @@ // // lvTable // - this.lvTable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.lvTable.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lvTable.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.lvchTable}); this.lvTable.FullRowSelect = true; this.lvTable.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - this.lvTable.Location = new System.Drawing.Point(12, 439); + this.lvTable.Location = new System.Drawing.Point(12, 354); this.lvTable.Name = "lvTable"; - this.lvTable.Size = new System.Drawing.Size(326, 276); + this.lvTable.Size = new System.Drawing.Size(326, 361); this.lvTable.TabIndex = 8; this.lvTable.UseCompatibleStateImageBehavior = false; this.lvTable.View = System.Windows.Forms.View.Details; diff --git a/PanelMaterial.cs b/PanelMaterial.cs index a6e251d..8044eca 100644 --- a/PanelMaterial.cs +++ b/PanelMaterial.cs @@ -58,12 +58,12 @@ namespace friction private void lvSpring_SizeChanged(object sender, EventArgs e) { - lvSpring.Columns[0].Width = lvSpring.Width - SystemInformation.VerticalScrollBarWidth - lvSpring.Margin.Right*2; + Theme.ResizeFullColumn(lvSpring); } private void lvTable_SizeChanged(object sender, EventArgs e) { - lvTable.Columns[0].Width = lvTable.Width - SystemInformation.VerticalScrollBarWidth - lvTable.Margin.Right*2; + Theme.ResizeFullColumn(lvTable); } private void SelectSpring(int iIdx) diff --git a/PanelRadarGraph.cs b/PanelRadarGraph.cs index 50fec1a..af61814 100644 --- a/PanelRadarGraph.cs +++ b/PanelRadarGraph.cs @@ -43,7 +43,7 @@ namespace friction chart.ChartAreas[0].AxisX.MinorTickMark.Enabled = false; chart.ChartAreas[0].AxisY.MajorTickMark.Enabled = true; chart.ChartAreas[0].AxisY.MajorTickMark.LineWidth = 1; - chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = Color.FromArgb(100, 0, 0, 0); + chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = Color.FromArgb(50, 0, 0, 0); chart.ChartAreas[0].AxisY.MinorTickMark.Enabled = false; foreach (var series in chart.Series) diff --git a/PanelResult.Designer.cs b/PanelResult.Designer.cs index 0e8b089..b334873 100644 --- a/PanelResult.Designer.cs +++ b/PanelResult.Designer.cs @@ -28,8 +28,6 @@ /// private void InitializeComponent() { - System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Active Columns", System.Windows.Forms.HorizontalAlignment.Left); - System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Nonactive Columns", System.Windows.Forms.HorizontalAlignment.Left); this.dgvData = new System.Windows.Forms.DataGridView(); this.lvColumn = new System.Windows.Forms.ListView(); this.lvchColumns = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); @@ -60,13 +58,6 @@ this.lvColumn.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.lvchColumns}); this.lvColumn.FullRowSelect = true; - listViewGroup1.Header = "Active Columns"; - listViewGroup1.Name = "lvgActiveColumn"; - listViewGroup2.Header = "Nonactive Columns"; - listViewGroup2.Name = "lbgNonactiveColumn"; - this.lvColumn.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup1, - listViewGroup2}); this.lvColumn.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.lvColumn.Location = new System.Drawing.Point(722, 3); this.lvColumn.MultiSelect = false; @@ -76,6 +67,7 @@ this.lvColumn.UseCompatibleStateImageBehavior = false; this.lvColumn.View = System.Windows.Forms.View.Details; this.lvColumn.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvColumn_ItemChecked); + this.lvColumn.SizeChanged += new System.EventHandler(this.lvColumn_SizeChanged); // // lvchColumns // diff --git a/PanelResult.cs b/PanelResult.cs index 6839a82..4872e33 100644 --- a/PanelResult.cs +++ b/PanelResult.cs @@ -59,8 +59,6 @@ namespace friction CacheChecked.Add(key, bChecked); } - lvColumn.Groups[0].Items.Clear(); - lvColumn.Groups[1].Items.Clear(); lvColumn.Items.Clear(); List> Columns = new List>() { data.GetActiveColumns(), data.GetNonactiveColumns() }; @@ -76,8 +74,10 @@ namespace friction item.Checked = true; else item.Checked = false; + + item.ForeColor = (iGroup == 0) ? Theme.Forecolor : Theme.Gray; + lvColumn.Items.Add(item); - lvColumn.Groups[iGroup].Items.Add(item); } } } @@ -90,6 +90,11 @@ namespace friction dgvData.Columns[strColName].Visible = bShow; } + private void lvColumn_SizeChanged(object sender, EventArgs e) + { + Theme.ResizeFullColumn(lvColumn); + } + public void SelectRowByHumidity(string strSpring, string strTable, float fHumidity, float fRPN) { dgvData.ClearSelection(); diff --git a/PanelTrendGraph.cs b/PanelTrendGraph.cs index 7e9a153..413d08f 100644 --- a/PanelTrendGraph.cs +++ b/PanelTrendGraph.cs @@ -90,6 +90,10 @@ namespace friction trendChart.LegendLocation = LegendLocation.Right; trendChart.DataClick += TrendChart_DataClick; + + trendChart.DefaultLegend.Foreground = new SolidColorBrush( + System.Windows.Media.Color.FromArgb( + Theme.Forecolor.A, Theme.Forecolor.R, Theme.Forecolor.G, Theme.Forecolor.B)); } public void Reset() diff --git a/Theme.cs b/Theme.cs index cf3d71b..69c4a08 100644 --- a/Theme.cs +++ b/Theme.cs @@ -62,6 +62,47 @@ namespace friction e.DrawDefault = true; } + public static void ResizeFullColumn(ListView view) + { + bool bScrollbarPresented = false; + foreach (var scroll in view.Controls.OfType()) + { + bScrollbarPresented = true; + break; + } + + int iWidth = view.Width; + if (bScrollbarPresented == true) + iWidth -= SystemInformation.VerticalScrollBarWidth; + switch (view.BorderStyle) + { + case BorderStyle.Fixed3D: + iWidth -= 4; + break; + case BorderStyle.FixedSingle: + iWidth -= 2; + break; + } + + for (int i = 0; i < view.Columns.Count; i++) + { + if (view.Columns[i].Width < iWidth) + { + iWidth -= view.Columns[i].Width; + } + else + { + view.Columns[i].Width = iWidth; + // Hide columns that can't fit + for (int jx = i + 1; jx < view.Columns.Count; ++jx) + view.Columns[jx].Width = 0; + return; + } + } + + view.Columns[view.Columns.Count - 1].Width += iWidth; + } + public class MenustripColor : ProfessionalColorTable { public override Color MenuItemSelected { get { return BackColorTrans; } }