diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index e00bb69d..efb35468 100644 Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index ef92ad63..0f099fab 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/SunnyUI/Charts/UILineChart.cs b/SunnyUI/Charts/UILineChart.cs index 0235d7e7..322f36ea 100644 --- a/SunnyUI/Charts/UILineChart.cs +++ b/SunnyUI/Charts/UILineChart.cs @@ -737,7 +737,7 @@ namespace Sunny.UI } } - private bool IsZoom; + public bool IsZoom { get; private set; } private readonly List ZoomAreas = new List(); private ZoomArea BaseArea; diff --git a/SunnyUI/Forms/UIForm.cs b/SunnyUI/Forms/UIForm.cs index 2bf89cb6..73031d80 100644 --- a/SunnyUI/Forms/UIForm.cs +++ b/SunnyUI/Forms/UIForm.cs @@ -26,6 +26,7 @@ * 2021-05-06: V3.0.3 增加属性,标题栏可放置控件 * 2021-08-17: V3.0.6 增加TitleFont属性 * 2021-08-17: V3.0.6 适应主屏幕任务栏在屏幕各个方向均可 + * 2021-08-17: V3.0.8 增加IFrame接口 ******************************************************************************/ using System; @@ -38,7 +39,7 @@ using System.Windows.Forms; namespace Sunny.UI { - public partial class UIForm : Form, IStyleInterface, ITranslate + public partial class UIForm : Form, IStyleInterface, ITranslate, IFrame { private readonly UIButton btn = new UIButton(); @@ -533,7 +534,7 @@ namespace Sunny.UI { rectColor = value; AfterSetRectColor(value); - RectColorChanged?.Invoke(this, null); + RectColorChanged?.Invoke(this, EventArgs.Empty); _style = UIStyle.Custom; Invalidate(); } @@ -570,7 +571,7 @@ namespace Sunny.UI } else { - ExtendBoxClick?.Invoke(this, null); + ExtendBoxClick?.Invoke(this, EventArgs.Empty); } } } @@ -1800,5 +1801,55 @@ namespace Sunny.UI } #endregion + + #region IFrame实现 + + public UITabControl MainTabControl { get; set; } + + public UIPage AddPage(UIPage page, int index) + { + page.PageIndex = index; + return AddPage(page); + } + + public UIPage AddPage(UIPage page, Guid guid) + { + page.PageGuid = guid; + return AddPage(page); + } + + public UIPage AddPage(UIPage page) + { + page.Frame = this; + MainTabControl?.AddPage(page); + return page; + } + + public virtual void SelectPage(int pageIndex) + { + MainTabControl?.SelectPage(pageIndex); + } + + public virtual void SelectPage(Guid guid) + { + MainTabControl?.SelectPage(guid); + } + + public bool RemovePage(int pageIndex) + { + return MainTabControl?.RemovePage(pageIndex) ?? false; + } + + public bool RemovePage(Guid guid) + { + return MainTabControl?.RemovePage(guid) ?? false; + } + + public virtual void Feedback(object sender, int pageIndex, params object[] objects) + { + + } + + #endregion IFrame实现 } } \ No newline at end of file diff --git a/SunnyUI/Frames/UIMainFrame.Designer.cs b/SunnyUI/Frames/UIMainFrame.Designer.cs index 41650b78..6d1834ae 100644 --- a/SunnyUI/Frames/UIMainFrame.Designer.cs +++ b/SunnyUI/Frames/UIMainFrame.Designer.cs @@ -40,14 +40,16 @@ this.MainContainer.Controls.Add(this.tabPage2); this.MainContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.MainContainer.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; - this.MainContainer.Font = new System.Drawing.Font("微软雅黑", 12F); + this.MainContainer.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.MainContainer.ItemSize = new System.Drawing.Size(150, 40); this.MainContainer.Location = new System.Drawing.Point(0, 35); + this.MainContainer.MainPage = ""; this.MainContainer.Name = "MainContainer"; this.MainContainer.SelectedIndex = 0; this.MainContainer.Size = new System.Drawing.Size(800, 415); this.MainContainer.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.MainContainer.TabIndex = 0; + this.MainContainer.TabUnSelectedForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240))))); this.MainContainer.Selecting += new System.Windows.Forms.TabControlCancelEventHandler(this.MainContainer_Selecting); // // tabPage1 @@ -64,7 +66,7 @@ this.tabPage2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); this.tabPage2.Location = new System.Drawing.Point(0, 40); this.tabPage2.Name = "tabPage2"; - this.tabPage2.Size = new System.Drawing.Size(450, 230); + this.tabPage2.Size = new System.Drawing.Size(200, 60); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "tabPage2"; // @@ -73,6 +75,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.ClientSize = new System.Drawing.Size(800, 450); this.Controls.Add(this.MainContainer); + this.MainTabControl = this.MainContainer; this.Name = "UIMainFrame"; this.Text = "UIMainFrame"; this.MainContainer.ResumeLayout(false); diff --git a/SunnyUI/Frames/UIMainFrame.cs b/SunnyUI/Frames/UIMainFrame.cs index 91c9a536..c8de52b8 100644 --- a/SunnyUI/Frames/UIMainFrame.cs +++ b/SunnyUI/Frames/UIMainFrame.cs @@ -17,6 +17,7 @@ * 创建日期: 2020-05-05 * * 2020-05-05: V2.2.5 页面框架基类 + * 2021-08-17: V3.0.8 删除IFrame接口,移到父类UIForm ******************************************************************************/ using System; @@ -26,7 +27,7 @@ using System.Windows.Forms; namespace Sunny.UI { - public partial class UIMainFrame : UIForm, IFrame + public partial class UIMainFrame : UIForm { public UIMainFrame() { @@ -99,56 +100,5 @@ namespace Sunny.UI [Description("页面选择事件"), Category("SunnyUI")] public event OnSelecting Selecting; - - #region IFrame实现 - - [Browsable(false)] - public UITabControl MainTabControl => MainContainer; - - public UIPage AddPage(UIPage page, int index) - { - page.PageIndex = index; - return AddPage(page); - } - - public UIPage AddPage(UIPage page, Guid guid) - { - page.PageGuid = guid; - return AddPage(page); - } - - public UIPage AddPage(UIPage page) - { - page.Frame = this; - MainTabControl.AddPage(page); - return page; - } - - public virtual void SelectPage(int pageIndex) - { - MainTabControl.SelectPage(pageIndex); - } - - public virtual void SelectPage(Guid guid) - { - MainTabControl.SelectPage(guid); - } - - public bool RemovePage(int pageIndex) - { - return MainTabControl.RemovePage(pageIndex); - } - - public bool RemovePage(Guid guid) - { - return MainTabControl.RemovePage(guid); - } - - public virtual void Feedback(object sender, int pageIndex, params object[] objects) - { - - } - - #endregion IFrame实现 } } \ No newline at end of file diff --git a/SunnyUI/Frames/UIMainFrame.resx b/SunnyUI/Frames/UIMainFrame.resx index 1af7de15..f298a7be 100644 --- a/SunnyUI/Frames/UIMainFrame.resx +++ b/SunnyUI/Frames/UIMainFrame.resx @@ -1,64 +1,4 @@ - - - +