diff --git a/AntdUIDemo.csproj b/AntdUIDemo.csproj index 326b762..43eec13 100644 --- a/AntdUIDemo.csproj +++ b/AntdUIDemo.csproj @@ -13,7 +13,7 @@ Copyright © 2025 czz_y $(Version) $(Version) - 1.8.4 + 1.8.6 czz_y 基于 Winform UI 框架 AntdUI 设计的 Demo https://gitee.com/mubaiyanghua/antd-uidemo @@ -30,7 +30,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/MainWindow.Designer.cs b/MainWindow.Designer.cs index f63f11b..bbd3b0a 100644 --- a/MainWindow.Designer.cs +++ b/MainWindow.Designer.cs @@ -63,7 +63,7 @@ this.titlebar.Size = new System.Drawing.Size(1024, 40); this.titlebar.SubText = "Demo"; this.titlebar.TabIndex = 0; - this.titlebar.Text = "AntdUI 1.8.4"; + this.titlebar.Text = "AntdUI 1.8.6"; // // input_search // diff --git a/MainWindow.cs b/MainWindow.cs index 3609c0f..1cb480b 100644 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -7,6 +7,7 @@ using AntdUIDemo.Views; using AntdUIDemo.Views.SubView; using Microsoft.Win32; using System; +using System.CodeDom; using System.Linq; using System.Windows.Forms; @@ -318,6 +319,9 @@ namespace AntdUIDemo case "Panel": control = new PanelDemo(); break; + case "Splitter": + control = new SplitterDemo(); + break; case "StackPanel": control = new StackPanelDemo(); break; diff --git a/Models/DataUtil.cs b/Models/DataUtil.cs index 3692812..baf6d16 100644 --- a/Models/DataUtil.cs +++ b/Models/DataUtil.cs @@ -19,6 +19,7 @@ namespace AntdUIDemo.Models new MenuItems { Text = "FlowPanel 流动布局", Tag = "FlowPanel"}, new MenuItems { Text = "GridPanel 网格布局", Tag = "GridPanel"}, new MenuItems { Text = "Panel 面板", Tag = "Panel"}, + new MenuItems { Text = "Splitter 分隔面板", Tag = "Splitter"}, new MenuItems { Text = "StackPanel 堆叠布局", Tag = "StackPanel"} } }, diff --git a/README-en.md b/README-en.md index e65ce00..531ddf3 100644 --- a/README-en.md +++ b/README-en.md @@ -4,7 +4,7 @@

AntdUI Demo

-This project is developed based on `Winform .NET Framework 4.8`, and is a demo project of [AntdUI](https://gitee.com/antdui/AntdUI), the current version is `1.8.4` +This project is developed based on `Winform .NET Framework 4.8`, and is a demo project of [AntdUI](https://gitee.com/antdui/AntdUI), the current version is `1.8.6` @@ -57,6 +57,8 @@ English | 中文 ![GridPanel](assets/screenshots/GridPanel.png) #### Panel ![Panel](assets/screenshots/Panel.png) +#### Splitter +![Splitter](assets/screenshots/Splitter.png) #### StackPanel ![StackPanel](assets/screenshots/StackPanel.png) diff --git a/README.md b/README.md index a423fe7..dd41f41 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

AntdUI Demo

-本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.8.4` +本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.8.6` @@ -57,6 +57,8 @@ ![GridPanel](assets/screenshots/GridPanel.png) #### Panel 面板 ![Panel](assets/screenshots/Panel.png) +#### Splitter 分隔面板 +![Splitter](assets/screenshots/Splitter.png) #### StackPanel 堆叠布局 ![StackPanel](assets/screenshots/StackPanel.png) diff --git a/Views/FloatButtonDemo.Designer.cs b/Views/FloatButtonDemo.Designer.cs index f14d425..46e24f3 100644 --- a/Views/FloatButtonDemo.Designer.cs +++ b/Views/FloatButtonDemo.Designer.cs @@ -249,8 +249,13 @@ // // input_badgesize // - this.input_badgesize.DecimalPlaces = 2; + this.input_badgesize.DecimalPlaces = 1; this.input_badgesize.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F); + this.input_badgesize.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); this.input_badgesize.Location = new System.Drawing.Point(292, 3); this.input_badgesize.Minimum = new decimal(new int[] { 0, @@ -260,12 +265,12 @@ this.input_badgesize.Name = "input_badgesize"; this.input_badgesize.Size = new System.Drawing.Size(88, 26); this.input_badgesize.TabIndex = 13; - this.input_badgesize.Text = "6.00"; + this.input_badgesize.Text = "0.6"; this.input_badgesize.Value = new decimal(new int[] { 6, 0, 0, - 0}); + 65536}); this.input_badgesize.WaveSize = 0; // // label15 diff --git a/Views/FloatButtonDemo.cs b/Views/FloatButtonDemo.cs index 4f0edf6..5ab5fbf 100644 --- a/Views/FloatButtonDemo.cs +++ b/Views/FloatButtonDemo.cs @@ -88,7 +88,7 @@ namespace AntdUIDemo.Views input_gap.Value = 40; input_radius.Value = 6; input_badge.Text = ""; - input_badgesize.Value = 6; + input_badgesize.Value = 0.6m; colorPicker.Value = Color.FromArgb(22, 119, 255); } @@ -110,7 +110,7 @@ namespace AntdUIDemo.Views Round = switch_round.Checked, Type = (TTypeMini)select_type.SelectedValue, Radius = (int)input_radius.Value, - Badge = input_badge.Text, + Badge = input_badge.Text==""? null:input_badge.Text, BadgeSize = (float)input_badgesize.Value, BadgeBack = colorPicker.Value, Enabled = switch_enabled.Checked, @@ -124,7 +124,7 @@ namespace AntdUIDemo.Views Round = switch_round.Checked, Type = (TTypeMini)select_type.SelectedValue, Radius = (int)input_radius.Value, - Badge = input_badge.Text, + Badge = input_badge.Text==""? null:input_badge.Text, BadgeSize = (float)input_badgesize.Value, BadgeBack = colorPicker.Value, Enabled = switch_enabled.Checked, @@ -137,7 +137,7 @@ namespace AntdUIDemo.Views Round = switch_round.Checked, Type = (TTypeMini)select_type.SelectedValue, Radius = (int)input_radius.Value, - Badge = input_badge.Text, + Badge = input_badge.Text==""? null:input_badge.Text, BadgeSize = (float)input_badgesize.Value, BadgeBack = colorPicker.Value, Enabled = switch_enabled.Checked, diff --git a/Views/GridPanelDemo.Designer.cs b/Views/GridPanelDemo.Designer.cs index 063bd68..b769085 100644 --- a/Views/GridPanelDemo.Designer.cs +++ b/Views/GridPanelDemo.Designer.cs @@ -40,6 +40,7 @@ this.stackPanel5 = new AntdUI.StackPanel(); this.input_span = new AntdUI.Input(); this.label3 = new AntdUI.Label(); + this.label1 = new AntdUI.Label(); this.stackPanel1.SuspendLayout(); this.stackPanel2.SuspendLayout(); this.stackPanel3.SuspendLayout(); @@ -56,7 +57,7 @@ this.header1.Location = new System.Drawing.Point(0, 0); this.header1.Name = "header1"; this.header1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10); - this.header1.Size = new System.Drawing.Size(700, 74); + this.header1.Size = new System.Drawing.Size(750, 74); this.header1.TabIndex = 27; this.header1.Text = "GridPanel 网格布局"; this.header1.UseTitleFont = true; @@ -67,7 +68,7 @@ this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.stackPanel1.Location = new System.Drawing.Point(0, 74); this.stackPanel1.Name = "stackPanel1"; - this.stackPanel1.Size = new System.Drawing.Size(700, 401); + this.stackPanel1.Size = new System.Drawing.Size(750, 401); this.stackPanel1.TabIndex = 0; this.stackPanel1.Text = "stackPanel1"; this.stackPanel1.Vertical = true; @@ -78,7 +79,7 @@ this.stackPanel2.Controls.Add(this.stackPanel3); this.stackPanel2.Location = new System.Drawing.Point(3, 3); this.stackPanel2.Name = "stackPanel2"; - this.stackPanel2.Size = new System.Drawing.Size(694, 299); + this.stackPanel2.Size = new System.Drawing.Size(744, 395); this.stackPanel2.TabIndex = 9; this.stackPanel2.Text = "stackPanel2"; // @@ -86,18 +87,19 @@ // this.gridPanel.Location = new System.Drawing.Point(259, 3); this.gridPanel.Name = "gridPanel"; - this.gridPanel.Size = new System.Drawing.Size(462, 293); + this.gridPanel.Size = new System.Drawing.Size(462, 389); this.gridPanel.TabIndex = 1; this.gridPanel.Text = "gridPanel1"; // // stackPanel3 // + this.stackPanel3.Controls.Add(this.label1); this.stackPanel3.Controls.Add(this.buttonCZ); this.stackPanel3.Controls.Add(this.stackPanel4); this.stackPanel3.Controls.Add(this.stackPanel5); this.stackPanel3.Location = new System.Drawing.Point(3, 3); this.stackPanel3.Name = "stackPanel3"; - this.stackPanel3.Size = new System.Drawing.Size(250, 293); + this.stackPanel3.Size = new System.Drawing.Size(250, 389); this.stackPanel3.TabIndex = 0; this.stackPanel3.Text = "stackPanel3"; this.stackPanel3.Vertical = true; @@ -163,10 +165,9 @@ this.input_span.Location = new System.Drawing.Point(79, 3); this.input_span.Multiline = true; this.input_span.Name = "input_span"; - this.input_span.PlaceholderText = "分号隔开为行,空格隔开为列(可设置固定值或百分号)"; this.input_span.Size = new System.Drawing.Size(165, 45); this.input_span.TabIndex = 5; - this.input_span.Text = "50% 50%;20% 80%;150 200"; + this.input_span.Text = "50% 50%;20% 80%;150 200;-20% 30% 50%"; this.input_span.WaveSize = 0; // // label3 @@ -178,12 +179,21 @@ this.label3.TabIndex = 4; this.label3.Text = "Span"; // + // label1 + // + this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(3, 136); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(244, 84); + this.label1.TabIndex = 21; + this.label1.Text = "Span:以-为分解。-前为列宽属性,-后为行高属性列宽以;分组。每一组代表一行\r\n行高属性个数要与行数对应,每个数之间用空格间隔"; + // // GridPanelDemo // this.Controls.Add(this.stackPanel1); this.Controls.Add(this.header1); this.Name = "GridPanelDemo"; - this.Size = new System.Drawing.Size(700, 475); + this.Size = new System.Drawing.Size(750, 475); this.Load += new System.EventHandler(this.GridPanelDemo_Load); this.stackPanel1.ResumeLayout(false); this.stackPanel2.ResumeLayout(false); @@ -208,5 +218,6 @@ private AntdUI.InputNumber input_gap; private AntdUI.Label label4; private AntdUI.Button buttonCZ; + private AntdUI.Label label1; } } diff --git a/Views/GridPanelDemo.cs b/Views/GridPanelDemo.cs index 851fd77..d68586f 100644 --- a/Views/GridPanelDemo.cs +++ b/Views/GridPanelDemo.cs @@ -24,7 +24,7 @@ namespace AntdUIDemo.Views private void InitData() { input_gap.Value = 0; - input_span.Text = "50% 50%;20% 80%;150 200"; + input_span.Text = "50% 50%;20% 80%;150 200;-20% 30% 50%"; } private void BindEventHandler() @@ -37,15 +37,16 @@ namespace AntdUIDemo.Views private void LoadGridPanel(string spantext, decimal gap) { + gridPanel.Controls.Clear(); if (gridPanel.InvokeRequired) { gridPanel.Invoke(new Action(() => LoadGridPanel(spantext, gap))); return; } - gridPanel.Controls.Clear(); gridPanel.Span = spantext; gridPanel.Gap = (int)gap; - string[] array = spantext.Split(';', ' ', '\n'); + spantext = spantext.Substring(0, spantext.IndexOf('-')); + string[] array = spantext.Split(new char[] { ' ', ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 1; i < array.Length + 1; i++) { var control = new AntdUI.Button() diff --git a/Views/SplitterDemo.Designer.cs b/Views/SplitterDemo.Designer.cs new file mode 100644 index 0000000..711a530 --- /dev/null +++ b/Views/SplitterDemo.Designer.cs @@ -0,0 +1,117 @@ +namespace AntdUIDemo.Views +{ + partial class SplitterDemo + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.header1 = new AntdUI.PageHeader(); + this.splitter1 = new AntdUI.Splitter(); + this.button1 = new AntdUI.Button(); + this.button2 = new AntdUI.Button(); + ((System.ComponentModel.ISupportInitialize)(this.splitter1)).BeginInit(); + this.splitter1.Panel1.SuspendLayout(); + this.splitter1.Panel2.SuspendLayout(); + this.splitter1.SuspendLayout(); + this.SuspendLayout(); + // + // header1 + // + this.header1.Description = "自由切分指定区域。"; + this.header1.DividerShow = true; + this.header1.Dock = System.Windows.Forms.DockStyle.Top; + this.header1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F); + this.header1.Location = new System.Drawing.Point(0, 0); + this.header1.Name = "header1"; + this.header1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10); + this.header1.Size = new System.Drawing.Size(750, 74); + this.header1.TabIndex = 28; + this.header1.Text = "Splitter 分隔面板"; + this.header1.UseTitleFont = true; + // + // splitter1 + // + this.splitter1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitter1.Location = new System.Drawing.Point(0, 74); + this.splitter1.Name = "splitter1"; + // + // splitter1.Panel1 + // + this.splitter1.Panel1.Controls.Add(this.button1); + // + // splitter1.Panel2 + // + this.splitter1.Panel2.Controls.Add(this.button2); + this.splitter1.Size = new System.Drawing.Size(750, 457); + this.splitter1.SplitterDistance = 264; + this.splitter1.SplitterSize = 30; + this.splitter1.TabIndex = 31; + // + // button1 + // + this.button1.Dock = System.Windows.Forms.DockStyle.Top; + this.button1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button1.Location = new System.Drawing.Point(0, 0); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(264, 45); + this.button1.TabIndex = 0; + this.button1.Text = "Button"; + this.button1.Type = AntdUI.TTypeMini.Primary; + // + // button2 + // + this.button2.Dock = System.Windows.Forms.DockStyle.Top; + this.button2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button2.Location = new System.Drawing.Point(0, 0); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(482, 45); + this.button2.TabIndex = 1; + this.button2.Text = "Button"; + this.button2.Type = AntdUI.TTypeMini.Warn; + // + // SplitterDemo + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.Controls.Add(this.splitter1); + this.Controls.Add(this.header1); + this.Name = "SplitterDemo"; + this.Size = new System.Drawing.Size(750, 531); + this.splitter1.Panel1.ResumeLayout(false); + this.splitter1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitter1)).EndInit(); + this.splitter1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private AntdUI.PageHeader header1; + private AntdUI.Splitter splitter1; + private AntdUI.Button button1; + private AntdUI.Button button2; + } +} diff --git a/Views/SplitterDemo.cs b/Views/SplitterDemo.cs new file mode 100644 index 0000000..35861db --- /dev/null +++ b/Views/SplitterDemo.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AntdUIDemo.Views +{ + public partial class SplitterDemo : UserControl + { + public SplitterDemo() + { + InitializeComponent(); + } + } +} diff --git a/Views/SplitterDemo.resx b/Views/SplitterDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Views/SplitterDemo.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/assets/screenshots/FloatButton-en.png b/assets/screenshots/FloatButton-en.png index dc48115..0fcd79e 100644 Binary files a/assets/screenshots/FloatButton-en.png and b/assets/screenshots/FloatButton-en.png differ diff --git a/assets/screenshots/FloatButton.png b/assets/screenshots/FloatButton.png index 99b3134..9b3b304 100644 Binary files a/assets/screenshots/FloatButton.png and b/assets/screenshots/FloatButton.png differ diff --git a/assets/screenshots/GridPanel.png b/assets/screenshots/GridPanel.png index 0358417..a1c94d5 100644 Binary files a/assets/screenshots/GridPanel.png and b/assets/screenshots/GridPanel.png differ diff --git a/assets/screenshots/Splitter.png b/assets/screenshots/Splitter.png new file mode 100644 index 0000000..701ab7c Binary files /dev/null and b/assets/screenshots/Splitter.png differ