🦄 Beautiful AntdUI

This commit is contained in:
Tom
2024-11-26 15:17:04 +08:00
parent bcc9062118
commit aac936b85a
16 changed files with 332 additions and 595 deletions

View File

@@ -288,7 +288,6 @@ namespace Demo.Controls
//
// switch6
//
switch6.AutoCheck = true;
switch6.Checked = true;
switch6.Dock = DockStyle.Right;
switch6.Location = new Point(803, 0);
@@ -446,7 +445,6 @@ namespace Demo.Controls
//
// switch5
//
switch5.AutoCheck = true;
switch5.Checked = true;
switch5.Dock = DockStyle.Right;
switch5.Location = new Point(803, 0);
@@ -580,7 +578,6 @@ namespace Demo.Controls
//
// switch4
//
switch4.AutoCheck = true;
switch4.Checked = true;
switch4.Dock = DockStyle.Right;
switch4.Location = new Point(803, 0);
@@ -680,7 +677,6 @@ namespace Demo.Controls
//
// switch3
//
switch3.AutoCheck = true;
switch3.Checked = true;
switch3.Dock = DockStyle.Right;
switch3.Location = new Point(803, 0);
@@ -811,7 +807,6 @@ namespace Demo.Controls
//
// switch2
//
switch2.AutoCheck = true;
switch2.Checked = true;
switch2.Dock = DockStyle.Right;
switch2.Location = new Point(803, 0);
@@ -905,7 +900,6 @@ namespace Demo.Controls
//
// switch1
//
switch1.AutoCheck = true;
switch1.Checked = true;
switch1.Dock = DockStyle.Right;
switch1.Location = new Point(803, 0);

View File

@@ -105,7 +105,6 @@ namespace Demo.Controls
//
// checkbox8
//
checkbox8.AutoCheck = true;
checkbox8.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox8.Checked = true;
checkbox8.Dock = DockStyle.Left;
@@ -119,7 +118,6 @@ namespace Demo.Controls
//
// checkbox7
//
checkbox7.AutoCheck = true;
checkbox7.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox7.Dock = DockStyle.Left;
checkbox7.Fill = Color.FromArgb(150, 0, 0);
@@ -131,7 +129,6 @@ namespace Demo.Controls
//
// checkbox6
//
checkbox6.AutoCheck = true;
checkbox6.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox6.Dock = DockStyle.Left;
checkbox6.Fill = Color.FromArgb(200, 0, 0);
@@ -143,7 +140,6 @@ namespace Demo.Controls
//
// checkbox5
//
checkbox5.AutoCheck = true;
checkbox5.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox5.Dock = DockStyle.Left;
checkbox5.Fill = Color.FromArgb(250, 0, 0);
@@ -166,7 +162,6 @@ namespace Demo.Controls
//
// checkbox4
//
checkbox4.AutoCheck = true;
checkbox4.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox4.Dock = DockStyle.Left;
checkbox4.Enabled = false;
@@ -178,7 +173,6 @@ namespace Demo.Controls
//
// checkbox3
//
checkbox3.AutoCheck = true;
checkbox3.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox3.Dock = DockStyle.Left;
checkbox3.Location = new Point(300, 0);
@@ -189,7 +183,6 @@ namespace Demo.Controls
//
// checkbox2
//
checkbox2.AutoCheck = true;
checkbox2.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox2.Dock = DockStyle.Left;
checkbox2.Location = new Point(150, 0);
@@ -200,7 +193,6 @@ namespace Demo.Controls
//
// checkbox1
//
checkbox1.AutoCheck = true;
checkbox1.AutoSizeMode = AntdUI.TAutoSize.Width;
checkbox1.Dock = DockStyle.Left;
checkbox1.Location = new Point(0, 0);

View File

@@ -114,7 +114,6 @@ namespace Demo.Controls
//
// radio2
//
radio2.AutoCheck = true;
radio2.AutoSizeMode = AntdUI.TAutoSize.Width;
radio2.Checked = true;
radio2.Dock = DockStyle.Left;
@@ -126,7 +125,6 @@ namespace Demo.Controls
//
// radio4
//
radio4.AutoCheck = true;
radio4.AutoSizeMode = AntdUI.TAutoSize.Width;
radio4.Dock = DockStyle.Left;
radio4.Location = new Point(184, 0);
@@ -137,7 +135,6 @@ namespace Demo.Controls
//
// radio3
//
radio3.AutoCheck = true;
radio3.AutoSizeMode = AntdUI.TAutoSize.Width;
radio3.Dock = DockStyle.Left;
radio3.Location = new Point(76, 0);
@@ -148,7 +145,6 @@ namespace Demo.Controls
//
// radio1
//
radio1.AutoCheck = true;
radio1.AutoSizeMode = AntdUI.TAutoSize.Width;
radio1.Dock = DockStyle.Left;
radio1.Location = new Point(0, 0);

View File

@@ -144,23 +144,16 @@ namespace Demo.Controls
menu1.Font = new Font("Microsoft YaHei UI", 10F);
menuItem1.IconSvg = "MailOutlined";
menuItem1.ID = "mail";
menuItem1.PARENTITEM = null;
menuItem1.Select = true;
menuItem1.Text = "Navigation One";
menuItem2.IconSvg = "AppstoreOutlined";
menuItem2.ID = "app";
menuItem2.PARENTITEM = null;
menuItem2.Text = "Navigation Two";
menuItem3.IconSvg = "SettingOutlined";
menuItem3.ID = "SubMenu";
menuItem3.PARENTITEM = null;
menuItem4.PARENTITEM = null;
menuItem4.Text = "Option 1";
menuItem5.PARENTITEM = null;
menuItem5.Text = "Option 2";
menuItem6.PARENTITEM = null;
menuItem6.Text = "Option 3";
menuItem7.PARENTITEM = null;
menuItem7.Text = "Option 4";
menuItem3.Sub.Add(menuItem4);
menuItem3.Sub.Add(menuItem5);
@@ -194,20 +187,13 @@ namespace Demo.Controls
//
menu2.Dock = DockStyle.Left;
menuItem8.IconSvg = "MailOutlined";
menuItem8.PARENTITEM = null;
menuItem9.PARENTITEM = menuItem8;
menuItem10.PARENTITEM = menuItem9;
menuItem10.Select = true;
menuItem10.Text = "Option 1";
menuItem11.PARENTITEM = menuItem9;
menuItem11.Text = "Option 2";
menuItem9.Sub.Add(menuItem10);
menuItem9.Sub.Add(menuItem11);
menuItem9.Text = "Item 1";
menuItem12.PARENTITEM = menuItem8;
menuItem13.PARENTITEM = menuItem12;
menuItem13.Text = "Option 3";
menuItem14.PARENTITEM = menuItem12;
menuItem14.Text = "Option 4";
menuItem12.Sub.Add(menuItem13);
menuItem12.Sub.Add(menuItem14);
@@ -217,15 +203,9 @@ namespace Demo.Controls
menuItem8.Text = "Navigation One";
menuItem15.Expand = false;
menuItem15.IconSvg = "AppstoreOutlined";
menuItem15.PARENTITEM = null;
menuItem16.PARENTITEM = menuItem15;
menuItem16.Text = "Option 5";
menuItem17.PARENTITEM = menuItem15;
menuItem17.Text = "Option 6";
menuItem18.PARENTITEM = menuItem15;
menuItem19.PARENTITEM = menuItem18;
menuItem19.Text = "Option 7";
menuItem20.PARENTITEM = menuItem18;
menuItem20.Text = "Option 8";
menuItem18.Sub.Add(menuItem19);
menuItem18.Sub.Add(menuItem20);
@@ -236,14 +216,9 @@ namespace Demo.Controls
menuItem15.Text = "Navigation Two";
menuItem21.Expand = false;
menuItem21.IconSvg = "SettingOutlined";
menuItem21.PARENTITEM = null;
menuItem22.PARENTITEM = menuItem21;
menuItem22.Text = "Option 9";
menuItem23.PARENTITEM = menuItem21;
menuItem23.Text = "Option 10";
menuItem24.PARENTITEM = menuItem21;
menuItem24.Text = "Option 11";
menuItem25.PARENTITEM = menuItem21;
menuItem25.Text = "Option 12";
menuItem21.Sub.Add(menuItem22);
menuItem21.Sub.Add(menuItem23);
@@ -291,7 +266,6 @@ namespace Demo.Controls
//
// switch4
//
switch4.AutoCheck = true;
switch4.CheckedText = "折叠";
switch4.LocalizationCheckedText = "Menu.collapse";
switch4.LocalizationTextUnCheckedText = "Menu.expand";
@@ -306,19 +280,12 @@ namespace Demo.Controls
//
menu3.Dock = DockStyle.Left;
menuItem26.IconSvg = "MailOutlined";
menuItem26.PARENTITEM = null;
menuItem27.PARENTITEM = menuItem26;
menuItem28.PARENTITEM = menuItem27;
menuItem28.Text = "Option 1";
menuItem29.PARENTITEM = menuItem27;
menuItem29.Text = "Option 2";
menuItem27.Sub.Add(menuItem28);
menuItem27.Sub.Add(menuItem29);
menuItem27.Text = "Item 1";
menuItem30.PARENTITEM = menuItem26;
menuItem31.PARENTITEM = menuItem30;
menuItem31.Text = "Option 3";
menuItem32.PARENTITEM = menuItem30;
menuItem32.Text = "Option 4";
menuItem30.Sub.Add(menuItem31);
menuItem30.Sub.Add(menuItem32);
@@ -328,15 +295,9 @@ namespace Demo.Controls
menuItem26.Text = "Navigation One";
menuItem33.Expand = false;
menuItem33.IconSvg = "AppstoreOutlined";
menuItem33.PARENTITEM = null;
menuItem34.PARENTITEM = menuItem33;
menuItem34.Text = "Option 5";
menuItem35.PARENTITEM = menuItem33;
menuItem35.Text = "Option 6";
menuItem36.PARENTITEM = menuItem33;
menuItem37.PARENTITEM = menuItem36;
menuItem37.Text = "Option 7";
menuItem38.PARENTITEM = menuItem36;
menuItem38.Text = "Option 8";
menuItem36.Sub.Add(menuItem37);
menuItem36.Sub.Add(menuItem38);
@@ -347,14 +308,9 @@ namespace Demo.Controls
menuItem33.Text = "Navigation Two";
menuItem39.Expand = false;
menuItem39.IconSvg = "SettingOutlined";
menuItem39.PARENTITEM = null;
menuItem40.PARENTITEM = menuItem39;
menuItem40.Text = "Option 9";
menuItem41.PARENTITEM = menuItem39;
menuItem41.Text = "Option 10";
menuItem42.PARENTITEM = menuItem39;
menuItem42.Text = "Option 11";
menuItem43.PARENTITEM = menuItem39;
menuItem43.Text = "Option 12";
menuItem39.Sub.Add(menuItem40);
menuItem39.Sub.Add(menuItem41);
@@ -372,7 +328,6 @@ namespace Demo.Controls
//
// switch3
//
switch3.AutoCheck = true;
switch3.CheckedText = "Dark";
switch3.Location = new Point(267, 13);
switch3.Name = "switch3";
@@ -395,7 +350,6 @@ namespace Demo.Controls
//
// switch2
//
switch2.AutoCheck = true;
switch2.CheckedText = "折叠";
switch2.LocalizationCheckedText = "Menu.collapse";
switch2.LocalizationTextUnCheckedText = "Menu.expand";
@@ -408,7 +362,6 @@ namespace Demo.Controls
//
// switch1
//
switch1.AutoCheck = true;
switch1.CheckedText = "Dark";
switch1.Location = new Point(267, 13);
switch1.Name = "switch1";

View File

@@ -105,7 +105,6 @@ namespace Demo.Controls
//
// radio8
//
radio8.AutoCheck = true;
radio8.AutoSizeMode = AntdUI.TAutoSize.Width;
radio8.Checked = true;
radio8.Dock = DockStyle.Left;
@@ -119,7 +118,6 @@ namespace Demo.Controls
//
// radio7
//
radio7.AutoCheck = true;
radio7.AutoSizeMode = AntdUI.TAutoSize.Width;
radio7.Dock = DockStyle.Left;
radio7.Fill = Color.FromArgb(150, 0, 0);
@@ -131,7 +129,6 @@ namespace Demo.Controls
//
// radio6
//
radio6.AutoCheck = true;
radio6.AutoSizeMode = AntdUI.TAutoSize.Width;
radio6.Dock = DockStyle.Left;
radio6.Fill = Color.FromArgb(200, 0, 0);
@@ -143,7 +140,6 @@ namespace Demo.Controls
//
// radio5
//
radio5.AutoCheck = true;
radio5.AutoSizeMode = AntdUI.TAutoSize.Width;
radio5.Dock = DockStyle.Left;
radio5.Fill = Color.FromArgb(250, 0, 0);
@@ -166,7 +162,6 @@ namespace Demo.Controls
//
// radio4
//
radio4.AutoCheck = true;
radio4.AutoSizeMode = AntdUI.TAutoSize.Width;
radio4.Dock = DockStyle.Left;
radio4.Enabled = false;
@@ -178,7 +173,6 @@ namespace Demo.Controls
//
// radio3
//
radio3.AutoCheck = true;
radio3.AutoSizeMode = AntdUI.TAutoSize.Width;
radio3.Dock = DockStyle.Left;
radio3.Location = new Point(300, 0);
@@ -189,7 +183,6 @@ namespace Demo.Controls
//
// radio2
//
radio2.AutoCheck = true;
radio2.AutoSizeMode = AntdUI.TAutoSize.Width;
radio2.Dock = DockStyle.Left;
radio2.Location = new Point(150, 0);
@@ -200,7 +193,6 @@ namespace Demo.Controls
//
// radio1
//
radio1.AutoCheck = true;
radio1.AutoSizeMode = AntdUI.TAutoSize.Width;
radio1.Dock = DockStyle.Left;
radio1.Location = new Point(0, 0);

View File

@@ -63,10 +63,10 @@ namespace Demo.Controls
// header1
//
header1.Description = "开关选择器。";
header1.LocalizationDescription = "Switch.Description";
header1.LocalizationText = "Switch.Text";
header1.Dock = DockStyle.Top;
header1.Font = new Font("Microsoft YaHei UI", 12F);
header1.LocalizationDescription = "Switch.Description";
header1.LocalizationText = "Switch.Text";
header1.Location = new Point(0, 0);
header1.Name = "header1";
header1.Padding = new Padding(0, 0, 0, 10);
@@ -77,7 +77,6 @@ namespace Demo.Controls
//
// switch8
//
switch8.AutoCheck = true;
switch8.Enabled = false;
switch8.Location = new Point(323, 167);
switch8.Name = "switch8";
@@ -86,7 +85,6 @@ namespace Demo.Controls
//
// switch4
//
switch4.AutoCheck = true;
switch4.CheckedText = "on";
switch4.Location = new Point(109, 167);
switch4.Name = "switch4";
@@ -96,7 +94,6 @@ namespace Demo.Controls
//
// switch7
//
switch7.AutoCheck = true;
switch7.Checked = true;
switch7.Enabled = false;
switch7.Location = new Point(231, 167);
@@ -106,7 +103,6 @@ namespace Demo.Controls
//
// switch2
//
switch2.AutoCheck = true;
switch2.Location = new Point(17, 167);
switch2.Name = "switch2";
switch2.Size = new Size(60, 38);
@@ -114,7 +110,6 @@ namespace Demo.Controls
//
// switch6
//
switch6.AutoCheck = true;
switch6.Enabled = false;
switch6.Location = new Point(323, 96);
switch6.Name = "switch6";
@@ -123,7 +118,6 @@ namespace Demo.Controls
//
// switch3
//
switch3.AutoCheck = true;
switch3.Checked = true;
switch3.CheckedText = "开启";
switch3.Location = new Point(109, 96);
@@ -134,7 +128,6 @@ namespace Demo.Controls
//
// switch5
//
switch5.AutoCheck = true;
switch5.Checked = true;
switch5.Enabled = false;
switch5.Location = new Point(231, 96);
@@ -144,7 +137,6 @@ namespace Demo.Controls
//
// switch1
//
switch1.AutoCheck = true;
switch1.Checked = true;
switch1.Location = new Point(17, 96);
switch1.Name = "switch1";
@@ -154,12 +146,12 @@ namespace Demo.Controls
// Switch
//
Controls.Add(switch8);
Controls.Add(switch4);
Controls.Add(switch7);
Controls.Add(switch2);
Controls.Add(switch6);
Controls.Add(switch3);
Controls.Add(switch7);
Controls.Add(switch5);
Controls.Add(switch4);
Controls.Add(switch3);
Controls.Add(switch2);
Controls.Add(switch1);
Controls.Add(header1);
Font = new Font("Microsoft YaHei UI", 9F);

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Microsoft ResX Schema
Version 2.0
@@ -48,7 +48,7 @@
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter

View File

@@ -49,14 +49,11 @@ namespace Demo.Controls
/// </summary>
private void InitializeComponent()
{
AntdUI.Tabs.StyleLine styleLine1 = new AntdUI.Tabs.StyleLine();
header1 = new AntdUI.PageHeader();
pagination1 = new AntdUI.Pagination();
table2 = new AntdUI.Table();
table1 = new AntdUI.Table();
tabs1 = new AntdUI.Tabs();
tabPage1 = new AntdUI.TabPage();
panel1 = new AntdUI.Panel();
checkAddressLineBreak = new AntdUI.Checkbox();
checkVisibleHeader = new AntdUI.Checkbox();
checkEnableHeaderResizing = new AntdUI.Checkbox();
checkSortOrder = new AntdUI.Checkbox();
@@ -65,11 +62,9 @@ namespace Demo.Controls
checkRowsDragSort = new AntdUI.Checkbox();
checkColumnDragSort = new AntdUI.Checkbox();
checkFixedHeader = new AntdUI.Checkbox();
tabPage2 = new AntdUI.TabPage();
tabs1.SuspendLayout();
tabPage1.SuspendLayout();
panel_main = new AntdUI.Panel();
panel1.SuspendLayout();
tabPage2.SuspendLayout();
panel_main.SuspendLayout();
SuspendLayout();
//
// header1
@@ -91,68 +86,32 @@ namespace Demo.Controls
//
pagination1.Dock = DockStyle.Bottom;
pagination1.Font = new Font("Microsoft YaHei UI", 11F);
pagination1.Location = new Point(3, 509);
pagination1.Location = new Point(4, 562);
pagination1.Name = "pagination1";
pagination1.RightToLeft = RightToLeft.Yes;
pagination1.ShowSizeChanger = true;
pagination1.Size = new Size(1288, 40);
pagination1.TabIndex = 5;
pagination1.Size = new Size(1292, 40);
pagination1.TabIndex = 3;
pagination1.Total = 100;
pagination1.ValueChanged += pagination1_ValueChanged;
pagination1.ShowTotalChanged += pagination1_ShowTotalChanged;
//
// table2
//
table2.AutoSizeColumnsMode = AntdUI.ColumnsMode.Fill;
table2.Dock = DockStyle.Fill;
table2.Font = new Font("Microsoft YaHei UI", 11F);
table2.Location = new Point(3, 3);
table2.Name = "table2";
table2.Size = new Size(1288, 506);
table2.TabIndex = 3;
table2.Text = "table2";
//
// table1
//
table1.AutoSizeColumnsMode = AntdUI.ColumnsMode.Fill;
table1.Dock = DockStyle.Fill;
table1.Font = new Font("Microsoft YaHei UI", 11F);
table1.Location = new Point(3, 46);
table1.Location = new Point(4, 43);
table1.Name = "table1";
table1.Radius = 6;
table1.Size = new Size(1288, 508);
table1.TabIndex = 0;
table1.Size = new Size(1292, 519);
table1.TabIndex = 2;
table1.CellClick += table1_CellClick;
table1.CellButtonClick += table1_CellButtonClick;
//
// tabs1
//
tabs1.Dock = DockStyle.Fill;
tabs1.Font = new Font("Microsoft YaHei UI", 12F);
tabs1.Gap = 12;
tabs1.Location = new Point(0, 74);
tabs1.Name = "tabs1";
tabs1.Padding = new Padding(0, 4, 0, 0);
tabs1.Pages.Add(tabPage1);
tabs1.Pages.Add(tabPage2);
tabs1.Size = new Size(1300, 602);
styleLine1.Radius = 2;
tabs1.Style = styleLine1;
tabs1.TabIndex = 0;
//
// tabPage1
//
tabPage1.Controls.Add(table1);
tabPage1.Controls.Add(panel1);
tabPage1.Location = new Point(3, 42);
tabPage1.Name = "tabPage1";
tabPage1.Padding = new Padding(3);
tabPage1.Size = new Size(1294, 557);
tabPage1.TabIndex = 0;
tabPage1.Text = "常规";
//
// panel1
//
panel1.Controls.Add(checkAddressLineBreak);
panel1.Controls.Add(checkVisibleHeader);
panel1.Controls.Add(checkEnableHeaderResizing);
panel1.Controls.Add(checkSortOrder);
@@ -163,21 +122,31 @@ namespace Demo.Controls
panel1.Controls.Add(checkFixedHeader);
panel1.Dock = DockStyle.Top;
panel1.Font = new Font("Microsoft YaHei UI", 12F);
panel1.Location = new Point(3, 3);
panel1.Location = new Point(4, 0);
panel1.Name = "panel1";
panel1.Padding = new Padding(10, 0, 0, 0);
panel1.Size = new Size(1288, 43);
panel1.Radius = 0;
panel1.Size = new Size(1292, 43);
panel1.TabIndex = 1;
panel1.Text = "panel1";
//
// checkAddressLineBreak
//
checkAddressLineBreak.AutoSizeMode = AntdUI.TAutoSize.Width;
checkAddressLineBreak.Dock = DockStyle.Left;
checkAddressLineBreak.LocalizationText = "Table.{id}";
checkAddressLineBreak.Location = new Point(1017, 0);
checkAddressLineBreak.Name = "checkAddressLineBreak";
checkAddressLineBreak.Size = new Size(115, 43);
checkAddressLineBreak.TabIndex = 8;
checkAddressLineBreak.Text = "地址换行";
checkAddressLineBreak.CheckedChanged += checkAddressLineBreak_CheckedChanged;
//
// checkVisibleHeader
//
checkVisibleHeader.AutoCheck = true;
checkVisibleHeader.AutoSizeMode = AntdUI.TAutoSize.Width;
checkVisibleHeader.Checked = true;
checkVisibleHeader.Dock = DockStyle.Left;
checkVisibleHeader.LocalizationText = "Table.{id}";
checkVisibleHeader.Location = new Point(912, 0);
checkVisibleHeader.Location = new Point(902, 0);
checkVisibleHeader.Name = "checkVisibleHeader";
checkVisibleHeader.Size = new Size(115, 43);
checkVisibleHeader.TabIndex = 7;
@@ -186,11 +155,10 @@ namespace Demo.Controls
//
// checkEnableHeaderResizing
//
checkEnableHeaderResizing.AutoCheck = true;
checkEnableHeaderResizing.AutoSizeMode = AntdUI.TAutoSize.Width;
checkEnableHeaderResizing.Dock = DockStyle.Left;
checkEnableHeaderResizing.LocalizationText = "Table.{id}";
checkEnableHeaderResizing.Location = new Point(731, 0);
checkEnableHeaderResizing.Location = new Point(721, 0);
checkEnableHeaderResizing.Name = "checkEnableHeaderResizing";
checkEnableHeaderResizing.Size = new Size(181, 43);
checkEnableHeaderResizing.TabIndex = 6;
@@ -199,11 +167,10 @@ namespace Demo.Controls
//
// checkSortOrder
//
checkSortOrder.AutoCheck = true;
checkSortOrder.AutoSizeMode = AntdUI.TAutoSize.Width;
checkSortOrder.Dock = DockStyle.Left;
checkSortOrder.LocalizationText = "Table.{id}";
checkSortOrder.Location = new Point(616, 0);
checkSortOrder.Location = new Point(606, 0);
checkSortOrder.Name = "checkSortOrder";
checkSortOrder.Size = new Size(115, 43);
checkSortOrder.TabIndex = 5;
@@ -212,11 +179,10 @@ namespace Demo.Controls
//
// checkSetRowStyle
//
checkSetRowStyle.AutoCheck = true;
checkSetRowStyle.AutoSizeMode = AntdUI.TAutoSize.Width;
checkSetRowStyle.Dock = DockStyle.Left;
checkSetRowStyle.LocalizationText = "Table.{id}";
checkSetRowStyle.Location = new Point(518, 0);
checkSetRowStyle.Location = new Point(508, 0);
checkSetRowStyle.Name = "checkSetRowStyle";
checkSetRowStyle.Size = new Size(98, 43);
checkSetRowStyle.TabIndex = 4;
@@ -225,11 +191,10 @@ namespace Demo.Controls
//
// checkBordered
//
checkBordered.AutoCheck = true;
checkBordered.AutoSizeMode = AntdUI.TAutoSize.Width;
checkBordered.Dock = DockStyle.Left;
checkBordered.LocalizationText = "Table.{id}";
checkBordered.Location = new Point(387, 0);
checkBordered.Location = new Point(377, 0);
checkBordered.Name = "checkBordered";
checkBordered.Size = new Size(131, 43);
checkBordered.TabIndex = 3;
@@ -238,11 +203,10 @@ namespace Demo.Controls
//
// checkRowsDragSort
//
checkRowsDragSort.AutoCheck = true;
checkRowsDragSort.AutoSizeMode = AntdUI.TAutoSize.Width;
checkRowsDragSort.Dock = DockStyle.Left;
checkRowsDragSort.LocalizationText = "Table.{id}";
checkRowsDragSort.Location = new Point(256, 0);
checkRowsDragSort.Location = new Point(246, 0);
checkRowsDragSort.Name = "checkRowsDragSort";
checkRowsDragSort.Size = new Size(131, 43);
checkRowsDragSort.TabIndex = 2;
@@ -251,11 +215,10 @@ namespace Demo.Controls
//
// checkColumnDragSort
//
checkColumnDragSort.AutoCheck = true;
checkColumnDragSort.AutoSizeMode = AntdUI.TAutoSize.Width;
checkColumnDragSort.Dock = DockStyle.Left;
checkColumnDragSort.LocalizationText = "Table.{id}";
checkColumnDragSort.Location = new Point(125, 0);
checkColumnDragSort.Location = new Point(115, 0);
checkColumnDragSort.Name = "checkColumnDragSort";
checkColumnDragSort.Size = new Size(131, 43);
checkColumnDragSort.TabIndex = 1;
@@ -264,52 +227,48 @@ namespace Demo.Controls
//
// checkFixedHeader
//
checkFixedHeader.AutoCheck = true;
checkFixedHeader.AutoSizeMode = AntdUI.TAutoSize.Width;
checkFixedHeader.Checked = true;
checkFixedHeader.Dock = DockStyle.Left;
checkFixedHeader.LocalizationText = "Table.{id}";
checkFixedHeader.Location = new Point(10, 0);
checkFixedHeader.Location = new Point(0, 0);
checkFixedHeader.Name = "checkFixedHeader";
checkFixedHeader.Size = new Size(115, 43);
checkFixedHeader.TabIndex = 0;
checkFixedHeader.Text = "固定表头";
checkFixedHeader.CheckedChanged += checkFixedHeader_CheckedChanged;
//
// tabPage2
// panel_main
//
tabPage2.Controls.Add(table2);
tabPage2.Controls.Add(pagination1);
tabPage2.Location = new Point(-1294, -552);
tabPage2.Name = "tabPage2";
tabPage2.Padding = new Padding(3);
tabPage2.Size = new Size(1294, 552);
tabPage2.TabIndex = 1;
tabPage2.Text = "分页";
panel_main.Controls.Add(table1);
panel_main.Controls.Add(pagination1);
panel_main.Controls.Add(panel1);
panel_main.Dock = DockStyle.Fill;
panel_main.Location = new Point(0, 74);
panel_main.Name = "panel_main";
panel_main.Padding = new Padding(4, 0, 4, 0);
panel_main.Radius = 0;
panel_main.Size = new Size(1300, 602);
panel_main.TabIndex = 4;
panel_main.Text = "panel2";
//
// Table
//
Controls.Add(tabs1);
Controls.Add(panel_main);
Controls.Add(header1);
Font = new Font("Microsoft YaHei UI", 16F);
Name = "Table";
Size = new Size(1300, 676);
tabs1.ResumeLayout(false);
tabPage1.ResumeLayout(false);
panel1.ResumeLayout(false);
panel1.PerformLayout();
tabPage2.ResumeLayout(false);
panel_main.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private AntdUI.PageHeader header1;
private AntdUI.Table table1;
private AntdUI.Table table2;
private AntdUI.Pagination pagination1;
private AntdUI.Tabs tabs1;
private AntdUI.TabPage tabPage1;
private AntdUI.TabPage tabPage2;
private AntdUI.Panel panel1;
private AntdUI.Checkbox checkFixedHeader;
private AntdUI.Checkbox checkEnableHeaderResizing;
@@ -319,5 +278,7 @@ namespace Demo.Controls
private AntdUI.Checkbox checkBordered;
private AntdUI.Checkbox checkSortOrder;
private AntdUI.Checkbox checkVisibleHeader;
private AntdUI.Panel panel_main;
private AntdUI.Checkbox checkAddressLineBreak;
}
}

View File

@@ -30,51 +30,30 @@ namespace Demo.Controls
{
form = _form;
InitializeComponent();
tabPage1.Text = AntdUI.Localization.Get("Table.Tab1", "<22><><EFBFBD><EFBFBD>");
tabPage2.Text = AntdUI.Localization.Get("Table.Tab2", "<22><>ҳ");
#region Table 1
#region Table
table1.Columns = new AntdUI.ColumnCollection {
new AntdUI.ColumnCheck("check"){ Fixed=true },
new AntdUI.Column("name","<22><><EFBFBD><EFBFBD>"){ Fixed=true},
new AntdUI.ColumnCheck("checkTitle","<22><>ȫѡ<C8AB><D1A1><EFBFBD><EFBFBD>"){ColAlign=AntdUI.ColumnAlign.Center},
new AntdUI.ColumnRadio("radio","<22><>ѡ"),
new AntdUI.Column("online","״̬",AntdUI.ColumnAlign.Center),
new AntdUI.ColumnSwitch("enable","<22><><EFBFBD><EFBFBD>",AntdUI.ColumnAlign.Center){ Call=(value,record, i_row, i_col)=>{
System.Threading.Thread.Sleep(2000);
return value;
} },
new AntdUI.Column("age","<22><><EFBFBD><EFBFBD>",AntdUI.ColumnAlign.Center),
new AntdUI.Column("address","סַ"){ Width="120", LineBreak=true},
new AntdUI.Column("tag","Tag"),
new AntdUI.Column("imgs","ͼƬ"),
new AntdUI.Column("btns","<22><><EFBFBD><EFBFBD>"){ Fixed=true,Width="auto"},
};
// <20><><EFBFBD>ӱ<EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
var list = new List<TestClass>(10) {
new TestClass(1,"1","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",32,"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰1<D4B0><31>"),
new TestClass(2,"2","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",22,"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰1<D4B0><31>") {
tag=new AntdUI.CellTag[]{ new AntdUI.CellTag("NICE", AntdUI.TTypeMini.Success), new AntdUI.CellTag("DEVELOPER", AntdUI.TTypeMini.Info) }
new AntdUI.ColumnCheck("check") { Fixed = true },
new AntdUI.Column("name", "<22><><EFBFBD><EFBFBD>") { Fixed = true },
new AntdUI.ColumnCheck("checkTitle", "<22><>ȫѡ<C8AB><D1A1><EFBFBD><EFBFBD>") { ColAlign = AntdUI.ColumnAlign.Center },
new AntdUI.ColumnRadio("radio", "<22><>ѡ"),
new AntdUI.Column("online", "״̬", AntdUI.ColumnAlign.Center),
new AntdUI.ColumnSwitch("enable", "<22><><EFBFBD><EFBFBD>", AntdUI.ColumnAlign.Center)
{
Call = (value, record, i_row, i_col) => {
System.Threading.Thread.Sleep(2000);
return value;
}
},
new AntdUI.Column("age", "<22><><EFBFBD><EFBFBD>", AntdUI.ColumnAlign.Center),
new AntdUI.Column("address", "סַ"),
new AntdUI.Column("tag", "Tag"),
new AntdUI.Column("imgs", "ͼƬ"),
new AntdUI.Column("btns", "<22><><EFBFBD><EFBFBD>") { Fixed = true, Width = "auto" },
};
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (int i = 2; i < 10; i++) list.Add(new TestClass(i, i.ToString(), "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 31 + i, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰" + (i + 10) + "<22><>"));
table1.DataSource = list;
#endregion
#region Table 2
table2.Columns = new AntdUI.ColumnCollection {
new AntdUI.Column("name","<22><><EFBFBD><EFBFBD>"),
new AntdUI.Column("age","<22><><EFBFBD><EFBFBD>",AntdUI.ColumnAlign.Center),
new AntdUI.Column("address","סַ"),
new AntdUI.Column("tag","Tag"){ Width="auto"}
};
table2.DataSource = GetPageData(pagination1.Current, pagination1.PageSize);
table1.DataSource = GetPageData(pagination1.Current, pagination1.PageSize);
pagination1.PageSizeOptions = new int[] { 10, 20, 30, 50, 100 };
#endregion
@@ -141,6 +120,13 @@ namespace Demo.Controls
table1.VisibleHeader = e.Value;
}
private void checkAddressLineBreak_CheckedChanged(object sender, AntdUI.BoolEventArgs e)
{
if (e.Value) table1.Columns[7].Width = "120";
else table1.Columns[7].Width = null;
table1.Columns[7].LineBreak = e.Value;
}
#endregion
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD>/˫<EFBFBD><EFBFBD>
@@ -211,19 +197,28 @@ namespace Demo.Controls
object GetPageData(int current, int pageSize)
{
var list = new List<TestClass2>();
var list = new List<TestClass>(pageSize);
int start = Math.Abs(current - 1) * pageSize;
for (int i = 0; i < pageSize; i++)
DateTime now = DateTime.Now;
DateTime birthday_TigerHu = new DateTime(1983, 7, 4);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>https://baike.baidu.com/link?url=7UWQOAPtuaXDjkFQZ92-cNlijS9voNgkQEJSmPLDV73RX1RLogXTLRQdBIQ6KMO7s1nIEZDKjvCJXa_e9fOrrhA9HxRDvRbkgGvPdWYMmP7
DateTime birthday_DanielWu = new DateTime(1974, 9, 30);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>https://baike.baidu.com/link?url=zk3KO7qvnfny-fZ2QfgQ2-lZleCeNUaCfketfcE6Ur5p_LowHOhlttu0c4tEXDKN673QcgpSRRRUmymic58Rf5NiUpsMJrctl1SXaR2RXuu
list.Add(new TestClass(start, 0, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", (int)Math.Round((now - birthday_TigerHu).TotalDays / 365)));
list.Add(new TestClass(start + 1, 1, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", (int)Math.Round((now - birthday_DanielWu).TotalDays / 365))
{
tag = new AntdUI.CellTag[] { new AntdUI.CellTag("NICE", AntdUI.TTypeMini.Success), new AntdUI.CellTag("DEVELOPER", AntdUI.TTypeMini.Info) }
});
for (int i = 2; i < pageSize; i++)
{
int index = start + i;
list.Add(new TestClass2(index, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + index, (index + 20), "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰" + (index + 1) + "<22><>"));
list.Add(new TestClass(index, i, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 20 + index));
}
return list;
}
void pagination1_ValueChanged(object sender, AntdUI.PagePageEventArgs e)
{
table2.DataSource = GetPageData(e.Current, e.PageSize);
table1.DataSource = GetPageData(e.Current, e.PageSize);
}
string pagination1_ShowTotalChanged(object sender, AntdUI.PagePageEventArgs e)
{
@@ -234,63 +229,65 @@ namespace Demo.Controls
public class TestClass : AntdUI.NotifyProperty
{
public TestClass(int i, string key, string name, int age, string address)
public TestClass(int index, int start, string name, int age)
{
_key = key;
if (i == 1) _online = new AntdUI.CellBadge(AntdUI.TState.Success, "<22><><EFBFBD><EFBFBD>");
else if (i == 2) _online = new AntdUI.CellBadge(AntdUI.TState.Processing, "<22><><EFBFBD><EFBFBD>");
else if (i == 3) _online = new AntdUI.CellBadge(AntdUI.TState.Error, "<22><><EFBFBD><EFBFBD>");
else if (i == 4) _online = new AntdUI.CellBadge(AntdUI.TState.Warn, "<22><><EFBFBD><EFBFBD>");
id = (index + 1);
if (start == 1) _online = new AntdUI.CellBadge(AntdUI.TState.Success, "<22><><EFBFBD><EFBFBD>");
else if (start == 2) _online = new AntdUI.CellBadge(AntdUI.TState.Processing, "<22><><EFBFBD><EFBFBD>");
else if (start == 3) _online = new AntdUI.CellBadge(AntdUI.TState.Error, "<22><><EFBFBD><EFBFBD>");
else if (start == 4) _online = new AntdUI.CellBadge(AntdUI.TState.Warn, "<22><><EFBFBD><EFBFBD>");
else _online = new AntdUI.CellBadge(AntdUI.TState.Default, "<22><><EFBFBD><EFBFBD>");
_name = name;
_age = age;
_address = address;
_enable = i % 2 == 0;
if (i == 1)
_address = "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰" + id + "<22><>";
_enable = start % 2 == 0;
if (start == 1)
{
_imgs = new AntdUI.CellImage[] {
new AntdUI.CellImage(Properties.Resources.img1){ BorderWidth=4,BorderColor=Color.BlueViolet},
new AntdUI.CellImage(Properties.Resources.img1) { BorderWidth = 4, BorderColor = Color.BlueViolet },
new AntdUI.CellImage(Properties.Resources.bg1)
};
}
if (i == 2)
if (start == 2)
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("b1") { BorderWidth=1, IconSvg="SearchOutlined",IconHoverSvg=Properties.Resources.icon_like,ShowArrow=true},
new AntdUI.CellButton("b2") { ShowArrow=true},
new AntdUI.CellButton("b3") { Type= AntdUI.TTypeMini.Primary, IconSvg="SearchOutlined" }
new AntdUI.CellButton("b1") {
BorderWidth = 1,
IconSvg = "SearchOutlined",
IconHoverSvg = Properties.Resources.icon_like,
ShowArrow = true
},
new AntdUI.CellButton("b2") { ShowArrow = true },
new AntdUI.CellButton("b3") { Type = AntdUI.TTypeMini.Primary, IconSvg = "SearchOutlined" }
};
}
else if (i == 3)
else if (start == 3)
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("b1","Border") { BorderWidth=1},
new AntdUI.CellButton("b2","GhostBorder") { Ghost = true,BorderWidth=1,ShowArrow=true,IsLink=true }
new AntdUI.CellButton("b1", "Border") { BorderWidth = 1 },
new AntdUI.CellButton("b2", "GhostBorder") { Ghost = true, BorderWidth = 1, ShowArrow = true, IsLink = true }
};
}
else if (i == 4)
else if (start == 4)
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("edit","Edit",AntdUI.TTypeMini.Primary) { Ghost = true,BorderWidth=1 },
new AntdUI.CellButton("delete","Delete",AntdUI.TTypeMini.Error) { Ghost = true ,BorderWidth=1}
new AntdUI.CellButton("edit", "Edit", AntdUI.TTypeMini.Primary) { Ghost = true, BorderWidth = 1 },
new AntdUI.CellButton("delete", "Delete", AntdUI.TTypeMini.Error) { Ghost = true, BorderWidth = 1 }
};
}
else if (i == 5)
else if (start == 5)
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("edit","Edit",AntdUI.TTypeMini.Primary),
new AntdUI.CellButton("delete","Delete",AntdUI.TTypeMini.Error)
};
}
else
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellLink("delete","Delete")
};
}
else _btns = new AntdUI.CellLink[] { new AntdUI.CellLink("delete", "Delete") };
}
public int id { get; set; }
bool _check = false;
public bool check
{
@@ -299,7 +296,7 @@ namespace Demo.Controls
{
if (_check == value) return;
_check = value;
OnPropertyChanged("check");
OnPropertyChanged();
}
}
@@ -311,7 +308,7 @@ namespace Demo.Controls
{
if (_radio == value) return;
_radio = value;
OnPropertyChanged("radio");
OnPropertyChanged();
}
}
@@ -323,19 +320,7 @@ namespace Demo.Controls
{
if (_checkTitle == value) return;
_checkTitle = value;
OnPropertyChanged("checkTitle");
}
}
string _key;
public string key
{
get => _key;
set
{
if (_key == value) return;
_key = value;
OnPropertyChanged("key");
OnPropertyChanged();
}
}
@@ -347,7 +332,7 @@ namespace Demo.Controls
{
if (_name == value) return;
_name = value;
OnPropertyChanged("name");
OnPropertyChanged();
}
}
@@ -358,7 +343,7 @@ namespace Demo.Controls
set
{
_online = value;
OnPropertyChanged("online");
OnPropertyChanged();
}
}
@@ -371,7 +356,7 @@ namespace Demo.Controls
{
if (_enable == value) return;
_enable = value;
OnPropertyChanged("enable");
OnPropertyChanged();
}
}
@@ -383,7 +368,7 @@ namespace Demo.Controls
{
if (_age == value) return;
_age = value;
OnPropertyChanged("age");
OnPropertyChanged();
}
}
@@ -395,7 +380,7 @@ namespace Demo.Controls
{
if (_address == value) return;
_address = value;
OnPropertyChanged("address");
OnPropertyChanged();
}
}
@@ -406,7 +391,7 @@ namespace Demo.Controls
set
{
_tag = value;
OnPropertyChanged("tag");
OnPropertyChanged();
}
}
@@ -417,7 +402,7 @@ namespace Demo.Controls
set
{
_imgs = value;
OnPropertyChanged("imgs");
OnPropertyChanged();
}
}
@@ -428,66 +413,7 @@ namespace Demo.Controls
set
{
_btns = value;
OnPropertyChanged("btns");
}
}
}
public class TestClass2 : AntdUI.NotifyProperty
{
public TestClass2(int i, string name, int age, string address)
{
_name = name;
_age = age;
_address = address;
if (i % 2 == 0) _tag = new AntdUI.CellTag("YES" + i, AntdUI.TTypeMini.Success);
else _tag = new AntdUI.CellTag("NO" + i, AntdUI.TTypeMini.Error);
}
string _name;
public string name
{
get => _name;
set
{
if (_name == value) return;
_name = value;
OnPropertyChanged("name");
}
}
int _age;
public int age
{
get => _age;
set
{
if (_age == value) return;
_age = value;
OnPropertyChanged("age");
}
}
string _address;
public string address
{
get => _address;
set
{
if (_address == value) return;
_address = value;
OnPropertyChanged("address");
}
}
AntdUI.CellTag _tag;
public AntdUI.CellTag tag
{
get => _tag;
set
{
_tag = value;
OnPropertyChanged("tag");
OnPropertyChanged();
}
}
}

View File

@@ -49,14 +49,11 @@ namespace Demo.Controls
/// </summary>
private void InitializeComponent()
{
AntdUI.Tabs.StyleLine styleLine1 = new AntdUI.Tabs.StyleLine();
header1 = new AntdUI.PageHeader();
pagination1 = new AntdUI.Pagination();
table2 = new AntdUI.Table();
table1 = new AntdUI.Table();
tabs1 = new AntdUI.Tabs();
tabPage1 = new AntdUI.TabPage();
panel1 = new AntdUI.Panel();
checkAddressLineBreak = new AntdUI.Checkbox();
checkVisibleHeader = new AntdUI.Checkbox();
checkEnableHeaderResizing = new AntdUI.Checkbox();
checkSortOrder = new AntdUI.Checkbox();
@@ -65,11 +62,9 @@ namespace Demo.Controls
checkRowsDragSort = new AntdUI.Checkbox();
checkColumnDragSort = new AntdUI.Checkbox();
checkFixedHeader = new AntdUI.Checkbox();
tabPage2 = new AntdUI.TabPage();
tabs1.SuspendLayout();
tabPage1.SuspendLayout();
panel_main = new AntdUI.Panel();
panel1.SuspendLayout();
tabPage2.SuspendLayout();
panel_main.SuspendLayout();
SuspendLayout();
//
// header1
@@ -91,68 +86,32 @@ namespace Demo.Controls
//
pagination1.Dock = DockStyle.Bottom;
pagination1.Font = new Font("Microsoft YaHei UI", 11F);
pagination1.Location = new Point(3, 509);
pagination1.Location = new Point(4, 562);
pagination1.Name = "pagination1";
pagination1.RightToLeft = RightToLeft.Yes;
pagination1.ShowSizeChanger = true;
pagination1.Size = new Size(1288, 40);
pagination1.TabIndex = 5;
pagination1.Size = new Size(1292, 40);
pagination1.TabIndex = 3;
pagination1.Total = 100;
pagination1.ValueChanged += pagination1_ValueChanged;
pagination1.ShowTotalChanged += pagination1_ShowTotalChanged;
//
// table2
//
table2.AutoSizeColumnsMode = AntdUI.ColumnsMode.Fill;
table2.Dock = DockStyle.Fill;
table2.Font = new Font("Microsoft YaHei UI", 11F);
table2.Location = new Point(3, 3);
table2.Name = "table2";
table2.Size = new Size(1288, 506);
table2.TabIndex = 3;
table2.Text = "table2";
//
// table1
//
table1.AutoSizeColumnsMode = AntdUI.ColumnsMode.Fill;
table1.Dock = DockStyle.Fill;
table1.Font = new Font("Microsoft YaHei UI", 11F);
table1.Location = new Point(3, 46);
table1.Location = new Point(4, 43);
table1.Name = "table1";
table1.Radius = 6;
table1.Size = new Size(1288, 508);
table1.TabIndex = 0;
table1.Size = new Size(1292, 519);
table1.TabIndex = 2;
table1.CellClick += table1_CellClick;
table1.CellButtonClick += table1_CellButtonClick;
//
// tabs1
//
tabs1.Dock = DockStyle.Fill;
tabs1.Font = new Font("Microsoft YaHei UI", 12F);
tabs1.Gap = 12;
tabs1.Location = new Point(0, 74);
tabs1.Name = "tabs1";
tabs1.Padding = new Padding(0, 4, 0, 0);
tabs1.Pages.Add(tabPage1);
tabs1.Pages.Add(tabPage2);
tabs1.Size = new Size(1300, 602);
styleLine1.Radius = 2;
tabs1.Style = styleLine1;
tabs1.TabIndex = 0;
//
// tabPage1
//
tabPage1.Controls.Add(table1);
tabPage1.Controls.Add(panel1);
tabPage1.Location = new Point(3, 42);
tabPage1.Name = "tabPage1";
tabPage1.Padding = new Padding(3);
tabPage1.Size = new Size(1294, 557);
tabPage1.TabIndex = 0;
tabPage1.Text = "常规";
//
// panel1
//
panel1.Controls.Add(checkAddressLineBreak);
panel1.Controls.Add(checkVisibleHeader);
panel1.Controls.Add(checkEnableHeaderResizing);
panel1.Controls.Add(checkSortOrder);
@@ -163,21 +122,31 @@ namespace Demo.Controls
panel1.Controls.Add(checkFixedHeader);
panel1.Dock = DockStyle.Top;
panel1.Font = new Font("Microsoft YaHei UI", 12F);
panel1.Location = new Point(3, 3);
panel1.Location = new Point(4, 0);
panel1.Name = "panel1";
panel1.Padding = new Padding(10, 0, 0, 0);
panel1.Size = new Size(1288, 43);
panel1.Radius = 0;
panel1.Size = new Size(1292, 43);
panel1.TabIndex = 1;
panel1.Text = "panel1";
//
// checkAddressLineBreak
//
checkAddressLineBreak.AutoSizeMode = AntdUI.TAutoSize.Width;
checkAddressLineBreak.Dock = DockStyle.Left;
checkAddressLineBreak.LocalizationText = "Table.{id}";
checkAddressLineBreak.Location = new Point(1017, 0);
checkAddressLineBreak.Name = "checkAddressLineBreak";
checkAddressLineBreak.Size = new Size(115, 43);
checkAddressLineBreak.TabIndex = 8;
checkAddressLineBreak.Text = "地址换行";
checkAddressLineBreak.CheckedChanged += checkAddressLineBreak_CheckedChanged;
//
// checkVisibleHeader
//
checkVisibleHeader.AutoCheck = true;
checkVisibleHeader.AutoSizeMode = AntdUI.TAutoSize.Width;
checkVisibleHeader.Checked = true;
checkVisibleHeader.Dock = DockStyle.Left;
checkVisibleHeader.LocalizationText = "Table.{id}";
checkVisibleHeader.Location = new Point(912, 0);
checkVisibleHeader.Location = new Point(902, 0);
checkVisibleHeader.Name = "checkVisibleHeader";
checkVisibleHeader.Size = new Size(115, 43);
checkVisibleHeader.TabIndex = 7;
@@ -186,11 +155,10 @@ namespace Demo.Controls
//
// checkEnableHeaderResizing
//
checkEnableHeaderResizing.AutoCheck = true;
checkEnableHeaderResizing.AutoSizeMode = AntdUI.TAutoSize.Width;
checkEnableHeaderResizing.Dock = DockStyle.Left;
checkEnableHeaderResizing.LocalizationText = "Table.{id}";
checkEnableHeaderResizing.Location = new Point(731, 0);
checkEnableHeaderResizing.Location = new Point(721, 0);
checkEnableHeaderResizing.Name = "checkEnableHeaderResizing";
checkEnableHeaderResizing.Size = new Size(181, 43);
checkEnableHeaderResizing.TabIndex = 6;
@@ -199,11 +167,10 @@ namespace Demo.Controls
//
// checkSortOrder
//
checkSortOrder.AutoCheck = true;
checkSortOrder.AutoSizeMode = AntdUI.TAutoSize.Width;
checkSortOrder.Dock = DockStyle.Left;
checkSortOrder.LocalizationText = "Table.{id}";
checkSortOrder.Location = new Point(616, 0);
checkSortOrder.Location = new Point(606, 0);
checkSortOrder.Name = "checkSortOrder";
checkSortOrder.Size = new Size(115, 43);
checkSortOrder.TabIndex = 5;
@@ -212,11 +179,10 @@ namespace Demo.Controls
//
// checkSetRowStyle
//
checkSetRowStyle.AutoCheck = true;
checkSetRowStyle.AutoSizeMode = AntdUI.TAutoSize.Width;
checkSetRowStyle.Dock = DockStyle.Left;
checkSetRowStyle.LocalizationText = "Table.{id}";
checkSetRowStyle.Location = new Point(518, 0);
checkSetRowStyle.Location = new Point(508, 0);
checkSetRowStyle.Name = "checkSetRowStyle";
checkSetRowStyle.Size = new Size(98, 43);
checkSetRowStyle.TabIndex = 4;
@@ -225,11 +191,10 @@ namespace Demo.Controls
//
// checkBordered
//
checkBordered.AutoCheck = true;
checkBordered.AutoSizeMode = AntdUI.TAutoSize.Width;
checkBordered.Dock = DockStyle.Left;
checkBordered.LocalizationText = "Table.{id}";
checkBordered.Location = new Point(387, 0);
checkBordered.Location = new Point(377, 0);
checkBordered.Name = "checkBordered";
checkBordered.Size = new Size(131, 43);
checkBordered.TabIndex = 3;
@@ -238,11 +203,10 @@ namespace Demo.Controls
//
// checkRowsDragSort
//
checkRowsDragSort.AutoCheck = true;
checkRowsDragSort.AutoSizeMode = AntdUI.TAutoSize.Width;
checkRowsDragSort.Dock = DockStyle.Left;
checkRowsDragSort.LocalizationText = "Table.{id}";
checkRowsDragSort.Location = new Point(256, 0);
checkRowsDragSort.Location = new Point(246, 0);
checkRowsDragSort.Name = "checkRowsDragSort";
checkRowsDragSort.Size = new Size(131, 43);
checkRowsDragSort.TabIndex = 2;
@@ -251,11 +215,10 @@ namespace Demo.Controls
//
// checkColumnDragSort
//
checkColumnDragSort.AutoCheck = true;
checkColumnDragSort.AutoSizeMode = AntdUI.TAutoSize.Width;
checkColumnDragSort.Dock = DockStyle.Left;
checkColumnDragSort.LocalizationText = "Table.{id}";
checkColumnDragSort.Location = new Point(125, 0);
checkColumnDragSort.Location = new Point(115, 0);
checkColumnDragSort.Name = "checkColumnDragSort";
checkColumnDragSort.Size = new Size(131, 43);
checkColumnDragSort.TabIndex = 1;
@@ -264,52 +227,48 @@ namespace Demo.Controls
//
// checkFixedHeader
//
checkFixedHeader.AutoCheck = true;
checkFixedHeader.AutoSizeMode = AntdUI.TAutoSize.Width;
checkFixedHeader.Checked = true;
checkFixedHeader.Dock = DockStyle.Left;
checkFixedHeader.LocalizationText = "Table.{id}";
checkFixedHeader.Location = new Point(10, 0);
checkFixedHeader.Location = new Point(0, 0);
checkFixedHeader.Name = "checkFixedHeader";
checkFixedHeader.Size = new Size(115, 43);
checkFixedHeader.TabIndex = 0;
checkFixedHeader.Text = "固定表头";
checkFixedHeader.CheckedChanged += checkFixedHeader_CheckedChanged;
//
// tabPage2
// panel_main
//
tabPage2.Controls.Add(table2);
tabPage2.Controls.Add(pagination1);
tabPage2.Location = new Point(-1294, -552);
tabPage2.Name = "tabPage2";
tabPage2.Padding = new Padding(3);
tabPage2.Size = new Size(1294, 552);
tabPage2.TabIndex = 1;
tabPage2.Text = "分页";
panel_main.Controls.Add(table1);
panel_main.Controls.Add(pagination1);
panel_main.Controls.Add(panel1);
panel_main.Dock = DockStyle.Fill;
panel_main.Location = new Point(0, 74);
panel_main.Name = "panel_main";
panel_main.Padding = new Padding(4, 0, 4, 0);
panel_main.Radius = 0;
panel_main.Size = new Size(1300, 602);
panel_main.TabIndex = 4;
panel_main.Text = "panel2";
//
// TableAOT
// Table
//
Controls.Add(tabs1);
Controls.Add(panel_main);
Controls.Add(header1);
Font = new Font("Microsoft YaHei UI", 16F);
Name = "TableAOT";
Name = "Table";
Size = new Size(1300, 676);
tabs1.ResumeLayout(false);
tabPage1.ResumeLayout(false);
panel1.ResumeLayout(false);
panel1.PerformLayout();
tabPage2.ResumeLayout(false);
panel_main.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private AntdUI.PageHeader header1;
private AntdUI.Table table1;
private AntdUI.Table table2;
private AntdUI.Pagination pagination1;
private AntdUI.Tabs tabs1;
private AntdUI.TabPage tabPage1;
private AntdUI.TabPage tabPage2;
private AntdUI.Panel panel1;
private AntdUI.Checkbox checkFixedHeader;
private AntdUI.Checkbox checkEnableHeaderResizing;
@@ -319,5 +278,7 @@ namespace Demo.Controls
private AntdUI.Checkbox checkBordered;
private AntdUI.Checkbox checkSortOrder;
private AntdUI.Checkbox checkVisibleHeader;
private AntdUI.Panel panel_main;
private AntdUI.Checkbox checkAddressLineBreak;
}
}

View File

@@ -30,148 +30,30 @@ namespace Demo.Controls
{
form = _form;
InitializeComponent();
tabPage1.Text = AntdUI.Localization.Get("Table.Tab1", "<22><><EFBFBD><EFBFBD>");
tabPage2.Text = AntdUI.Localization.Get("Table.Tab2", "<22><>ҳ");
table1.EditMode = table2.EditMode = AntdUI.TEditMode.DoubleClick;
#region Table 1
#region Table
table1.Columns = new AntdUI.ColumnCollection {
new AntdUI.ColumnCheck("check"){ Fixed=true},
new AntdUI.Column("name","<22><><EFBFBD><EFBFBD>"){ Fixed=true},
new AntdUI.ColumnCheck("checkTitle","<22><>ȫѡ<C8AB><D1A1><EFBFBD><EFBFBD>"){ColAlign=AntdUI.ColumnAlign.Center},
new AntdUI.ColumnRadio("radio","<22><>ѡ"),
new AntdUI.Column("online","״̬",AntdUI.ColumnAlign.Center),
new AntdUI.ColumnSwitch("enable","<22><><EFBFBD><EFBFBD>",AntdUI.ColumnAlign.Center){ Call=(value,record, i_row, i_col)=>{
System.Threading.Thread.Sleep(2000);
return value;
} },
new AntdUI.Column("age","<22><><EFBFBD><EFBFBD>",AntdUI.ColumnAlign.Center),
new AntdUI.Column("address","סַ"){ Width="120", LineBreak=true},
new AntdUI.Column("tag","Tag"),
new AntdUI.Column("imgs","ͼƬ"),
new AntdUI.Column("btns","<22><><EFBFBD><EFBFBD>"){ Fixed=true,Width="auto"},
};
// <20><><EFBFBD>ӱ<EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
var list = new List<AntdUI.AntItem[]>(10) {
new AntdUI.AntItem[]{
new AntdUI.AntItem("no",1),
new AntdUI.AntItem("key",1),
new AntdUI.AntItem("check",false),
new AntdUI.AntItem("name","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
new AntdUI.AntItem("checkTitle",false),
new AntdUI.AntItem("radio",false),
new AntdUI.AntItem("online", new AntdUI.CellBadge(AntdUI.TState.Success, "<22><><EFBFBD><EFBFBD>")),
new AntdUI.AntItem("enable",false),
new AntdUI.AntItem("age",32),
new AntdUI.AntItem("address","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰1<D4B0><31>"),
new AntdUI.AntItem("tag"),
new AntdUI.AntItem("imgs",new AntdUI.CellImage[] {
new AntdUI.CellImage(Properties.Resources.img1){ BorderWidth=4,BorderColor=Color.BlueViolet},
new AntdUI.CellImage(Properties.Resources.bg1)
}),
new AntdUI.AntItem("btns", new AntdUI.CellLink[] {
new AntdUI.CellLink("delete","Delete")
}),
new AntdUI.ColumnCheck("check") { Fixed = true },
new AntdUI.Column("name", "<22><><EFBFBD><EFBFBD>") { Fixed = true },
new AntdUI.ColumnCheck("checkTitle", "<22><>ȫѡ<C8AB><D1A1><EFBFBD><EFBFBD>") { ColAlign = AntdUI.ColumnAlign.Center },
new AntdUI.ColumnRadio("radio", "<22><>ѡ"),
new AntdUI.Column("online", "״̬", AntdUI.ColumnAlign.Center),
new AntdUI.ColumnSwitch("enable", "<22><><EFBFBD><EFBFBD>", AntdUI.ColumnAlign.Center)
{
Call = (value, record, i_row, i_col) => {
System.Threading.Thread.Sleep(2000);
return value;
}
},
new AntdUI.AntItem[]{
new AntdUI.AntItem("no",2),
new AntdUI.AntItem("key",2),
new AntdUI.AntItem("check",false),
new AntdUI.AntItem("name","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
new AntdUI.AntItem("checkTitle",false),
new AntdUI.AntItem("radio",false),
new AntdUI.AntItem("online",new AntdUI.CellBadge(AntdUI.TState.Processing, "<22><><EFBFBD><EFBFBD>")),
new AntdUI.AntItem("enable",false),
new AntdUI.AntItem("age",22),
new AntdUI.AntItem("address","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰22<32><32>"),
new AntdUI.AntItem("tag",new AntdUI.CellTag[]{ new AntdUI.CellTag("NICE", AntdUI.TTypeMini.Success), new AntdUI.CellTag("DEVELOPER", AntdUI.TTypeMini.Info) }),
new AntdUI.AntItem("imgs"),
new AntdUI.AntItem("btns", new AntdUI.CellLink[] {
new AntdUI.CellButton("b1") { BorderWidth=1, IconSvg="SearchOutlined",IconHoverSvg=Properties.Resources.icon_like,ShowArrow=true},
new AntdUI.CellButton("b2") { ShowArrow=true},
new AntdUI.CellButton("b3") { Type= AntdUI.TTypeMini.Primary, IconSvg="SearchOutlined" }
}),
}
};
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (int i = 0; i < 8; i++)
{
AntdUI.CellBadge online;
AntdUI.CellLink[] btns;
if (i == 0) online = new AntdUI.CellBadge(AntdUI.TState.Error, "<22><><EFBFBD><EFBFBD>");
else if (i == 1) online = new AntdUI.CellBadge(AntdUI.TState.Warn, "<22><><EFBFBD><EFBFBD>");
else online = new AntdUI.CellBadge(AntdUI.TState.Default, "<22><><EFBFBD><EFBFBD>");
if (i == 0)
{
btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("b1") { BorderWidth=1, IconSvg="SearchOutlined",IconHoverSvg=Properties.Resources.icon_like,ShowArrow=true},
new AntdUI.CellButton("b2") { ShowArrow=true},
new AntdUI.CellButton("b3") { Type= AntdUI.TTypeMini.Primary, IconSvg="SearchOutlined" }
};
}
else if (i == 1)
{
btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("b1","Border") { BorderWidth=1},
new AntdUI.CellButton("b2","GhostBorder") { Ghost = true,BorderWidth=1,ShowArrow=true,IsLink=true }
};
}
else if (i == 2)
{
btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("edit","Edit",AntdUI.TTypeMini.Primary) { Ghost = true,BorderWidth=1 },
new AntdUI.CellButton("delete","Delete",AntdUI.TTypeMini.Error) { Ghost = true ,BorderWidth=1}
};
}
else if (i == 3)
{
btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("edit","Edit",AntdUI.TTypeMini.Primary),
new AntdUI.CellButton("delete","Delete",AntdUI.TTypeMini.Error)
};
}
else
{
btns = new AntdUI.CellLink[] {
new AntdUI.CellLink("delete","Delete")
};
}
list.Add(new AntdUI.AntItem[]{
new AntdUI.AntItem("no",2+i),
new AntdUI.AntItem("key",2+i),
new AntdUI.AntItem("check",false),
new AntdUI.AntItem("name","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
new AntdUI.AntItem("checkTitle",false),
new AntdUI.AntItem("radio",false),
new AntdUI.AntItem("online",online),
new AntdUI.AntItem("enable",i % 2 == 0),
new AntdUI.AntItem("age",33 +i),
new AntdUI.AntItem("address", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰" + (i + 2) + "<22><>"),
new AntdUI.AntItem("tag",null),
new AntdUI.AntItem("imgs"),
new AntdUI.AntItem("btns", btns),
});
}
table1.DataSource = list;
#endregion
#region Table 2
table2.Columns = new AntdUI.ColumnCollection {
new AntdUI.Column("no","<22><><EFBFBD><EFBFBD>",AntdUI.ColumnAlign.Right){ Width="auto"},
new AntdUI.Column("name","<22><><EFBFBD><EFBFBD>"),
new AntdUI.Column("age","<22><><EFBFBD><EFBFBD>",AntdUI.ColumnAlign.Center),
new AntdUI.Column("address","סַ"),
new AntdUI.Column("tag","Tag"){ Width="auto"}
new AntdUI.Column("age", "<22><><EFBFBD><EFBFBD>", AntdUI.ColumnAlign.Center),
new AntdUI.Column("address", "סַ"),
new AntdUI.Column("tag", "Tag"),
new AntdUI.Column("imgs", "ͼƬ"),
new AntdUI.Column("btns", "<22><><EFBFBD><EFBFBD>") { Fixed = true, Width = "auto" },
};
table2.DataSource = GetPageData(pagination1.Current, pagination1.PageSize);
table1.DataSource = GetPageData(pagination1.Current, pagination1.PageSize);
pagination1.PageSizeOptions = new int[] { 10, 20, 30, 50, 100 };
#endregion
@@ -238,6 +120,13 @@ namespace Demo.Controls
table1.VisibleHeader = e.Value;
}
private void checkAddressLineBreak_CheckedChanged(object sender, AntdUI.BoolEventArgs e)
{
if (e.Value) table1.Columns[7].Width = "120";
else table1.Columns[7].Width = null;
table1.Columns[7].LineBreak = e.Value;
}
#endregion
#region <EFBFBD><EFBFBD><EFBFBD><EFBFBD>/˫<EFBFBD><EFBFBD>
@@ -249,7 +138,7 @@ namespace Demo.Controls
if (e.RowIndex > 0 && e.ColumnIndex == 6) AntdUI.Popover.open(new AntdUI.Popover.Config(table1, "<22><>ʾһ<CABE><D2BB><EFBFBD>ܵ<EFBFBD><DCB5><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD>") { Offset = e.Rect });
else if (e.RowIndex > 0 && e.ColumnIndex == 8)
{
var tag = data[10];
var tag = data[9];
if (tag.value is AntdUI.CellTag[] tags)
{
if (tags.Length == 1)
@@ -273,8 +162,8 @@ namespace Demo.Controls
if (e.Record is IList<AntdUI.AntItem> data)
{
if (AntdUI.Modal.open(new AntdUI.Modal.Config(form, "<22>Ƿ<EFBFBD>ɾ<EFBFBD><C9BE>", new AntdUI.Modal.TextLine[] {
new AntdUI.Modal.TextLine(data[3].value.ToString(),AntdUI.Style.Db.Primary),
new AntdUI.Modal.TextLine(data[9].value.ToString(),6,AntdUI.Style.Db.TextSecondary)
new AntdUI.Modal.TextLine(data[2].value.ToString(),AntdUI.Style.Db.Primary),
new AntdUI.Modal.TextLine(data[8].value.ToString(),6,AntdUI.Style.Db.TextSecondary)
}, AntdUI.TType.Error)
{
CancelText = null,
@@ -309,31 +198,139 @@ namespace Demo.Controls
object GetPageData(int current, int pageSize)
{
var list = new List<AntdUI.AntItem[]>();
var list = new List<AntdUI.AntItem[]>(pageSize);
int start = Math.Abs(current - 1) * pageSize;
for (int i = 0; i < pageSize; i++)
DateTime now = DateTime.Now;
DateTime birthday_TigerHu = new DateTime(1983, 7, 4);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>https://baike.baidu.com/link?url=7UWQOAPtuaXDjkFQZ92-cNlijS9voNgkQEJSmPLDV73RX1RLogXTLRQdBIQ6KMO7s1nIEZDKjvCJXa_e9fOrrhA9HxRDvRbkgGvPdWYMmP7
DateTime birthday_DanielWu = new DateTime(1974, 9, 30);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>https://baike.baidu.com/link?url=zk3KO7qvnfny-fZ2QfgQ2-lZleCeNUaCfketfcE6Ur5p_LowHOhlttu0c4tEXDKN673QcgpSRRRUmymic58Rf5NiUpsMJrctl1SXaR2RXuu
list.Add(new AntdUI.AntItem[]{
new AntdUI.AntItem("no",start),
new AntdUI.AntItem("check",false),
new AntdUI.AntItem("name","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
new AntdUI.AntItem("checkTitle",false),
new AntdUI.AntItem("radio",false),
new AntdUI.AntItem("online", new AntdUI.CellBadge(AntdUI.TState.Success, "<22><><EFBFBD><EFBFBD>")),
new AntdUI.AntItem("enable",false),
new AntdUI.AntItem("age",(int)Math.Round((now - birthday_TigerHu).TotalDays / 365)),
new AntdUI.AntItem("address", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰" + (start+1) + "<22><>"),
new AntdUI.AntItem("tag"),
new AntdUI.AntItem("imgs",new AntdUI.CellImage[] {
new AntdUI.CellImage(Properties.Resources.img1){ BorderWidth=4,BorderColor=Color.BlueViolet},
new AntdUI.CellImage(Properties.Resources.bg1)
}),
new AntdUI.AntItem("btns", new AntdUI.CellLink[] {
new AntdUI.CellLink("delete","Delete")
}),
});
list.Add(new AntdUI.AntItem[]{
new AntdUI.AntItem("no",start + 1),
new AntdUI.AntItem("check",false),
new AntdUI.AntItem("name","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
new AntdUI.AntItem("checkTitle",false),
new AntdUI.AntItem("radio",false),
new AntdUI.AntItem("online",new AntdUI.CellBadge(AntdUI.TState.Processing, "<22><><EFBFBD><EFBFBD>")),
new AntdUI.AntItem("enable",false),
new AntdUI.AntItem("age",(int)Math.Round((now - birthday_DanielWu).TotalDays / 365)),
new AntdUI.AntItem("address", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰" + (start + 1+1) + "<22><>"),
new AntdUI.AntItem("tag",new AntdUI.CellTag[]{ new AntdUI.CellTag("NICE", AntdUI.TTypeMini.Success), new AntdUI.CellTag("DEVELOPER", AntdUI.TTypeMini.Info) }),
new AntdUI.AntItem("imgs"),
new AntdUI.AntItem("btns", new AntdUI.CellLink[] {
new AntdUI.CellButton("b1") { BorderWidth=1, IconSvg="SearchOutlined",IconHoverSvg=Properties.Resources.icon_like,ShowArrow=true},
new AntdUI.CellButton("b2") { ShowArrow=true},
new AntdUI.CellButton("b3") { Type= AntdUI.TTypeMini.Primary, IconSvg="SearchOutlined" }
}),
});
for (int i = 2; i < pageSize; i++)
{
int index = start + i;
list.Add(new AntdUI.AntItem[]{
new AntdUI.AntItem("no",index+1),
new AntdUI.AntItem("name","<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" + index),
new AntdUI.AntItem("age", (index + 20)),
new AntdUI.AntItem("address", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰" + (index + 1) + "<22><>"),
new AntdUI.AntItem("tag",index % 2 == 0 ? new AntdUI.CellTag("YES" + index, AntdUI.TTypeMini.Success) : new AntdUI.CellTag("NO" +index, AntdUI.TTypeMini.Error))
});
list.Add(GetItemOne(index, i, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", 20 + index));
}
return list;
}
void pagination1_ValueChanged(object sender, AntdUI.PagePageEventArgs e)
{
table2.DataSource = GetPageData(e.Current, e.PageSize);
table1.DataSource = GetPageData(e.Current, e.PageSize);
}
string pagination1_ShowTotalChanged(object sender, AntdUI.PagePageEventArgs e)
{
return $"{e.PageSize} / {e.Total}<7D><> {e.PageTotal}ҳ";
}
AntdUI.AntItem[] GetItemOne(int index, int start, string name, int age)
{
int id = (index + 1);
AntdUI.CellBadge _online = null;
AntdUI.CellImage[] _imgs = null;
AntdUI.CellLink[] _btns = null;
if (start == 1) _online = new AntdUI.CellBadge(AntdUI.TState.Success, "<22><><EFBFBD><EFBFBD>");
else if (start == 2) _online = new AntdUI.CellBadge(AntdUI.TState.Processing, "<22><><EFBFBD><EFBFBD>");
else if (start == 3) _online = new AntdUI.CellBadge(AntdUI.TState.Error, "<22><><EFBFBD><EFBFBD>");
else if (start == 4) _online = new AntdUI.CellBadge(AntdUI.TState.Warn, "<22><><EFBFBD><EFBFBD>");
else _online = new AntdUI.CellBadge(AntdUI.TState.Default, "<22><><EFBFBD><EFBFBD>");
if (start == 1)
{
_imgs = new AntdUI.CellImage[] {
new AntdUI.CellImage(Properties.Resources.img1) { BorderWidth = 4, BorderColor = Color.BlueViolet },
new AntdUI.CellImage(Properties.Resources.bg1)
};
}
if (start == 2)
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("b1") {
BorderWidth = 1,
IconSvg = "SearchOutlined",
IconHoverSvg = Properties.Resources.icon_like,
ShowArrow = true
},
new AntdUI.CellButton("b2") { ShowArrow = true },
new AntdUI.CellButton("b3") { Type = AntdUI.TTypeMini.Primary, IconSvg = "SearchOutlined" }
};
}
else if (start == 3)
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("b1", "Border") { BorderWidth = 1 },
new AntdUI.CellButton("b2", "GhostBorder") { Ghost = true, BorderWidth = 1, ShowArrow = true, IsLink = true }
};
}
else if (start == 4)
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("edit", "Edit", AntdUI.TTypeMini.Primary) { Ghost = true, BorderWidth = 1 },
new AntdUI.CellButton("delete", "Delete", AntdUI.TTypeMini.Error) { Ghost = true, BorderWidth = 1 }
};
}
else if (start == 5)
{
_btns = new AntdUI.CellLink[] {
new AntdUI.CellButton("edit","Edit",AntdUI.TTypeMini.Primary),
new AntdUI.CellButton("delete","Delete",AntdUI.TTypeMini.Error)
};
}
else _btns = new AntdUI.CellLink[] { new AntdUI.CellLink("delete", "Delete") };
return new AntdUI.AntItem[]{
new AntdUI.AntItem("no", id),
new AntdUI.AntItem("check", false),
new AntdUI.AntItem("name", name),
new AntdUI.AntItem("checkTitle", false),
new AntdUI.AntItem("radio", false),
new AntdUI.AntItem("online", _online),
new AntdUI.AntItem("enable", start % 2 == 0),
new AntdUI.AntItem("age", age),
new AntdUI.AntItem("address", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׹<EFBFBD>԰" + id + "<22><>"),
new AntdUI.AntItem("tag"),
new AntdUI.AntItem("imgs", _imgs),
new AntdUI.AntItem("btns", _btns),
};
}
#endregion
}
}

View File

@@ -99,7 +99,6 @@ namespace Demo.Controls
//
// checkbox1
//
checkbox1.AutoCheck = true;
checkbox1.LocalizationText = "VirtualPanel.{id}";
checkbox1.Location = new Point(229, 54);
checkbox1.Name = "checkbox1";

View File

@@ -436,10 +436,6 @@ namespace Demo
return "Table";
case "Table.Description":
return "A table displays rows of data.";
case "Table.Tab1":
return "Basic";
case "Table.Tab2":
return "Pagination";
case "Table.checkFixedHeader":
return "FixedHeader";
case "Table.checkColumnDragSort":

View File

@@ -152,7 +152,6 @@ namespace Demo
//
// radio1
//
radio1.AutoCheck = true;
radio1.AutoSizeMode = AntdUI.TAutoSize.Auto;
radio1.Location = new Point(40, 168);
radio1.Name = "radio1";
@@ -162,7 +161,6 @@ namespace Demo
//
// radio2
//
radio2.AutoCheck = true;
radio2.AutoSizeMode = AntdUI.TAutoSize.Auto;
radio2.Location = new Point(210, 168);
radio2.Name = "radio2";
@@ -172,7 +170,6 @@ namespace Demo
//
// radio3
//
radio3.AutoCheck = true;
radio3.AutoSizeMode = AntdUI.TAutoSize.Auto;
radio3.Checked = true;
radio3.Location = new Point(380, 168);
@@ -183,7 +180,6 @@ namespace Demo
//
// radio4
//
radio4.AutoCheck = true;
radio4.AutoSizeMode = AntdUI.TAutoSize.Auto;
radio4.Enabled = false;
radio4.Location = new Point(550, 168);
@@ -194,7 +190,6 @@ namespace Demo
//
// radio5
//
radio5.AutoCheck = true;
radio5.AutoSizeMode = AntdUI.TAutoSize.Auto;
radio5.Enabled = false;
radio5.Location = new Point(720, 168);
@@ -205,7 +200,6 @@ namespace Demo
//
// checkbox1
//
checkbox1.AutoCheck = true;
checkbox1.AutoSizeMode = AntdUI.TAutoSize.Auto;
checkbox1.Location = new Point(40, 239);
checkbox1.Name = "checkbox1";
@@ -215,7 +209,6 @@ namespace Demo
//
// checkbox2
//
checkbox2.AutoCheck = true;
checkbox2.AutoSizeMode = AntdUI.TAutoSize.Auto;
checkbox2.Location = new Point(210, 239);
checkbox2.Name = "checkbox2";
@@ -225,7 +218,6 @@ namespace Demo
//
// checkbox3
//
checkbox3.AutoCheck = true;
checkbox3.AutoSizeMode = AntdUI.TAutoSize.Auto;
checkbox3.Checked = true;
checkbox3.Location = new Point(380, 239);
@@ -236,7 +228,6 @@ namespace Demo
//
// checkbox4
//
checkbox4.AutoCheck = true;
checkbox4.AutoSizeMode = AntdUI.TAutoSize.Auto;
checkbox4.Enabled = false;
checkbox4.Location = new Point(550, 239);
@@ -247,7 +238,6 @@ namespace Demo
//
// checkbox5
//
checkbox5.AutoCheck = true;
checkbox5.AutoSizeMode = AntdUI.TAutoSize.Auto;
checkbox5.Enabled = false;
checkbox5.Location = new Point(720, 239);
@@ -258,7 +248,6 @@ namespace Demo
//
// switch1
//
switch1.AutoCheck = true;
switch1.Checked = true;
switch1.Location = new Point(907, 170);
switch1.Name = "switch1";
@@ -267,7 +256,6 @@ namespace Demo
//
// switch2
//
switch2.AutoCheck = true;
switch2.Checked = true;
switch2.Location = new Point(907, 241);
switch2.Name = "switch2";
@@ -276,7 +264,6 @@ namespace Demo
//
// switch3
//
switch3.AutoCheck = true;
switch3.Location = new Point(999, 170);
switch3.Name = "switch3";
switch3.Size = new Size(60, 38);
@@ -284,7 +271,6 @@ namespace Demo
//
// switch4
//
switch4.AutoCheck = true;
switch4.Location = new Point(999, 241);
switch4.Name = "switch4";
switch4.Size = new Size(60, 38);
@@ -292,7 +278,6 @@ namespace Demo
//
// switch5
//
switch5.AutoCheck = true;
switch5.Checked = true;
switch5.Enabled = false;
switch5.Location = new Point(1091, 170);
@@ -302,7 +287,6 @@ namespace Demo
//
// switch6
//
switch6.AutoCheck = true;
switch6.Enabled = false;
switch6.Location = new Point(1183, 170);
switch6.Name = "switch6";
@@ -311,7 +295,6 @@ namespace Demo
//
// switch7
//
switch7.AutoCheck = true;
switch7.Checked = true;
switch7.Enabled = false;
switch7.Location = new Point(1091, 241);
@@ -321,7 +304,6 @@ namespace Demo
//
// switch8
//
switch8.AutoCheck = true;
switch8.Enabled = false;
switch8.Location = new Point(1183, 241);
switch8.Name = "switch8";

Binary file not shown.

View File

@@ -96,7 +96,6 @@ namespace Demo
// label2
//
label2.Anchor = System.Windows.Forms.AnchorStyles.None;
label2.AutoCheck = true;
label2.Location = new System.Drawing.Point(191, 8);
label2.Name = "label2";
label2.Size = new System.Drawing.Size(50, 30);
@@ -136,7 +135,6 @@ namespace Demo
// switch1
//
switch1.Anchor = System.Windows.Forms.AnchorStyles.None;
switch1.AutoCheck = true;
switch1.Location = new System.Drawing.Point(191, 54);
switch1.Name = "switch1";
switch1.Size = new System.Drawing.Size(50, 30);
@@ -146,7 +144,6 @@ namespace Demo
// switch2
//
switch2.Anchor = System.Windows.Forms.AnchorStyles.None;
switch2.AutoCheck = true;
switch2.Location = new System.Drawing.Point(191, 100);
switch2.Name = "switch2";
switch2.Size = new System.Drawing.Size(50, 30);
@@ -156,7 +153,6 @@ namespace Demo
// switch3
//
switch3.Anchor = System.Windows.Forms.AnchorStyles.None;
switch3.AutoCheck = true;
switch3.Location = new System.Drawing.Point(191, 146);
switch3.Name = "switch3";
switch3.Size = new System.Drawing.Size(50, 30);