国际化支持中,目前已支持首页,Button按钮,FloatButon按钮,Icon图标

In the internationalization support, the homepage, button, FloatButon button, and Icon icon are currently supported
This commit is contained in:
czz_y
2025-01-17 16:36:53 +08:00
parent 6b427ebea4
commit da365f11f9
28 changed files with 719 additions and 128 deletions
+22 -3
View File
@@ -126,6 +126,8 @@
this.header1.DividerShow = true;
this.header1.Dock = System.Windows.Forms.DockStyle.Top;
this.header1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.header1.LocalizationDescription = "Button.Description";
this.header1.LocalizationText = "Button.Text";
this.header1.Location = new System.Drawing.Point(0, 0);
this.header1.Name = "header1";
this.header1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
@@ -181,6 +183,7 @@
this.button_toggle3.Cursor = System.Windows.Forms.Cursors.Default;
this.button_toggle3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.button_toggle3.IconPosition = AntdUI.TAlignMini.Right;
this.button_toggle3.LocalizationText = "search";
this.button_toggle3.Location = new System.Drawing.Point(175, 3);
this.button_toggle3.Name = "button_toggle3";
this.button_toggle3.RightToLeft = System.Windows.Forms.RightToLeft.No;
@@ -200,6 +203,7 @@
this.button_toggle2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.button_toggle2.IconPosition = AntdUI.TAlignMini.Right;
this.button_toggle2.IconSvg = resources.GetString("button_toggle2.IconSvg");
this.button_toggle2.LocalizationText = "search";
this.button_toggle2.Location = new System.Drawing.Point(89, 3);
this.button_toggle2.Name = "button_toggle2";
this.button_toggle2.RightToLeft = System.Windows.Forms.RightToLeft.No;
@@ -221,6 +225,7 @@
// label10
//
this.label10.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label10.LocalizationText = "toggle";
this.label10.Location = new System.Drawing.Point(3, 711);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(744, 24);
@@ -282,6 +287,7 @@
// label9
//
this.label9.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label9.LocalizationText = "gradient";
this.label9.Location = new System.Drawing.Point(3, 631);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(744, 24);
@@ -387,6 +393,7 @@
// label8
//
this.label8.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.LocalizationText = "join";
this.label8.Location = new System.Drawing.Point(3, 551);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(744, 24);
@@ -412,10 +419,11 @@
this.button28.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button28.Ghost = true;
this.button28.IconSvg = resources.GetString("button28.IconSvg");
this.button28.Location = new System.Drawing.Point(347, 3);
this.button28.LocalizationText = "search";
this.button28.Location = new System.Drawing.Point(367, 3);
this.button28.Name = "button28";
this.button28.ShowArrow = true;
this.button28.Size = new System.Drawing.Size(80, 38);
this.button28.Size = new System.Drawing.Size(100, 38);
this.button28.TabIndex = 11;
this.button28.Text = "搜索";
this.button28.Type = AntdUI.TTypeMini.Primary;
@@ -425,10 +433,11 @@
this.button27.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button27.Ghost = true;
this.button27.IconSvg = resources.GetString("button27.IconSvg");
this.button27.LocalizationText = "search";
this.button27.Location = new System.Drawing.Point(261, 3);
this.button27.Name = "button27";
this.button27.ShowArrow = true;
this.button27.Size = new System.Drawing.Size(80, 38);
this.button27.Size = new System.Drawing.Size(100, 38);
this.button27.TabIndex = 10;
this.button27.Text = "搜索";
this.button27.Type = AntdUI.TTypeMini.Primary;
@@ -472,6 +481,7 @@
// label7
//
this.label7.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.LocalizationText = "arrow";
this.label7.Location = new System.Drawing.Point(3, 471);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(744, 24);
@@ -498,6 +508,7 @@
this.button21.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button21.Ghost = true;
this.button21.IconSvg = resources.GetString("button21.IconSvg");
this.button21.LocalizationText = "search";
this.button21.Location = new System.Drawing.Point(307, 3);
this.button21.Name = "button21";
this.button21.Size = new System.Drawing.Size(80, 38);
@@ -523,6 +534,7 @@
this.button19.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button19.Ghost = true;
this.button19.IconSvg = resources.GetString("button19.IconSvg");
this.button19.LocalizationText = "search";
this.button19.Location = new System.Drawing.Point(177, 3);
this.button19.Name = "button19";
this.button19.RightToLeft = System.Windows.Forms.RightToLeft.No;
@@ -547,6 +559,7 @@
//
this.button23.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button23.IconSvg = resources.GetString("button23.IconSvg");
this.button23.LocalizationText = "search";
this.button23.Location = new System.Drawing.Point(47, 3);
this.button23.Name = "button23";
this.button23.Size = new System.Drawing.Size(80, 38);
@@ -566,6 +579,7 @@
// label6
//
this.label6.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.LocalizationText = "icon";
this.label6.Location = new System.Drawing.Point(3, 391);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(744, 24);
@@ -660,6 +674,7 @@
// label5
//
this.label5.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.LocalizationText = "border";
this.label5.Location = new System.Drawing.Point(3, 311);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(744, 24);
@@ -748,6 +763,7 @@
// label4
//
this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.LocalizationText = "ghost";
this.label4.Location = new System.Drawing.Point(3, 231);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(744, 24);
@@ -867,6 +883,7 @@
// label12
//
this.label12.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label12.LocalizationText = "loading";
this.label12.Location = new System.Drawing.Point(3, 157);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(744, 24);
@@ -950,6 +967,7 @@
// label11
//
this.label11.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label11.LocalizationText = "wave";
this.label11.Location = new System.Drawing.Point(3, 77);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(744, 24);
@@ -1039,6 +1057,7 @@
// label3
//
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.LocalizationText = "type";
this.label3.Location = new System.Drawing.Point(3, 3);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(744, 24);
+2 -2
View File
@@ -89,7 +89,7 @@ namespace AntdUIDemo.Views
}
if (!string.IsNullOrEmpty(iconsvg))
{
tooltipText.AppendLine($"IconSvg: 参见IconSvg属性");
tooltipText.AppendLine($"IconSvg: See IconSvg Properties");
}
if (backactive != null)
{
@@ -110,7 +110,7 @@ namespace AntdUIDemo.Views
tooltipText.AppendLine($"ToggleType: {toggletype}");
if (!string.IsNullOrEmpty(toggleiconsvg))
{
tooltipText.AppendLine($"ToggleIconSvg: 参见ToggleIconSvg属性");
tooltipText.AppendLine($"ToggleIconSvg: See ToggleIconSvg Properties");
}
}
if (loading)
+44 -36
View File
@@ -31,6 +31,9 @@
this.header1 = new AntdUI.PageHeader();
this.stackPanel1 = new AntdUI.StackPanel();
this.stackPanel2 = new AntdUI.StackPanel();
this.buttonCZ = new AntdUI.Button();
this.buttonClose = new AntdUI.Button();
this.buttonOpen = new AntdUI.Button();
this.stackPanel8 = new AntdUI.StackPanel();
this.switch_enabled = new AntdUI.Switch();
this.label18 = new AntdUI.Label();
@@ -70,9 +73,6 @@
this.label10 = new AntdUI.Label();
this.label4 = new AntdUI.Label();
this.label3 = new AntdUI.Label();
this.buttonOpen = new AntdUI.Button();
this.buttonCZ = new AntdUI.Button();
this.buttonClose = new AntdUI.Button();
this.stackPanel1.SuspendLayout();
this.stackPanel2.SuspendLayout();
this.stackPanel8.SuspendLayout();
@@ -89,6 +89,8 @@
this.header1.DividerShow = true;
this.header1.Dock = System.Windows.Forms.DockStyle.Top;
this.header1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.header1.LocalizationDescription = "FloatButton.Description";
this.header1.LocalizationText = "FloatButton.Text";
this.header1.Location = new System.Drawing.Point(0, 0);
this.header1.Name = "header1";
this.header1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
@@ -127,6 +129,42 @@
this.stackPanel2.TabIndex = 28;
this.stackPanel2.Text = "stackPanel2";
//
// buttonCZ
//
this.buttonCZ.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonCZ.LocalizationText = "reset";
this.buttonCZ.Location = new System.Drawing.Point(165, 3);
this.buttonCZ.Name = "buttonCZ";
this.buttonCZ.Size = new System.Drawing.Size(75, 32);
this.buttonCZ.TabIndex = 7;
this.buttonCZ.Text = "重 置";
this.buttonCZ.Type = AntdUI.TTypeMini.Warn;
this.buttonCZ.WaveSize = 0;
//
// buttonClose
//
this.buttonClose.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonClose.LocalizationText = "close";
this.buttonClose.Location = new System.Drawing.Point(84, 3);
this.buttonClose.Name = "buttonClose";
this.buttonClose.Size = new System.Drawing.Size(75, 32);
this.buttonClose.TabIndex = 6;
this.buttonClose.Text = "关 闭";
this.buttonClose.Type = AntdUI.TTypeMini.Error;
this.buttonClose.WaveSize = 0;
//
// buttonOpen
//
this.buttonOpen.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonOpen.LocalizationText = "open";
this.buttonOpen.Location = new System.Drawing.Point(3, 3);
this.buttonOpen.Name = "buttonOpen";
this.buttonOpen.Size = new System.Drawing.Size(75, 32);
this.buttonOpen.TabIndex = 5;
this.buttonOpen.Text = "打 开";
this.buttonOpen.Type = AntdUI.TTypeMini.Success;
this.buttonOpen.WaveSize = 0;
//
// stackPanel8
//
this.stackPanel8.Controls.Add(this.switch_enabled);
@@ -340,6 +378,7 @@
// label11
//
this.label11.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.label11.LocalizationText = "button_option";
this.label11.Location = new System.Drawing.Point(3, 147);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(744, 24);
@@ -561,6 +600,7 @@
// label4
//
this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.label4.LocalizationText = "control_option";
this.label4.Location = new System.Drawing.Point(3, 3);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(744, 24);
@@ -571,6 +611,7 @@
//
this.label3.Dock = System.Windows.Forms.DockStyle.Top;
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.label3.LocalizationText = "FloatButton.Tip";
this.label3.Location = new System.Drawing.Point(0, 74);
this.label3.Name = "label3";
this.label3.Padding = new System.Windows.Forms.Padding(0, 0, 0, 6);
@@ -578,39 +619,6 @@
this.label3.TabIndex = 4;
this.label3.Text = "FloatButton没有工具箱控件,使用代码方式调用。";
//
// buttonOpen
//
this.buttonOpen.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonOpen.Location = new System.Drawing.Point(3, 3);
this.buttonOpen.Name = "buttonOpen";
this.buttonOpen.Size = new System.Drawing.Size(75, 32);
this.buttonOpen.TabIndex = 5;
this.buttonOpen.Text = "打 开";
this.buttonOpen.Type = AntdUI.TTypeMini.Success;
this.buttonOpen.WaveSize = 0;
//
// buttonCZ
//
this.buttonCZ.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonCZ.Location = new System.Drawing.Point(165, 3);
this.buttonCZ.Name = "buttonCZ";
this.buttonCZ.Size = new System.Drawing.Size(75, 32);
this.buttonCZ.TabIndex = 7;
this.buttonCZ.Text = "重 置";
this.buttonCZ.Type = AntdUI.TTypeMini.Warn;
this.buttonCZ.WaveSize = 0;
//
// buttonClose
//
this.buttonClose.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonClose.Location = new System.Drawing.Point(84, 3);
this.buttonClose.Name = "buttonClose";
this.buttonClose.Size = new System.Drawing.Size(75, 32);
this.buttonClose.TabIndex = 6;
this.buttonClose.Text = "关 闭";
this.buttonClose.Type = AntdUI.TTypeMini.Error;
this.buttonClose.WaveSize = 0;
//
// FloatButtonDemo
//
this.Controls.Add(this.stackPanel1);
+6 -6
View File
@@ -104,9 +104,9 @@ namespace AntdUIDemo.Views
new FloatButton.ConfigBtn("button1","",true)
{
// isSvg设置为true,text参数会赋值给IconSvg,否则赋值给Text,所以需要单独设置Text
Text = "SVG图片",
Text = "SVG Picture",
IconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M511.878001 1023.989c-62.999385 0-124.098788-11.699886-181.698225-34.999658-55.699456-22.49978-105.798967-54.499468-148.798547-95.599067-43.099579-40.9996-76.899249-88.899132-100.599018-142.198611-24.59976-55.29946-36.999639-114.098886-36.999639-174.698294 0-76.79925 20.699798-152.498511 59.899415-219.197859 37.799631-64.099374 92.299099-119.098837 157.498462-158.598451 14.699856-8.999912 33.899669-4.299958 42.899581 10.499897 8.999912 14.699856 4.299958 33.899669-10.499897 42.899581-56.399449 34.199666-103.498989 81.599203-136.19867 137.098661-33.599672 56.999443-51.1995 121.798811-51.1995 187.39817 0 102.498999 41.99959 199.098056 118.298845 271.697347 76.699251 73.099286 178.798254 113.298894 287.497192 113.298893s210.797941-40.299606 287.497193-113.298893c76.299255-72.799289 118.298845-169.198348 118.298844-271.797346 0-130.298728-68.699329-250.797551-183.798205-322.296852-14.599857-9.099911-19.099813-28.299724-9.999902-42.99958 9.099911-14.599857 28.299724-19.099813 42.99958-9.999903 64.099374 39.799611 117.498853 94.599076 154.59849 158.398453 38.399625 66.099354 58.699427 140.998623 58.699427 217.09788 0 60.599408-12.499878 119.398834-36.999639 174.698294-23.699769 53.299479-57.499438 101.199012-100.599017 142.198612-42.99958 40.899601-93.099091 73.099286-148.798547 95.599066-57.799436 23.099774-118.998838 34.79966-181.998223 34.79966zM511.878001 506.394055c-17.199832 0-31.199695-13.899864-31.199695-31.199696v-443.995664c0-17.199832 13.899864-31.199695 31.199695-31.199695 17.199832 0 31.199695 13.899864 31.199696 31.199695v443.895665c0.099999 17.199832-13.999863 31.299694-31.199696 31.299695z\"></path></svg>",
Tooltip = "SVG图片按钮",
Tooltip = "SVG Button",
Round = switch_round.Checked,
Type = (TTypeMini)select_type.SelectedValue,
Radius = (int)input_radius.Value,
@@ -119,8 +119,8 @@ namespace AntdUIDemo.Views
// 使用资源图片
new FloatButton.ConfigBtn("button2", Properties.Resources.关闭)
{
Text = "资源图片",
Tooltip = "资源图片按钮",
Text = "Resource Picture",
Tooltip = "Resource Picture Button",
Round = switch_round.Checked,
Type = (TTypeMini)select_type.SelectedValue,
Radius = (int)input_radius.Value,
@@ -131,9 +131,9 @@ namespace AntdUIDemo.Views
Loading = switch_loading.Checked,
},
// 使用文本
new FloatButton.ConfigBtn("button3", "文本")
new FloatButton.ConfigBtn("button3", "Text")
{
Tooltip = "文本按钮",
Tooltip = "Text Button",
Round = switch_round.Checked,
Type = (TTypeMini)select_type.SelectedValue,
Radius = (int)input_radius.Value,
+6 -1
View File
@@ -47,6 +47,8 @@
this.header1.DividerShow = true;
this.header1.Dock = System.Windows.Forms.DockStyle.Top;
this.header1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.header1.LocalizationDescription = "Icon.Description";
this.header1.LocalizationText = "Icon.Text";
this.header1.Location = new System.Drawing.Point(0, 0);
this.header1.Name = "header1";
this.header1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 10);
@@ -102,9 +104,11 @@
this.txt_search.AllowClear = true;
this.txt_search.Dock = System.Windows.Forms.DockStyle.Right;
this.txt_search.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
this.txt_search.LocalizationPlaceholderText = "search";
this.txt_search.LocalizationText = "";
this.txt_search.Location = new System.Drawing.Point(420, 0);
this.txt_search.Name = "txt_search";
this.txt_search.PlaceholderText = "输入关键字搜索...";
this.txt_search.PlaceholderText = "搜索";
this.txt_search.PrefixSvg = "SearchOutlined";
this.txt_search.Size = new System.Drawing.Size(324, 38);
this.txt_search.TabIndex = 19;
@@ -113,6 +117,7 @@
//
this.label3.Dock = System.Windows.Forms.DockStyle.Top;
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.label3.LocalizationText = "Icon.Tip";
this.label3.Location = new System.Drawing.Point(0, 74);
this.label3.Name = "label3";
this.label3.Padding = new System.Windows.Forms.Padding(10, 0, 10, 6);
+34 -15
View File
@@ -18,6 +18,13 @@ namespace AntdUIDemo.Views
BindEventHandler();
}
// 处理父窗体发来的事件
public void OnLanguageChanged(object sender, EventArgs e)
{
//global
InitData();
}
private void BindEventHandler()
{
segmented1.SelectIndexChanged += segmented1_SelectIndexChanged;
@@ -45,50 +52,60 @@ namespace AntdUIDemo.Views
vpanel.Items.Clear();
txt_search.Text = "";
vpanel.Items.AddRange(svgs);
//global
segmented1.Items[0].Text = AntdUI.Localization.Get("outlined", "线框风格");
segmented1.Items[1].Text = AntdUI.Localization.Get("filled", "实底风格");
}
Dictionary<string, List<VItem>> GetData()
{
var dir = new Dictionary<string, List<VItem>>(AntdUI.SvgDb.Custom.Count);
var tmp = new List<VItem>(AntdUI.SvgDb.Custom.Count);
string directionalicon = AntdUI.Localization.Get("directionalicon", "方向性图标");
string suggestionicon = AntdUI.Localization.Get("suggestionicon", "提示建议性图标");
string editingicon = AntdUI.Localization.Get("editingicon", "编辑类图标");
string dataicon = AntdUI.Localization.Get("dataicon", "数据类图标");
string brand = AntdUI.Localization.Get("brand", "品牌和标识");
string universal = AntdUI.Localization.Get("universal", "网站通用图标");
if (segmented1.SelectIndex == 0)
{
foreach (var it in AntdUI.SvgDb.Custom)
{
if (it.Key == "QuestionOutlined")
{
dir.Add("方向性图标", new List<VItem>(tmp));
dir.Add(directionalicon, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "EditOutlined")
{
dir.Add("提示建议性图标", new List<VItem>(tmp));
dir.Add(suggestionicon, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "AreaChartOutlined")
{
dir.Add("编辑类图标", new List<VItem>(tmp));
dir.Add(editingicon, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "AndroidOutlined")
{
dir.Add("数据类图标", new List<VItem>(tmp));
dir.Add(dataicon, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "AccountBookOutlined")
{
dir.Add("品牌和标识", new List<VItem>(tmp));
dir.Add(brand, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "StepBackwardFilled")
{
dir.Add("网站通用图标", new List<VItem>(tmp));
dir.Add(universal, new List<VItem>(tmp));
tmp.Clear();
return dir;
}
tmp.Add(new VItem(it.Key, it.Value));
}
dir.Add("网站通用图标", new List<VItem>(tmp));
dir.Add(universal, new List<VItem>(tmp));
tmp.Clear();
}
else
@@ -99,32 +116,32 @@ namespace AntdUIDemo.Views
if (it.Key == "StepBackwardFilled") isadd = true;
else if (it.Key == "QuestionCircleFilled")
{
dir.Add("方向性图标", new List<VItem>(tmp));
dir.Add(directionalicon, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "EditFilled")
{
dir.Add("提示建议性图标", new List<VItem>(tmp));
dir.Add(suggestionicon, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "PieChartFilled")
{
dir.Add("编辑类图标", new List<VItem>(tmp));
dir.Add(editingicon, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "AndroidFilled")
{
dir.Add("数据类图标", new List<VItem>(tmp));
dir.Add(dataicon, new List<VItem>(tmp));
tmp.Clear();
}
else if (it.Key == "AccountBookFilled")
{
dir.Add("品牌和标识", new List<VItem>(tmp));
dir.Add(brand, new List<VItem>(tmp));
tmp.Clear();
}
if (isadd) tmp.Add(new VItem(it.Key, it.Value));
}
dir.Add("网站通用图标", new List<VItem>(tmp));
dir.Add(universal, new List<VItem>(tmp));
tmp.Clear();
}
return dir;
@@ -219,10 +236,12 @@ namespace AntdUIDemo.Views
private void vpanel_ItemClick(object sender, AntdUI.VirtualItemEventArgs e)
{
string copysuccess = AntdUI.Localization.Get("copysuccess", "复制成功");
string copyfail = AntdUI.Localization.Get("copyfail", "复制失败");
if (e.Item is VItem item)
{
if (AntdUI.Helper.ClipboardSetText(this, item.Key)) AntdUI.Message.success(window, item.Key + " 复制成功");
else AntdUI.Message.error(window, item.Key + " 复制失败");
if (AntdUI.Helper.ClipboardSetText(this, item.Key)) AntdUI.Message.success(window, item.Key + " " + copysuccess);
else AntdUI.Message.error(window, item.Key + " " + copyfail);
}
}
+18 -12
View File
@@ -73,6 +73,7 @@
this.tabs.Name = "tabs";
this.tabs.Pages.Add(this.tabPage1);
this.tabs.Pages.Add(this.tabPage2);
this.tabs.SelectedIndex = 1;
this.tabs.Size = new System.Drawing.Size(598, 396);
this.tabs.Style = styleLine1;
this.tabs.TabIndex = 0;
@@ -82,7 +83,7 @@
//
this.tabPage1.Controls.Add(this.stackPanel1);
this.tabPage1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F);
this.tabPage1.Location = new System.Drawing.Point(90, 6);
this.tabPage1.Location = new System.Drawing.Point(-502, -384);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(502, 384);
this.tabPage1.TabIndex = 0;
@@ -115,7 +116,7 @@
//
this.switch_scrollbar.CheckedText = "";
this.switch_scrollbar.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.switch_scrollbar.Location = new System.Drawing.Point(129, 3);
this.switch_scrollbar.Location = new System.Drawing.Point(189, 3);
this.switch_scrollbar.Name = "switch_scrollbar";
this.switch_scrollbar.Size = new System.Drawing.Size(60, 26);
this.switch_scrollbar.TabIndex = 1;
@@ -125,9 +126,10 @@
//
// label4
//
this.label4.LocalizationText = "scrollbarhide";
this.label4.Location = new System.Drawing.Point(3, 3);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(120, 26);
this.label4.Size = new System.Drawing.Size(180, 26);
this.label4.TabIndex = 0;
this.label4.Text = "隐藏滚动条";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -147,7 +149,7 @@
this.switch_shadow.Checked = true;
this.switch_shadow.CheckedText = "";
this.switch_shadow.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.switch_shadow.Location = new System.Drawing.Point(129, 3);
this.switch_shadow.Location = new System.Drawing.Point(189, 3);
this.switch_shadow.Name = "switch_shadow";
this.switch_shadow.Size = new System.Drawing.Size(60, 26);
this.switch_shadow.TabIndex = 1;
@@ -157,9 +159,10 @@
//
// label3
//
this.label3.LocalizationText = "shadowon";
this.label3.Location = new System.Drawing.Point(3, 3);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(120, 26);
this.label3.Size = new System.Drawing.Size(180, 26);
this.label3.TabIndex = 0;
this.label3.Text = "启用阴影";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -179,7 +182,7 @@
this.switch_animation.Checked = true;
this.switch_animation.CheckedText = "";
this.switch_animation.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.switch_animation.Location = new System.Drawing.Point(129, 3);
this.switch_animation.Location = new System.Drawing.Point(189, 3);
this.switch_animation.Name = "switch_animation";
this.switch_animation.Size = new System.Drawing.Size(60, 26);
this.switch_animation.TabIndex = 1;
@@ -189,9 +192,10 @@
//
// label2
//
this.label2.LocalizationText = "animationon";
this.label2.Location = new System.Drawing.Point(3, 3);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(120, 26);
this.label2.Size = new System.Drawing.Size(180, 26);
this.label2.TabIndex = 0;
this.label2.Text = "开启动画";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -200,7 +204,7 @@
//
this.tabPage2.Controls.Add(this.stackPanel6);
this.tabPage2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tabPage2.Location = new System.Drawing.Point(-502, -384);
this.tabPage2.Location = new System.Drawing.Point(90, 6);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(502, 384);
this.tabPage2.TabIndex = 0;
@@ -230,7 +234,7 @@
//
// input_offset
//
this.input_offset.Location = new System.Drawing.Point(129, 3);
this.input_offset.Location = new System.Drawing.Point(189, 3);
this.input_offset.Name = "input_offset";
this.input_offset.Size = new System.Drawing.Size(60, 26);
this.input_offset.TabIndex = 1;
@@ -239,9 +243,10 @@
//
// label6
//
this.label6.LocalizationText = "windowOffsetXY";
this.label6.Location = new System.Drawing.Point(3, 3);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(120, 26);
this.label6.Size = new System.Drawing.Size(180, 26);
this.label6.TabIndex = 0;
this.label6.Text = "边界偏移量";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -260,7 +265,7 @@
//
this.switch_showinwindow.CheckedText = "";
this.switch_showinwindow.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.switch_showinwindow.Location = new System.Drawing.Point(129, 3);
this.switch_showinwindow.Location = new System.Drawing.Point(189, 3);
this.switch_showinwindow.Name = "switch_showinwindow";
this.switch_showinwindow.Size = new System.Drawing.Size(60, 26);
this.switch_showinwindow.TabIndex = 1;
@@ -270,9 +275,10 @@
//
// label5
//
this.label5.LocalizationText = "showinwindow";
this.label5.Location = new System.Drawing.Point(3, 3);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(120, 26);
this.label5.Size = new System.Drawing.Size(180, 26);
this.label5.TabIndex = 0;
this.label5.Text = "窗口内弹出";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+9 -2
View File
@@ -37,6 +37,11 @@ namespace AntdUIDemo.Controls
switch_scrollbar.Checked = Config.ScrollBarHide;
switch_showinwindow.Checked = Config.ShowInWindow;
input_offset.Value = Config.NoticeWindowOffsetXY;
//global
tabs.Pages[0].Text = AntdUI.Localization.Get("baseset", "基本设置");
tabs.Pages[1].Text = AntdUI.Localization.Get("messageconfig", "消息配置");
}
#region 事件
@@ -53,8 +58,10 @@ namespace AntdUIDemo.Controls
private void Switch_showinwindow_CheckedChanged(object sender, BoolEventArgs e)
{
AntdUI.Config.ShowInWindow = e.Value;
AntdUI.Message.success(Window, "切换成功!", autoClose: 1);
AntdUI.Notification.success(Window, "提示", "切换成功!", autoClose: 1);
string text = AntdUI.Localization.Get("switchsuccess", "切换成功!");
string tip = AntdUI.Localization.Get("tip", "提示");
AntdUI.Message.success(Window, text, autoClose: 1);
AntdUI.Notification.success(Window, tip, text, autoClose: 1);
}
private void Switch_scrollbar_CheckedChanged(object sender, BoolEventArgs e)
+1 -1
View File
@@ -35,13 +35,13 @@
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 20F);
this.label1.LocalizationText = "welcome";
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(750, 150);
this.label1.TabIndex = 0;
this.label1.Text = "欢迎使用 AntdUI Demo";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label1.TooltipConfig = null;
//
// Wellcome
//