diff --git a/Bin/SunnyUI.Demo.exe b/Bin/SunnyUI.Demo.exe index 3e077a15..fb71eb7a 100644 Binary files a/Bin/SunnyUI.Demo.exe and b/Bin/SunnyUI.Demo.exe differ diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index dd7a2a0d..9c4b3f4e 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FButton.resx b/SunnyUI.Demo/Controls/FButton.resx index 3ea6cbca..eaa39c0c 100644 --- a/SunnyUI.Demo/Controls/FButton.resx +++ b/SunnyUI.Demo/Controls/FButton.resx @@ -120,6 +120,9 @@ 17, 17 + + 17, 17 + 52 diff --git a/SunnyUI.Demo/Controls/FTabControl.Designer.cs b/SunnyUI.Demo/Controls/FTabControl.Designer.cs index 834ba701..497fb15c 100644 --- a/SunnyUI.Demo/Controls/FTabControl.Designer.cs +++ b/SunnyUI.Demo/Controls/FTabControl.Designer.cs @@ -72,6 +72,7 @@ this.uiTabControl1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiTabControl1.ItemSize = new System.Drawing.Size(150, 40); this.uiTabControl1.Location = new System.Drawing.Point(30, 52); + this.uiTabControl1.MainPage = "tabPage1"; this.uiTabControl1.MenuStyle = Sunny.UI.UIMenuStyle.Custom; this.uiTabControl1.Name = "uiTabControl1"; this.uiTabControl1.SelectedIndex = 0; diff --git a/SunnyUI/Charts/UILineChart.cs b/SunnyUI/Charts/UILineChart.cs index f384478c..021751df 100644 --- a/SunnyUI/Charts/UILineChart.cs +++ b/SunnyUI/Charts/UILineChart.cs @@ -33,7 +33,7 @@ namespace Sunny.UI [ToolboxItem(true)] public class UILineChart : UIChart { - private bool NeedDraw; + protected bool NeedDraw; protected override void OnSizeChanged(EventArgs e) { @@ -72,7 +72,7 @@ namespace Sunny.UI private double[] YLabels; private double[] XLabels; - private void CalcAxises() + protected void CalcAxises() { if (Option.XAxisType == UIAxisType.DateTime) XScale = new UIDateScale(); @@ -257,7 +257,7 @@ namespace Sunny.UI } } - private void DrawSeries(Graphics g, Color color, UILineSeries series) + protected virtual void DrawSeries(Graphics g, Color color, UILineSeries series) { if (series.Points.Count == 0) { diff --git a/SunnyUI/Controls/UITabControl.cs b/SunnyUI/Controls/UITabControl.cs index 6904f8eb..eeed11ff 100644 --- a/SunnyUI/Controls/UITabControl.cs +++ b/SunnyUI/Controls/UITabControl.cs @@ -59,6 +59,20 @@ namespace Sunny.UI timer.Dispose(); } + private string mainPage = ""; + + [DefaultValue(true)] + [Description("主页名称,此页面不显示关闭按钮"), Category("SunnyUI")] + public string MainPage + { + get => mainPage; + set + { + mainPage = value; + Invalidate(); + } + } + private void Timer_Tick(object sender, EventArgs e) { timer.Stop(); @@ -432,7 +446,9 @@ namespace Sunny.UI g.DrawString(TabPages[index].Text, Font, index == SelectedIndex ? tabSelectedForeColor : TabUnSelectedForeColor, textLeft, TabRect.Top + 2 + (TabRect.Height - sf.Height - 4) / 2.0f); var menuItem = Helper[index]; - bool showButton = menuItem == null || !menuItem.AlwaysOpen; + bool show1 = TabPages[index].Text != MainPage; + bool show2 = menuItem == null || !menuItem.AlwaysOpen; + bool showButton = show1 && show2; if (showButton) { @@ -484,7 +500,9 @@ namespace Sunny.UI } var menuItem = Helper[removeIndex]; - bool showButton = menuItem == null || !menuItem.AlwaysOpen; + bool show1 = TabPages[removeIndex].Text != MainPage; + bool show2 = menuItem == null || !menuItem.AlwaysOpen; + bool showButton = show1 && show2; if (showButton) { if (ShowCloseButton) diff --git a/SunnyUI/Controls/UITreeView.cs b/SunnyUI/Controls/UITreeView.cs index 15bbdfc2..f809579b 100644 --- a/SunnyUI/Controls/UITreeView.cs +++ b/SunnyUI/Controls/UITreeView.cs @@ -685,7 +685,7 @@ namespace Sunny.UI if (haveImage) { - if (TreeNodeSelected(e) && e.Node.SelectedImageIndex >= 0 && + if (e.Node == SelectedNode && e.Node.SelectedImageIndex >= 0 && e.Node.SelectedImageIndex < ImageList.Images.Count) e.Graphics.DrawImage(ImageList.Images[e.Node.SelectedImageIndex], imageLeft, e.Bounds.Y + (e.Bounds.Height - ImageList.ImageSize.Height) / 2);