diff --git a/MainWindow.cs b/MainWindow.cs index 0b5b448..f49ff2c 100644 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -110,7 +110,6 @@ namespace AntdUIDemo { using (var form = new SystemSet(this)) { - //AutoDpi(form); AntdUI.Modal.open(new AntdUI.Modal.Config(this, "系统设置", form, TType.Info) { CloseIcon = true, @@ -286,6 +285,21 @@ namespace AntdUIDemo case "Progress": control = new ProgressDemo(); break; + case "Spin": + control = new SpinDemo(this); + break; + case "ChatList": + control = new ChatListDemo(); + break; + case "MsgList": + control = new MsgListDemo(); + break; + case "Battery": + control = new BatteryDemo(); + break; + case "ContextMenuStrip": + control = new ContextMenuStripDemo(this); + break; default: break; } diff --git a/Models/DataUtil.cs b/Models/DataUtil.cs index e5859c8..7c88c70 100644 --- a/Models/DataUtil.cs +++ b/Models/DataUtil.cs @@ -18,6 +18,7 @@ namespace AntdUIDemo.Models }, { "布局", new List { + new MenuItems { Text = "Divider 分割线", Tag = "Divider" }, new MenuItems { Text = "FlowPanel 流动布局", Tag = "FlowPanel"}, new MenuItems { Text = "GridPanel 网格布局", Tag = "GridPanel"}, new MenuItems { Text = "Panel 面板", Tag = "Panel"}, @@ -89,7 +90,6 @@ namespace AntdUIDemo.Models { new MenuItems { Text = "Battery 电池", Tag = "Battery" }, new MenuItems { Text = "ContextMenuStrip 右键菜单", Tag = "ContextMenuStrip" }, - new MenuItems { Text = "Divider 分割线", Tag = "Divider" }, new MenuItems { Text = "Image3D 图片3D", Tag = "Image3D" }, new MenuItems { Text = "WindowBar 窗口栏", Tag = "WindowBar" } } diff --git a/Views/BatteryDemo.Designer.cs b/Views/BatteryDemo.Designer.cs new file mode 100644 index 0000000..65e625c --- /dev/null +++ b/Views/BatteryDemo.Designer.cs @@ -0,0 +1,488 @@ +namespace AntdUIDemo.Views +{ + partial class BatteryDemo + { + /// + /// 必需的设计器变量。 + /// + 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.stackPanel1 = new AntdUI.StackPanel(); + this.divider1 = new AntdUI.Divider(); + this.label2 = new AntdUI.Label(); + this.label1 = new AntdUI.Label(); + this.flowPanel = new AntdUI.FlowPanel(); + this.label4 = new AntdUI.Label(); + this.battery5 = new AntdUI.Battery(); + this.battery6 = new AntdUI.Battery(); + this.battery4 = new AntdUI.Battery(); + this.battery2 = new AntdUI.Battery(); + this.battery1 = new AntdUI.Battery(); + this.label3 = new AntdUI.Label(); + this.flowPanel1 = new AntdUI.FlowPanel(); + this.battery3 = new AntdUI.Battery(); + this.battery7 = new AntdUI.Battery(); + this.battery8 = new AntdUI.Battery(); + this.battery9 = new AntdUI.Battery(); + this.battery10 = new AntdUI.Battery(); + this.label6 = new AntdUI.Label(); + this.flowPanel3 = new AntdUI.FlowPanel(); + this.battery16 = new AntdUI.Battery(); + this.battery17 = new AntdUI.Battery(); + this.battery18 = new AntdUI.Battery(); + this.battery19 = new AntdUI.Battery(); + this.battery20 = new AntdUI.Battery(); + this.flowPanel2 = new AntdUI.FlowPanel(); + this.battery14 = new AntdUI.Battery(); + this.battery13 = new AntdUI.Battery(); + this.battery12 = new AntdUI.Battery(); + this.battery11 = new AntdUI.Battery(); + this.battery15 = new AntdUI.Battery(); + this.label5 = new AntdUI.Label(); + this.stackPanel1.SuspendLayout(); + this.flowPanel.SuspendLayout(); + this.flowPanel1.SuspendLayout(); + this.flowPanel3.SuspendLayout(); + this.flowPanel2.SuspendLayout(); + this.SuspendLayout(); + // + // stackPanel1 + // + this.stackPanel1.Controls.Add(this.flowPanel2); + this.stackPanel1.Controls.Add(this.label5); + this.stackPanel1.Controls.Add(this.flowPanel3); + this.stackPanel1.Controls.Add(this.label6); + this.stackPanel1.Controls.Add(this.flowPanel1); + this.stackPanel1.Controls.Add(this.label3); + this.stackPanel1.Controls.Add(this.flowPanel); + this.stackPanel1.Controls.Add(this.label4); + this.stackPanel1.Controls.Add(this.divider1); + this.stackPanel1.Controls.Add(this.label2); + this.stackPanel1.Controls.Add(this.label1); + this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.stackPanel1.Location = new System.Drawing.Point(0, 0); + this.stackPanel1.Name = "stackPanel1"; + this.stackPanel1.Size = new System.Drawing.Size(700, 481); + this.stackPanel1.TabIndex = 0; + this.stackPanel1.Text = "stackPanel1"; + this.stackPanel1.Vertical = true; + // + // divider1 + // + this.divider1.Location = new System.Drawing.Point(3, 79); + this.divider1.Name = "divider1"; + this.divider1.Size = new System.Drawing.Size(694, 12); + this.divider1.TabIndex = 34; + // + // label2 + // + this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(3, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(694, 24); + this.label2.TabIndex = 33; + this.label2.Text = "电量显示"; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(3, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(694, 40); + this.label1.TabIndex = 32; + this.label1.Text = "Battery 电池"; + // + // flowPanel + // + this.flowPanel.Controls.Add(this.battery1); + this.flowPanel.Controls.Add(this.battery2); + this.flowPanel.Controls.Add(this.battery4); + this.flowPanel.Controls.Add(this.battery6); + this.flowPanel.Controls.Add(this.battery5); + this.flowPanel.Location = new System.Drawing.Point(3, 127); + this.flowPanel.Name = "flowPanel"; + this.flowPanel.Size = new System.Drawing.Size(694, 38); + this.flowPanel.TabIndex = 52; + this.flowPanel.Text = "flowPanel1"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(3, 97); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(694, 24); + this.label4.TabIndex = 51; + this.label4.Text = "基本用法"; + // + // battery5 + // + this.battery5.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery5.Location = new System.Drawing.Point(3, 3); + this.battery5.Name = "battery5"; + this.battery5.Size = new System.Drawing.Size(60, 32); + this.battery5.TabIndex = 6; + this.battery5.Text = "battery5"; + this.battery5.Value = 10; + // + // battery6 + // + this.battery6.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery6.Location = new System.Drawing.Point(69, 3); + this.battery6.Name = "battery6"; + this.battery6.Size = new System.Drawing.Size(60, 32); + this.battery6.TabIndex = 7; + this.battery6.Text = "battery6"; + this.battery6.Value = 30; + // + // battery4 + // + this.battery4.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery4.Location = new System.Drawing.Point(135, 3); + this.battery4.Name = "battery4"; + this.battery4.Size = new System.Drawing.Size(60, 32); + this.battery4.TabIndex = 8; + this.battery4.Text = "battery4"; + this.battery4.Value = 50; + // + // battery2 + // + this.battery2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery2.Location = new System.Drawing.Point(201, 3); + this.battery2.Name = "battery2"; + this.battery2.Size = new System.Drawing.Size(60, 32); + this.battery2.TabIndex = 9; + this.battery2.Text = "battery2"; + this.battery2.Value = 70; + // + // battery1 + // + this.battery1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery1.Location = new System.Drawing.Point(267, 3); + this.battery1.Name = "battery1"; + this.battery1.Size = new System.Drawing.Size(60, 32); + this.battery1.TabIndex = 10; + this.battery1.Text = "battery1"; + this.battery1.Value = 100; + // + // label3 + // + this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label3.Location = new System.Drawing.Point(3, 171); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(694, 24); + this.label3.TabIndex = 54; + this.label3.Text = "无文字"; + // + // flowPanel1 + // + this.flowPanel1.Controls.Add(this.battery3); + this.flowPanel1.Controls.Add(this.battery7); + this.flowPanel1.Controls.Add(this.battery8); + this.flowPanel1.Controls.Add(this.battery9); + this.flowPanel1.Controls.Add(this.battery10); + this.flowPanel1.Location = new System.Drawing.Point(3, 201); + this.flowPanel1.Name = "flowPanel1"; + this.flowPanel1.Size = new System.Drawing.Size(694, 38); + this.flowPanel1.TabIndex = 55; + this.flowPanel1.Text = "flowPanel1"; + // + // battery3 + // + this.battery3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery3.Location = new System.Drawing.Point(267, 3); + this.battery3.Name = "battery3"; + this.battery3.ShowText = false; + this.battery3.Size = new System.Drawing.Size(60, 32); + this.battery3.TabIndex = 10; + this.battery3.Text = "battery3"; + this.battery3.Value = 100; + // + // battery7 + // + this.battery7.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery7.Location = new System.Drawing.Point(201, 3); + this.battery7.Name = "battery7"; + this.battery7.ShowText = false; + this.battery7.Size = new System.Drawing.Size(60, 32); + this.battery7.TabIndex = 9; + this.battery7.Text = "battery7"; + this.battery7.Value = 70; + // + // battery8 + // + this.battery8.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery8.Location = new System.Drawing.Point(135, 3); + this.battery8.Name = "battery8"; + this.battery8.ShowText = false; + this.battery8.Size = new System.Drawing.Size(60, 32); + this.battery8.TabIndex = 8; + this.battery8.Text = "battery8"; + this.battery8.Value = 50; + // + // battery9 + // + this.battery9.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery9.Location = new System.Drawing.Point(69, 3); + this.battery9.Name = "battery9"; + this.battery9.ShowText = false; + this.battery9.Size = new System.Drawing.Size(60, 32); + this.battery9.TabIndex = 7; + this.battery9.Text = "battery9"; + this.battery9.Value = 30; + // + // battery10 + // + this.battery10.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery10.Location = new System.Drawing.Point(3, 3); + this.battery10.Name = "battery10"; + this.battery10.ShowText = false; + this.battery10.Size = new System.Drawing.Size(60, 32); + this.battery10.TabIndex = 6; + this.battery10.Text = "battery10"; + this.battery10.Value = 10; + // + // label6 + // + this.label6.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label6.Location = new System.Drawing.Point(3, 245); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(694, 24); + this.label6.TabIndex = 58; + this.label6.Text = "点形状"; + // + // flowPanel3 + // + this.flowPanel3.Controls.Add(this.battery16); + this.flowPanel3.Controls.Add(this.battery17); + this.flowPanel3.Controls.Add(this.battery18); + this.flowPanel3.Controls.Add(this.battery19); + this.flowPanel3.Controls.Add(this.battery20); + this.flowPanel3.Location = new System.Drawing.Point(3, 275); + this.flowPanel3.Name = "flowPanel3"; + this.flowPanel3.Size = new System.Drawing.Size(694, 38); + this.flowPanel3.TabIndex = 59; + this.flowPanel3.Text = "flowPanel3"; + // + // battery16 + // + this.battery16.DotSize = 10; + this.battery16.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery16.Location = new System.Drawing.Point(267, 3); + this.battery16.Name = "battery16"; + this.battery16.ShowText = false; + this.battery16.Size = new System.Drawing.Size(60, 32); + this.battery16.TabIndex = 10; + this.battery16.Text = "battery16"; + this.battery16.Value = 100; + // + // battery17 + // + this.battery17.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery17.Location = new System.Drawing.Point(201, 3); + this.battery17.Name = "battery17"; + this.battery17.ShowText = false; + this.battery17.Size = new System.Drawing.Size(60, 32); + this.battery17.TabIndex = 9; + this.battery17.Text = "battery17"; + this.battery17.Value = 100; + // + // battery18 + // + this.battery18.DotSize = 6; + this.battery18.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery18.Location = new System.Drawing.Point(135, 3); + this.battery18.Name = "battery18"; + this.battery18.ShowText = false; + this.battery18.Size = new System.Drawing.Size(60, 32); + this.battery18.TabIndex = 8; + this.battery18.Text = "battery18"; + this.battery18.Value = 100; + // + // battery19 + // + this.battery19.DotSize = 4; + this.battery19.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery19.Location = new System.Drawing.Point(69, 3); + this.battery19.Name = "battery19"; + this.battery19.ShowText = false; + this.battery19.Size = new System.Drawing.Size(60, 32); + this.battery19.TabIndex = 7; + this.battery19.Text = "battery19"; + this.battery19.Value = 100; + // + // battery20 + // + this.battery20.DotSize = 0; + this.battery20.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery20.Location = new System.Drawing.Point(3, 3); + this.battery20.Name = "battery20"; + this.battery20.ShowText = false; + this.battery20.Size = new System.Drawing.Size(60, 32); + this.battery20.TabIndex = 6; + this.battery20.Text = "battery20"; + this.battery20.Value = 100; + // + // flowPanel2 + // + this.flowPanel2.Controls.Add(this.battery14); + this.flowPanel2.Controls.Add(this.battery13); + this.flowPanel2.Controls.Add(this.battery12); + this.flowPanel2.Controls.Add(this.battery11); + this.flowPanel2.Controls.Add(this.battery15); + this.flowPanel2.Location = new System.Drawing.Point(3, 349); + this.flowPanel2.Name = "flowPanel2"; + this.flowPanel2.Size = new System.Drawing.Size(694, 38); + this.flowPanel2.TabIndex = 61; + this.flowPanel2.Text = "flowPanel2"; + // + // battery14 + // + this.battery14.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121))))); + this.battery14.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79))))); + this.battery14.FillWarn = System.Drawing.Color.Fuchsia; + this.battery14.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery14.Location = new System.Drawing.Point(267, 3); + this.battery14.Name = "battery14"; + this.battery14.ShowText = false; + this.battery14.Size = new System.Drawing.Size(60, 32); + this.battery14.TabIndex = 10; + this.battery14.Text = "battery14"; + this.battery14.Value = 100; + // + // battery13 + // + this.battery13.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121))))); + this.battery13.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79))))); + this.battery13.FillWarn = System.Drawing.Color.Fuchsia; + this.battery13.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery13.Location = new System.Drawing.Point(201, 3); + this.battery13.Name = "battery13"; + this.battery13.ShowText = false; + this.battery13.Size = new System.Drawing.Size(60, 32); + this.battery13.TabIndex = 9; + this.battery13.Text = "battery13"; + this.battery13.Value = 70; + // + // battery12 + // + this.battery12.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121))))); + this.battery12.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79))))); + this.battery12.FillWarn = System.Drawing.Color.Fuchsia; + this.battery12.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery12.Location = new System.Drawing.Point(135, 3); + this.battery12.Name = "battery12"; + this.battery12.ShowText = false; + this.battery12.Size = new System.Drawing.Size(60, 32); + this.battery12.TabIndex = 8; + this.battery12.Text = "battery12"; + this.battery12.Value = 50; + // + // battery11 + // + this.battery11.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121))))); + this.battery11.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79))))); + this.battery11.FillWarn = System.Drawing.Color.Fuchsia; + this.battery11.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery11.Location = new System.Drawing.Point(69, 3); + this.battery11.Name = "battery11"; + this.battery11.ShowText = false; + this.battery11.Size = new System.Drawing.Size(60, 32); + this.battery11.TabIndex = 7; + this.battery11.Text = "battery11"; + this.battery11.Value = 30; + // + // battery15 + // + this.battery15.FillDanger = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(210)))), ((int)(((byte)(121))))); + this.battery15.FillFully = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(77)))), ((int)(((byte)(79))))); + this.battery15.FillWarn = System.Drawing.Color.Fuchsia; + this.battery15.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.battery15.Location = new System.Drawing.Point(3, 3); + this.battery15.Name = "battery15"; + this.battery15.ShowText = false; + this.battery15.Size = new System.Drawing.Size(60, 32); + this.battery15.TabIndex = 6; + this.battery15.Text = "battery15"; + this.battery15.Value = 10; + // + // label5 + // + this.label5.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label5.Location = new System.Drawing.Point(3, 319); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(694, 24); + this.label5.TabIndex = 60; + this.label5.Text = "自定义颜色"; + // + // BatteryDemo + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.Controls.Add(this.stackPanel1); + this.Name = "BatteryDemo"; + this.Size = new System.Drawing.Size(700, 481); + this.stackPanel1.ResumeLayout(false); + this.flowPanel.ResumeLayout(false); + this.flowPanel1.ResumeLayout(false); + this.flowPanel3.ResumeLayout(false); + this.flowPanel2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private AntdUI.StackPanel stackPanel1; + private AntdUI.Divider divider1; + private AntdUI.Label label2; + private AntdUI.Label label1; + private AntdUI.FlowPanel flowPanel; + private AntdUI.Label label4; + private AntdUI.Battery battery5; + private AntdUI.Battery battery1; + private AntdUI.Battery battery2; + private AntdUI.Battery battery4; + private AntdUI.Battery battery6; + private AntdUI.FlowPanel flowPanel1; + private AntdUI.Battery battery3; + private AntdUI.Battery battery7; + private AntdUI.Battery battery8; + private AntdUI.Battery battery9; + private AntdUI.Battery battery10; + private AntdUI.Label label3; + private AntdUI.FlowPanel flowPanel2; + private AntdUI.Battery battery14; + private AntdUI.Battery battery13; + private AntdUI.Battery battery12; + private AntdUI.Battery battery11; + private AntdUI.Battery battery15; + private AntdUI.Label label5; + private AntdUI.FlowPanel flowPanel3; + private AntdUI.Battery battery16; + private AntdUI.Battery battery17; + private AntdUI.Battery battery18; + private AntdUI.Battery battery19; + private AntdUI.Battery battery20; + private AntdUI.Label label6; + } +} diff --git a/Views/BatteryDemo.cs b/Views/BatteryDemo.cs new file mode 100644 index 0000000..116efa4 --- /dev/null +++ b/Views/BatteryDemo.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 BatteryDemo : UserControl + { + public BatteryDemo() + { + InitializeComponent(); + } + } +} diff --git a/Views/BatteryDemo.resx b/Views/BatteryDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Views/BatteryDemo.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/Views/ChatListDemo.Designer.cs b/Views/ChatListDemo.Designer.cs new file mode 100644 index 0000000..0f0c8c0 --- /dev/null +++ b/Views/ChatListDemo.Designer.cs @@ -0,0 +1,120 @@ +namespace AntdUIDemo.Views +{ + partial class ChatListDemo + { + /// + /// 必需的设计器变量。 + /// + 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.stackPanel1 = new AntdUI.StackPanel(); + this.panel1 = new AntdUI.Panel(); + this.chatList = new AntdUI.Chat.ChatList(); + this.divider1 = new AntdUI.Divider(); + this.label2 = new AntdUI.Label(); + this.label1 = new AntdUI.Label(); + this.stackPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // stackPanel1 + // + this.stackPanel1.Controls.Add(this.panel1); + this.stackPanel1.Controls.Add(this.divider1); + this.stackPanel1.Controls.Add(this.label2); + this.stackPanel1.Controls.Add(this.label1); + this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.stackPanel1.Location = new System.Drawing.Point(0, 0); + this.stackPanel1.Name = "stackPanel1"; + this.stackPanel1.Size = new System.Drawing.Size(700, 557); + this.stackPanel1.TabIndex = 0; + this.stackPanel1.Text = "stackPanel1"; + this.stackPanel1.Vertical = true; + // + // panel1 + // + this.panel1.Controls.Add(this.chatList); + this.panel1.Location = new System.Drawing.Point(3, 97); + this.panel1.Name = "panel1"; + this.panel1.Shadow = 12; + this.panel1.Size = new System.Drawing.Size(694, 457); + this.panel1.TabIndex = 32; + this.panel1.Text = "panel1"; + // + // chatList + // + this.chatList.Dock = System.Windows.Forms.DockStyle.Fill; + this.chatList.Location = new System.Drawing.Point(12, 12); + this.chatList.Name = "chatList"; + this.chatList.Size = new System.Drawing.Size(670, 433); + this.chatList.TabIndex = 0; + this.chatList.Text = "chatList1"; + // + // divider1 + // + this.divider1.Location = new System.Drawing.Point(3, 79); + this.divider1.Name = "divider1"; + this.divider1.Size = new System.Drawing.Size(694, 12); + this.divider1.TabIndex = 31; + // + // label2 + // + this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(3, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(694, 24); + this.label2.TabIndex = 30; + this.label2.Text = "气泡聊天列表。"; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(3, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(694, 40); + this.label1.TabIndex = 29; + this.label1.Text = "ChatList 气泡聊天列表"; + // + // ChatListDemo + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.Controls.Add(this.stackPanel1); + this.Name = "ChatListDemo"; + this.Size = new System.Drawing.Size(700, 557); + this.stackPanel1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private AntdUI.StackPanel stackPanel1; + private AntdUI.Divider divider1; + private AntdUI.Label label2; + private AntdUI.Label label1; + private AntdUI.Panel panel1; + private AntdUI.Chat.ChatList chatList; + } +} diff --git a/Views/ChatListDemo.cs b/Views/ChatListDemo.cs new file mode 100644 index 0000000..f254f2c --- /dev/null +++ b/Views/ChatListDemo.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AntdUIDemo.Views +{ + public partial class ChatListDemo : UserControl + { + public ChatListDemo() + { + InitializeComponent(); + // 绑定事件 + BindEventHandler(); + } + + private void BindEventHandler() + { + this.Load += ChatListDemo_Load; + } + + private void ChatListDemo_Load(object sender, EventArgs e) + { + Task.Run(() => + { + chatList.AddToBottom(new AntdUI.Chat.TextChatItem("阿威十八式 🙌🖖🤘👋", Properties.Resources.head, "AduSkin")); + Thread.Sleep(700); + + chatList.AddToBottom(new AntdUI.Chat.TextChatItem("搭配 Nuget Tom.HttpLib 可以轻松实现GPT流式传输\n\nhttps://gitee.com/EVA-SS/HttpLib", Properties.Resources.head, "Tom") { Me = true }); + Thread.Sleep(700); + + + chatList.AddToBottom(new AntdUI.Chat.TextChatItem("估计还是因为长得帅把", Properties.Resources.head, "Tom") { Me = true }); + Thread.Sleep(700); + + chatList.AddToBottom(new AntdUI.Chat.TextChatItem("城区这车油耗就是高,没啥说的,suv本来就不省油", Properties.Resources.head, "AduSkin")); + Thread.Sleep(700); + + chatList.AddToBottom(new AntdUI.Chat.TextChatItem("咱这车换个轮眉得多少钱啊", Properties.Resources.head, "2.0T 银")); + Thread.Sleep(1000); + + chatList.AddToBottom(new AntdUI.Chat.TextChatItem("百来块吧", Properties.Resources.head, "Tom") { Me = true }); + Thread.Sleep(2000); + + chatList.AddToBottom(new AntdUI.Chat.TextChatItem("我看一般都前端做的,winform还没见过", Properties.Resources.head, "阿枫")); + Thread.Sleep(700); + + chatList.AddToBottom(new AntdUI.Chat.TextChatItem("别聊这些\r\n------------------------------", Properties.Resources.head, "2.0T 银")); + Thread.Sleep(1200); + + #region 模拟GPT + + var msg = new AntdUI.Chat.TextChatItem("", Properties.Resources.head, "2.0T 银"); + bool isbut = chatList.AddIsBottom(msg); + msg.Loading = true; + Thread.Sleep(1200); + + if (isbut) chatList.ToBottom(); + + var strs = new List() { + "It seems like your question", + " contains phrases that are taken from religious or biblical texts, ", + "particularly from the Book of Genesis in the Bible. ", + "To interpret your question, it appears you are asking ", + "about the initial reign and the significance of ", + "the firmament, dominion, and the first tree in the creation ", + "story.\r\n\r\nIn the Book of Genesis, God is depicted as creating the universe and everything in it. ", + "The firmament", + " refers to the sky or ", + "the space that separates the", + " Earth from ", + "the waters above. On ", + "the second day of creation, according to Genesis 1:6-8, God created the firmament", + " to divide the waters below (the seas) from the waters above.\r\n\r\nThe concept of ", + "dominion comes into play on the sixth day of creation when God created humans,", + " as described in Genesis 1:26-28.", + " God gave humans dominion over the fish,", + " birds, and every living", + " creature", + " on the", + " Earth, as well as over the plants and ", + "trees.\r\n\r\nThe first tree mentioned in the Bible is the Tree of ", + "the Knowledge of Good and Evil, which appears in the Garden of Eden story", + " in Genesis 2:9. God commanded Adam, the first human, not to ", + "eat from this tree, warning that doing so would result in death.", + " The Tree of Life is another significant tree mentioned in the Garden of", + " Eden.\r\n\r\nAs for the phrase \"the seas he i were cattle Under living.", + " It may beast every forth place,\" it is unclear what you are asking.", + " However, if you are referring to the creation of living creatures, Genesis", + " 1:20-23 describes how God created aquatic creatures and birds on", + " the fifth day, and land animals and humans on the sixth day." }; + string text = string.Join("", strs); + var ran = new Random(); + bool run = true; + int i = 0; + while (run) + { + Thread.Sleep(ran.Next(10, 200)); + int len = ran.Next(1, 16); + + if (text.Length < i + len) + { + len = text.Length - i; + run = false; + } + if (len > 0) + { + msg.Text += text.Substring(i, len); + if (isbut) chatList.ToBottom(); + i += len; + } + } + + msg.Loading = false; + + #endregion + }); + } + } +} diff --git a/Views/ChatListDemo.resx b/Views/ChatListDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Views/ChatListDemo.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/Views/ContextMenuStripDemo.Designer.cs b/Views/ContextMenuStripDemo.Designer.cs new file mode 100644 index 0000000..1a486d7 --- /dev/null +++ b/Views/ContextMenuStripDemo.Designer.cs @@ -0,0 +1,133 @@ +namespace AntdUIDemo.Views +{ + partial class ContextMenuStripDemo + { + /// + /// 必需的设计器变量。 + /// + 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.stackPanel1 = new AntdUI.StackPanel(); + this.label4 = new AntdUI.Label(); + this.divider1 = new AntdUI.Divider(); + this.label2 = new AntdUI.Label(); + this.label1 = new AntdUI.Label(); + this.flowPanel = new AntdUI.FlowPanel(); + this.button_base = new AntdUI.Button(); + this.stackPanel1.SuspendLayout(); + this.flowPanel.SuspendLayout(); + this.SuspendLayout(); + // + // stackPanel1 + // + this.stackPanel1.Controls.Add(this.flowPanel); + this.stackPanel1.Controls.Add(this.label4); + this.stackPanel1.Controls.Add(this.divider1); + this.stackPanel1.Controls.Add(this.label2); + this.stackPanel1.Controls.Add(this.label1); + this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.stackPanel1.Location = new System.Drawing.Point(0, 0); + this.stackPanel1.Name = "stackPanel1"; + this.stackPanel1.Size = new System.Drawing.Size(700, 498); + this.stackPanel1.TabIndex = 0; + this.stackPanel1.Text = "stackPanel1"; + this.stackPanel1.Vertical = true; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(3, 97); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(694, 24); + this.label4.TabIndex = 53; + this.label4.Text = "基本用法"; + // + // divider1 + // + this.divider1.Location = new System.Drawing.Point(3, 79); + this.divider1.Name = "divider1"; + this.divider1.Size = new System.Drawing.Size(694, 12); + this.divider1.TabIndex = 52; + // + // label2 + // + this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(3, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(694, 24); + this.label2.TabIndex = 51; + this.label2.Text = "表示快捷菜单。"; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(3, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(694, 40); + this.label1.TabIndex = 50; + this.label1.Text = "ContextMenuStrip 快捷菜单"; + // + // flowPanel + // + this.flowPanel.Controls.Add(this.button_base); + this.flowPanel.Location = new System.Drawing.Point(3, 127); + this.flowPanel.Name = "flowPanel"; + this.flowPanel.Size = new System.Drawing.Size(694, 38); + this.flowPanel.TabIndex = 54; + this.flowPanel.Text = "flowPanel1"; + // + // button_base + // + this.button_base.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button_base.Location = new System.Drawing.Point(3, 3); + this.button_base.Name = "button_base"; + this.button_base.Size = new System.Drawing.Size(80, 32); + this.button_base.TabIndex = 5; + this.button_base.Text = "Click"; + this.button_base.Type = AntdUI.TTypeMini.Primary; + this.button_base.WaveSize = 0; + // + // ContextMenuStripDemo + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.Controls.Add(this.stackPanel1); + this.Name = "ContextMenuStripDemo"; + this.Size = new System.Drawing.Size(700, 498); + this.stackPanel1.ResumeLayout(false); + this.flowPanel.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private AntdUI.StackPanel stackPanel1; + private AntdUI.Label label4; + private AntdUI.Divider divider1; + private AntdUI.Label label2; + private AntdUI.Label label1; + private AntdUI.FlowPanel flowPanel; + private AntdUI.Button button_base; + } +} diff --git a/Views/ContextMenuStripDemo.cs b/Views/ContextMenuStripDemo.cs new file mode 100644 index 0000000..adfafc5 --- /dev/null +++ b/Views/ContextMenuStripDemo.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AntdUIDemo.Views +{ + public partial class ContextMenuStripDemo : UserControl + { + private AntdUI.Window window; + public ContextMenuStripDemo(AntdUI.Window _window) + { + window = _window; + InitializeComponent(); + BindEventHandler(); + } + + private void BindEventHandler() + { + button_base.Click += Button_base_Click; + } + + private void Button_base_Click(object sender, EventArgs e) + { + string svg_back = "", +svg_refresh = "", +svg_save = "", +svg_print = "", +svg_laptop = "", +svg_qr = "", +svg_a = "", +svg_fy = "", +svg_add = "", +svg_share = "", +svg_about = ""; + + var menulist = new AntdUI.IContextMenuStripItem[] + { + new AntdUI.ContextMenuStripItem("返回", "Alt+向左键") + { + IconSvg = svg_back + }, + new AntdUI.ContextMenuStripItem("刷新", "Ctrl+R") + { + IconSvg = svg_refresh + }, + new AntdUI.ContextMenuStripItemDivider(), + new AntdUI.ContextMenuStripItem("另存为", "Ctrl+S") + { + IconSvg = svg_save + }, + new AntdUI.ContextMenuStripItem("打印", "Ctrl+P") + { + IconSvg = svg_print + }, + new AntdUI.ContextMenuStripItemDivider(), + new AntdUI.ContextMenuStripItem("发送标签页到你的设备") + { + IconSvg = svg_laptop + }, + new AntdUI.ContextMenuStripItem("为此页面创建QR代码") + { + IconSvg = svg_qr + }, + new AntdUI.ContextMenuStripItem("大声朗读", "Ctrl+Shift+U") + { + IconSvg = svg_a + }, + new AntdUI.ContextMenuStripItem("翻译为 中文(简体)") + { + IconSvg = svg_fy + }, + new AntdUI.ContextMenuStripItem("将页面添加到集锦") + { + Sub = new AntdUI.IContextMenuStripItem[] + { + new AntdUI.ContextMenuStripItem("返回", "Alt+向左键") + { + IconSvg = svg_back, + Sub = new AntdUI.IContextMenuStripItem[] + { + new AntdUI.ContextMenuStripItem("返回", "Alt+向左键") + { + IconSvg = svg_back + }, + new AntdUI.ContextMenuStripItem("刷新", "Ctrl+R") + { + IconSvg = svg_refresh, Checked = true + }, + new AntdUI.ContextMenuStripItemDivider(), + new AntdUI.ContextMenuStripItem("另存为", "Ctrl+S") + { + IconSvg = svg_save + }, + new AntdUI.ContextMenuStripItem("打印", "Ctrl+P") + { + IconSvg = svg_print + }, + }, + }, + new AntdUI.ContextMenuStripItem("刷新", "Ctrl+R") + { + IconSvg = svg_refresh, Checked = true + }, + new AntdUI.ContextMenuStripItemDivider(), + new AntdUI.ContextMenuStripItem("另存为", "Ctrl+S") + { + IconSvg = svg_save + }, + new AntdUI.ContextMenuStripItem("打印", "Ctrl+P") + { + IconSvg = svg_print + }, + }, + IconSvg = svg_add + }, + new AntdUI.ContextMenuStripItemDivider(), + new AntdUI.ContextMenuStripItem("共享") + { + IconSvg = svg_share + }, + new AntdUI.ContextMenuStripItem("关于") + { + IconSvg = svg_about + }, + }; + AntdUI.ContextMenuStrip.open(button_base, it => + { + AntdUI.Message.info(window, it.Text, autoClose: 3); + }, menulist); + } + } +} diff --git a/Views/ContextMenuStripDemo.resx b/Views/ContextMenuStripDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Views/ContextMenuStripDemo.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/Views/DividerDemo.Designer.cs b/Views/DividerDemo.Designer.cs new file mode 100644 index 0000000..3c3896e --- /dev/null +++ b/Views/DividerDemo.Designer.cs @@ -0,0 +1,106 @@ +namespace AntdUIDemo.Views +{ + partial class DividerDemo + { + /// + /// 必需的设计器变量。 + /// + 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.stackPanel1 = new AntdUI.StackPanel(); + this.label4 = new AntdUI.Label(); + this.divider1 = new AntdUI.Divider(); + this.label2 = new AntdUI.Label(); + this.label1 = new AntdUI.Label(); + this.stackPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // stackPanel1 + // + this.stackPanel1.Controls.Add(this.label4); + this.stackPanel1.Controls.Add(this.divider1); + this.stackPanel1.Controls.Add(this.label2); + this.stackPanel1.Controls.Add(this.label1); + this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.stackPanel1.Location = new System.Drawing.Point(0, 0); + this.stackPanel1.Name = "stackPanel1"; + this.stackPanel1.Size = new System.Drawing.Size(700, 518); + this.stackPanel1.TabIndex = 0; + this.stackPanel1.Text = "stackPanel1"; + this.stackPanel1.Vertical = true; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(3, 97); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(694, 24); + this.label4.TabIndex = 57; + this.label4.Text = "基本用法"; + // + // divider1 + // + this.divider1.Location = new System.Drawing.Point(3, 79); + this.divider1.Name = "divider1"; + this.divider1.Size = new System.Drawing.Size(694, 12); + this.divider1.TabIndex = 56; + // + // label2 + // + this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(3, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(694, 24); + this.label2.TabIndex = 55; + this.label2.Text = "区隔内容的分割线。"; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(3, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(694, 40); + this.label1.TabIndex = 54; + this.label1.Text = "Divider 分割线"; + // + // DividerDemo + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.Controls.Add(this.stackPanel1); + this.Name = "DividerDemo"; + this.Size = new System.Drawing.Size(700, 518); + this.stackPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private AntdUI.StackPanel stackPanel1; + private AntdUI.Label label4; + private AntdUI.Divider divider1; + private AntdUI.Label label2; + private AntdUI.Label label1; + } +} diff --git a/Views/DividerDemo.cs b/Views/DividerDemo.cs new file mode 100644 index 0000000..2e09630 --- /dev/null +++ b/Views/DividerDemo.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 DividerDemo : UserControl + { + public DividerDemo() + { + InitializeComponent(); + } + } +} diff --git a/Views/DividerDemo.resx b/Views/DividerDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Views/DividerDemo.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/Views/MsgListDemo.Designer.cs b/Views/MsgListDemo.Designer.cs new file mode 100644 index 0000000..59d9109 --- /dev/null +++ b/Views/MsgListDemo.Designer.cs @@ -0,0 +1,120 @@ +namespace AntdUIDemo.Views +{ + partial class MsgListDemo + { + /// + /// 必需的设计器变量。 + /// + 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.stackPanel1 = new AntdUI.StackPanel(); + this.panel1 = new AntdUI.Panel(); + this.divider1 = new AntdUI.Divider(); + this.label2 = new AntdUI.Label(); + this.label1 = new AntdUI.Label(); + this.msgList = new AntdUI.Chat.MsgList(); + this.stackPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // stackPanel1 + // + this.stackPanel1.Controls.Add(this.panel1); + this.stackPanel1.Controls.Add(this.divider1); + this.stackPanel1.Controls.Add(this.label2); + this.stackPanel1.Controls.Add(this.label1); + this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.stackPanel1.Location = new System.Drawing.Point(0, 0); + this.stackPanel1.Name = "stackPanel1"; + this.stackPanel1.Size = new System.Drawing.Size(700, 471); + this.stackPanel1.TabIndex = 1; + this.stackPanel1.Text = "stackPanel1"; + this.stackPanel1.Vertical = true; + // + // panel1 + // + this.panel1.Controls.Add(this.msgList); + this.panel1.Location = new System.Drawing.Point(3, 97); + this.panel1.Name = "panel1"; + this.panel1.Shadow = 12; + this.panel1.Size = new System.Drawing.Size(694, 371); + this.panel1.TabIndex = 32; + this.panel1.Text = "panel1"; + // + // divider1 + // + this.divider1.Location = new System.Drawing.Point(3, 79); + this.divider1.Name = "divider1"; + this.divider1.Size = new System.Drawing.Size(694, 12); + this.divider1.TabIndex = 31; + // + // label2 + // + this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label2.Location = new System.Drawing.Point(3, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(694, 24); + this.label2.TabIndex = 30; + this.label2.Text = "气泡聊天列表。"; + // + // label1 + // + this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label1.Location = new System.Drawing.Point(3, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(694, 40); + this.label1.TabIndex = 29; + this.label1.Text = "ChatList 气泡聊天列表"; + // + // msgList + // + this.msgList.Dock = System.Windows.Forms.DockStyle.Left; + this.msgList.Location = new System.Drawing.Point(12, 12); + this.msgList.Name = "msgList"; + this.msgList.Size = new System.Drawing.Size(220, 347); + this.msgList.TabIndex = 0; + this.msgList.Text = "msgList1"; + // + // MsgListDemo + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; + this.Controls.Add(this.stackPanel1); + this.Name = "MsgListDemo"; + this.Size = new System.Drawing.Size(700, 471); + this.stackPanel1.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private AntdUI.StackPanel stackPanel1; + private AntdUI.Panel panel1; + private AntdUI.Divider divider1; + private AntdUI.Label label2; + private AntdUI.Label label1; + private AntdUI.Chat.MsgList msgList; + } +} diff --git a/Views/MsgListDemo.cs b/Views/MsgListDemo.cs new file mode 100644 index 0000000..135343f --- /dev/null +++ b/Views/MsgListDemo.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AntdUIDemo.Views +{ + public partial class MsgListDemo : UserControl + { + public MsgListDemo() + { + InitializeComponent(); + // 绑定事件 + BindEventHandler(); + } + + private void BindEventHandler() + { + Task.Factory.StartNew(() => + { + msgList.Items.Add(new AntdUI.Chat.MsgItem("WPF / Flutter UI", Properties.Resources.head) + { + Select = true, + Text = "AduSkin:我初三就上班啦", + Time = DateTime.Now.ToString("HH:mm:ss") + }); + Thread.Sleep(1000); + msgList.Items.Add(new AntdUI.Chat.MsgItem("宝宝", Properties.Resources.head) + { + Text = "今天给你买一束花", + Time = DateTime.Now.ToString("HH:mm:ss") + }); + Thread.Sleep(1000); + msgList.Items.Add(new AntdUI.Chat.MsgItem("AntdUI", Properties.Resources.head) + { + Text = "Tom:❤AntDesign设计语言的Winform界面库", + Time = DateTime.Now.ToString("HH:mm:ss") + }); + Thread.Sleep(1000); + msgList.Items.Add(new AntdUI.Chat.MsgItem("AntdUI", Properties.Resources.head) + { + Text = "晚上一起 Crazy Day 4", + Time = "疯狂星期四" + }); + }); + } + } +} diff --git a/Views/MsgListDemo.resx b/Views/MsgListDemo.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Views/MsgListDemo.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/Views/SpinDemo.Designer.cs b/Views/SpinDemo.Designer.cs index f164e58..25ae4dc 100644 --- a/Views/SpinDemo.Designer.cs +++ b/Views/SpinDemo.Designer.cs @@ -29,18 +29,25 @@ private void InitializeComponent() { this.stackPanel1 = new AntdUI.StackPanel(); + this.flowPanel = new AntdUI.FlowPanel(); + this.label4 = new AntdUI.Label(); this.divider1 = new AntdUI.Divider(); this.label2 = new AntdUI.Label(); this.label1 = new AntdUI.Label(); - this.label4 = new AntdUI.Label(); - this.flowPanel = new AntdUI.FlowPanel(); - this.button2 = new AntdUI.Button(); + this.flowPanel1 = new AntdUI.FlowPanel(); + this.label_spin = new AntdUI.Label(); + this.button_control = new AntdUI.Button(); + this.button_window = new AntdUI.Button(); + this.button_custom = new AntdUI.Button(); + this.button_base = new AntdUI.Button(); this.stackPanel1.SuspendLayout(); this.flowPanel.SuspendLayout(); + this.flowPanel1.SuspendLayout(); this.SuspendLayout(); // // stackPanel1 // + this.stackPanel1.Controls.Add(this.flowPanel1); this.stackPanel1.Controls.Add(this.flowPanel); this.stackPanel1.Controls.Add(this.label4); this.stackPanel1.Controls.Add(this.divider1); @@ -54,6 +61,27 @@ this.stackPanel1.Text = "stackPanel1"; this.stackPanel1.Vertical = true; // + // flowPanel + // + this.flowPanel.Controls.Add(this.button_window); + this.flowPanel.Controls.Add(this.button_custom); + this.flowPanel.Controls.Add(this.button_base); + this.flowPanel.Controls.Add(this.button_control); + this.flowPanel.Location = new System.Drawing.Point(3, 127); + this.flowPanel.Name = "flowPanel"; + this.flowPanel.Size = new System.Drawing.Size(694, 38); + this.flowPanel.TabIndex = 50; + this.flowPanel.Text = "flowPanel1"; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label4.Location = new System.Drawing.Point(3, 97); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(694, 24); + this.label4.TabIndex = 49; + this.label4.Text = "基本用法"; + // // divider1 // this.divider1.Location = new System.Drawing.Point(3, 79); @@ -79,34 +107,68 @@ this.label1.TabIndex = 46; this.label1.Text = "Spin 加载中"; // - // label4 + // flowPanel1 // - this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label4.Location = new System.Drawing.Point(3, 97); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(694, 24); - this.label4.TabIndex = 49; - this.label4.Text = "基本用法"; + this.flowPanel1.Controls.Add(this.label_spin); + this.flowPanel1.Location = new System.Drawing.Point(3, 171); + this.flowPanel1.Name = "flowPanel1"; + this.flowPanel1.Size = new System.Drawing.Size(694, 38); + this.flowPanel1.TabIndex = 51; + this.flowPanel1.Text = "flowPanel1"; // - // flowPanel + // label_spin // - this.flowPanel.Controls.Add(this.button2); - this.flowPanel.Location = new System.Drawing.Point(3, 127); - this.flowPanel.Name = "flowPanel"; - this.flowPanel.Size = new System.Drawing.Size(694, 38); - this.flowPanel.TabIndex = 50; - this.flowPanel.Text = "flowPanel1"; + this.label_spin.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label_spin.Location = new System.Drawing.Point(3, 3); + this.label_spin.Name = "label_spin"; + this.label_spin.Size = new System.Drawing.Size(166, 32); + this.label_spin.TabIndex = 1; + this.label_spin.Text = "这是一个Label控件"; + this.label_spin.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // button2 + // button_control // - 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(3, 3); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(80, 32); - this.button2.TabIndex = 2; - this.button2.Text = "Primary"; - this.button2.Type = AntdUI.TTypeMini.Primary; - this.button2.WaveSize = 0; + this.button_control.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button_control.Location = new System.Drawing.Point(3, 3); + this.button_control.Name = "button_control"; + this.button_control.Size = new System.Drawing.Size(80, 32); + this.button_control.TabIndex = 5; + this.button_control.Text = "控件"; + this.button_control.Type = AntdUI.TTypeMini.Primary; + this.button_control.WaveSize = 0; + // + // button_window + // + this.button_window.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button_window.Location = new System.Drawing.Point(261, 3); + this.button_window.Name = "button_window"; + this.button_window.Size = new System.Drawing.Size(80, 32); + this.button_window.TabIndex = 8; + this.button_window.Text = "整个窗口"; + this.button_window.Type = AntdUI.TTypeMini.Primary; + this.button_window.WaveSize = 0; + // + // button_custom + // + this.button_custom.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button_custom.Location = new System.Drawing.Point(175, 3); + this.button_custom.Name = "button_custom"; + this.button_custom.Size = new System.Drawing.Size(80, 32); + this.button_custom.TabIndex = 7; + this.button_custom.Text = "当前窗口"; + this.button_custom.Type = AntdUI.TTypeMini.Primary; + this.button_custom.WaveSize = 0; + // + // button_base + // + this.button_base.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button_base.Location = new System.Drawing.Point(89, 3); + this.button_base.Name = "button_base"; + this.button_base.Size = new System.Drawing.Size(80, 32); + this.button_base.TabIndex = 6; + this.button_base.Text = "容器"; + this.button_base.Type = AntdUI.TTypeMini.Primary; + this.button_base.WaveSize = 0; // // SpinDemo // @@ -116,6 +178,7 @@ this.Size = new System.Drawing.Size(700, 469); this.stackPanel1.ResumeLayout(false); this.flowPanel.ResumeLayout(false); + this.flowPanel1.ResumeLayout(false); this.ResumeLayout(false); } @@ -128,6 +191,11 @@ private AntdUI.Label label1; private AntdUI.Label label4; private AntdUI.FlowPanel flowPanel; - private AntdUI.Button button2; + private AntdUI.FlowPanel flowPanel1; + private AntdUI.Label label_spin; + private AntdUI.Button button_control; + private AntdUI.Button button_window; + private AntdUI.Button button_custom; + private AntdUI.Button button_base; } } diff --git a/Views/SpinDemo.cs b/Views/SpinDemo.cs index 0bf2e8d..001d9b7 100644 --- a/Views/SpinDemo.cs +++ b/Views/SpinDemo.cs @@ -1,10 +1,12 @@ -using System; +using AntdUI; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; @@ -12,9 +14,79 @@ namespace AntdUIDemo.Views { public partial class SpinDemo : UserControl { - public SpinDemo() + private AntdUI.Window window; + public SpinDemo(AntdUI.Window _window) { + window = _window; InitializeComponent(); + // 绑定事件 + BindEventHandler(); + } + + private void BindEventHandler() + { + button_control.Click += Button_control_Click; + button_base.Click += Button_base_Click; + + button_custom.Click += Button_custom_Click; + button_window.Click += Button_window_Click; + } + + private void Button_control_Click(object sender, EventArgs e) + { + AntdUI.Spin.open(label_spin, new AntdUI.Spin.Config() + { + Back = Color.FromArgb(220, 147, 181, 207), + Color = Color.White, + Radius = 6, + }, () => + { + //耗时代码,加载数据 + Thread.Sleep(1000); + }); + } + + private void Button_window_Click(object sender, EventArgs e) + { + AntdUI.Spin.open(window, new AntdUI.Spin.Config() + { + Back = Color.FromArgb(220,147, 181, 207), + Color = Color.White, + Radius = 6, + }, () => + { + //耗时代码,加载数据 + Thread.Sleep(1000); + }); + } + + private void Button_custom_Click(object sender, EventArgs e) + { + AntdUI.Spin.open(this, new AntdUI.Spin.Config() + { + Back = Color.FromArgb(220, 147, 181, 207), + Color = Color.White, + Radius = 6, + }, () => + { + //耗时代码,加载数据 + Thread.Sleep(1000); + }); + } + + private void Button_base_Click(object sender, EventArgs e) + { + //匿名委托 + AntdUI.Spin.open(flowPanel1, new AntdUI.Spin.Config() + { + Back = Color.FromArgb(220, 147, 181, 207), + Color = Color.White, + Radius = 6, + }, () => + { + //耗时代码,加载数据 + Thread.Sleep(1000); + }); } } }