+ Demo增加字体图标界面

This commit is contained in:
Sunny 2023-12-08 20:45:53 +08:00
parent 441d9dac8b
commit 0a05dd4312
7 changed files with 723 additions and 5 deletions

Binary file not shown.

View File

@ -89,9 +89,12 @@ namespace Sunny.UI.Demo
uiNavBar1.CreateChildNode(uiNavBar1.Nodes[4], style.DisplayText(), style.Value());
}
var node = uiNavBar1.CreateChildNode(uiNavBar1.Nodes[4], "多彩主题", UIStyle.Colorful.Value());
var node = uiNavBar1.CreateChildNode(uiNavBar1.Nodes[4], "字体图标", 99999);
uiNavBar1.SetNodeSymbol(node, 558426);
node = uiNavBar1.CreateChildNode(uiNavBar1.Nodes[4], "多彩主题", UIStyle.Colorful.Value());
uiNavBar1.SetNodeSymbol(node, 558295);
//左侧导航主节点关联页面
uiNavMenu1.CreateNode(AddPage(new FSymbols()));
uiNavMenu1.CreateNode(AddPage(new FColorful()));
//直接增加一个页面,不在左侧列表显示
@ -136,7 +139,7 @@ namespace Sunny.UI.Demo
{
case 4:
UIStyle style = (UIStyle)pageIndex;
if (style != UIStyle.Colorful)
if (pageIndex < UIStyle.Colorful.Value())
StyleManager.Style = style;
else
uiNavMenu1.SelectPage(pageIndex);

430
SunnyUI.Demo/Forms/FSymbols.Designer.cs generated Normal file
View File

@ -0,0 +1,430 @@
namespace Sunny.UI.Demo
{
partial class FSymbols
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.uiPanel1 = new Sunny.UI.UIPanel();
this.uiSymbolLabel1 = new Sunny.UI.UISymbolLabel();
this.uiSymbolButton2 = new Sunny.UI.UISymbolButton();
this.uiTextBox2 = new Sunny.UI.UITextBox();
this.uiSymbolButton1 = new Sunny.UI.UISymbolButton();
this.uiLabel1 = new Sunny.UI.UILabel();
this.uiTextBox1 = new Sunny.UI.UITextBox();
this.uiTabControl1 = new Sunny.UI.UITabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.lpV6Solid = new Sunny.UI.UIFlowLayoutPanel();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.lpV6Regular = new Sunny.UI.UIFlowLayoutPanel();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.lpV6Brands = new Sunny.UI.UIFlowLayoutPanel();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.lpAwesome = new Sunny.UI.UIFlowLayoutPanel();
this.tabPage5 = new System.Windows.Forms.TabPage();
this.lpElegant = new Sunny.UI.UIFlowLayoutPanel();
this.tabPage6 = new System.Windows.Forms.TabPage();
this.lpMaterialIcons = new Sunny.UI.UIFlowLayoutPanel();
this.tabPage7 = new System.Windows.Forms.TabPage();
this.lblResult = new Sunny.UI.UIFlowLayoutPanel();
this.uiPanel1.SuspendLayout();
this.uiTabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabPage5.SuspendLayout();
this.tabPage6.SuspendLayout();
this.tabPage7.SuspendLayout();
this.SuspendLayout();
//
// uiPanel1
//
this.uiPanel1.Controls.Add(this.uiSymbolLabel1);
this.uiPanel1.Controls.Add(this.uiSymbolButton2);
this.uiPanel1.Controls.Add(this.uiTextBox2);
this.uiPanel1.Controls.Add(this.uiSymbolButton1);
this.uiPanel1.Controls.Add(this.uiLabel1);
this.uiPanel1.Controls.Add(this.uiTextBox1);
this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Top;
this.uiPanel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiPanel1.Location = new System.Drawing.Point(0, 35);
this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiPanel1.Name = "uiPanel1";
this.uiPanel1.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.uiPanel1.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)));
this.uiPanel1.Size = new System.Drawing.Size(1004, 46);
this.uiPanel1.TabIndex = 0;
this.uiPanel1.Text = null;
this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// uiSymbolLabel1
//
this.uiSymbolLabel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolLabel1.Location = new System.Drawing.Point(406, 6);
this.uiSymbolLabel1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiSymbolLabel1.Name = "uiSymbolLabel1";
this.uiSymbolLabel1.Size = new System.Drawing.Size(98, 35);
this.uiSymbolLabel1.TabIndex = 5;
this.uiSymbolLabel1.Text = "图标值";
//
// uiSymbolButton2
//
this.uiSymbolButton2.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiSymbolButton2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolButton2.Location = new System.Drawing.Point(595, 6);
this.uiSymbolButton2.MinimumSize = new System.Drawing.Size(1, 1);
this.uiSymbolButton2.Name = "uiSymbolButton2";
this.uiSymbolButton2.Size = new System.Drawing.Size(100, 35);
this.uiSymbolButton2.Symbol = 557715;
this.uiSymbolButton2.TabIndex = 3;
this.uiSymbolButton2.Text = "复制";
this.uiSymbolButton2.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolButton2.Click += new System.EventHandler(this.uiSymbolButton2_Click);
//
// uiTextBox2
//
this.uiTextBox2.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox2.Location = new System.Drawing.Point(508, 9);
this.uiTextBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox2.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox2.Name = "uiTextBox2";
this.uiTextBox2.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox2.ShowText = false;
this.uiTextBox2.Size = new System.Drawing.Size(80, 29);
this.uiTextBox2.TabIndex = 2;
this.uiTextBox2.Text = "0";
this.uiTextBox2.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
this.uiTextBox2.Type = Sunny.UI.UITextBox.UIEditType.Integer;
this.uiTextBox2.Watermark = "";
//
// uiSymbolButton1
//
this.uiSymbolButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.uiSymbolButton1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolButton1.Location = new System.Drawing.Point(286, 6);
this.uiSymbolButton1.MinimumSize = new System.Drawing.Size(1, 1);
this.uiSymbolButton1.Name = "uiSymbolButton1";
this.uiSymbolButton1.Size = new System.Drawing.Size(100, 35);
this.uiSymbolButton1.Symbol = 61442;
this.uiSymbolButton1.TabIndex = 1;
this.uiSymbolButton1.Text = "查找";
this.uiSymbolButton1.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiSymbolButton1.Click += new System.EventHandler(this.uiSymbolButton1_Click);
//
// uiLabel1
//
this.uiLabel1.AutoSize = true;
this.uiLabel1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiLabel1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
this.uiLabel1.Location = new System.Drawing.Point(19, 15);
this.uiLabel1.Name = "uiLabel1";
this.uiLabel1.Size = new System.Drawing.Size(103, 16);
this.uiLabel1.TabIndex = 4;
this.uiLabel1.Text = "图标英文名称";
this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// uiTextBox1
//
this.uiTextBox1.ButtonSymbol = 361453;
this.uiTextBox1.ButtonSymbolOffset = new System.Drawing.Point(0, 1);
this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.uiTextBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTextBox1.Location = new System.Drawing.Point(129, 9);
this.uiTextBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.uiTextBox1.MinimumSize = new System.Drawing.Size(1, 16);
this.uiTextBox1.Name = "uiTextBox1";
this.uiTextBox1.Padding = new System.Windows.Forms.Padding(5);
this.uiTextBox1.ShowButton = true;
this.uiTextBox1.ShowText = false;
this.uiTextBox1.Size = new System.Drawing.Size(150, 29);
this.uiTextBox1.TabIndex = 0;
this.uiTextBox1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
this.uiTextBox1.Watermark = "";
this.uiTextBox1.ButtonClick += new System.EventHandler(this.uiTextBox1_ButtonClick);
this.uiTextBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.uiTextBox1_KeyDown);
//
// uiTabControl1
//
this.uiTabControl1.Alignment = System.Windows.Forms.TabAlignment.Bottom;
this.uiTabControl1.Controls.Add(this.tabPage1);
this.uiTabControl1.Controls.Add(this.tabPage2);
this.uiTabControl1.Controls.Add(this.tabPage3);
this.uiTabControl1.Controls.Add(this.tabPage4);
this.uiTabControl1.Controls.Add(this.tabPage5);
this.uiTabControl1.Controls.Add(this.tabPage6);
this.uiTabControl1.Controls.Add(this.tabPage7);
this.uiTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.uiTabControl1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
this.uiTabControl1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.uiTabControl1.ItemSize = new System.Drawing.Size(115, 40);
this.uiTabControl1.Location = new System.Drawing.Point(0, 81);
this.uiTabControl1.MainPage = "";
this.uiTabControl1.Name = "uiTabControl1";
this.uiTabControl1.SelectedIndex = 0;
this.uiTabControl1.Size = new System.Drawing.Size(1004, 611);
this.uiTabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.uiTabControl1.TabIndex = 1;
this.uiTabControl1.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
//
// tabPage1
//
this.tabPage1.Controls.Add(this.lpV6Solid);
this.tabPage1.Location = new System.Drawing.Point(0, 0);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(1004, 571);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "FontAwesome V6";
this.tabPage1.UseVisualStyleBackColor = true;
//
// lpV6Solid
//
this.lpV6Solid.Dock = System.Windows.Forms.DockStyle.Fill;
this.lpV6Solid.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lpV6Solid.Location = new System.Drawing.Point(0, 0);
this.lpV6Solid.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.lpV6Solid.MinimumSize = new System.Drawing.Size(1, 1);
this.lpV6Solid.Name = "lpV6Solid";
this.lpV6Solid.Padding = new System.Windows.Forms.Padding(2);
this.lpV6Solid.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.lpV6Solid.ShowText = false;
this.lpV6Solid.Size = new System.Drawing.Size(1004, 571);
this.lpV6Solid.TabIndex = 0;
this.lpV6Solid.Text = "uiFlowLayoutPanel1";
this.lpV6Solid.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.lpV6Regular);
this.tabPage2.Location = new System.Drawing.Point(0, 0);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(200, 60);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "V6 Regular";
this.tabPage2.UseVisualStyleBackColor = true;
//
// lpV6Regular
//
this.lpV6Regular.Dock = System.Windows.Forms.DockStyle.Fill;
this.lpV6Regular.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lpV6Regular.Location = new System.Drawing.Point(0, 0);
this.lpV6Regular.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.lpV6Regular.MinimumSize = new System.Drawing.Size(1, 1);
this.lpV6Regular.Name = "lpV6Regular";
this.lpV6Regular.Padding = new System.Windows.Forms.Padding(2);
this.lpV6Regular.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.lpV6Regular.ShowText = false;
this.lpV6Regular.Size = new System.Drawing.Size(200, 60);
this.lpV6Regular.TabIndex = 1;
this.lpV6Regular.Text = "uiFlowLayoutPanel2";
this.lpV6Regular.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.lpV6Brands);
this.tabPage3.Location = new System.Drawing.Point(0, 0);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(200, 60);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "V6 Brands";
this.tabPage3.UseVisualStyleBackColor = true;
//
// lpV6Brands
//
this.lpV6Brands.Dock = System.Windows.Forms.DockStyle.Fill;
this.lpV6Brands.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lpV6Brands.Location = new System.Drawing.Point(0, 0);
this.lpV6Brands.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.lpV6Brands.MinimumSize = new System.Drawing.Size(1, 1);
this.lpV6Brands.Name = "lpV6Brands";
this.lpV6Brands.Padding = new System.Windows.Forms.Padding(2);
this.lpV6Brands.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.lpV6Brands.ShowText = false;
this.lpV6Brands.Size = new System.Drawing.Size(200, 60);
this.lpV6Brands.TabIndex = 1;
this.lpV6Brands.Text = "uiFlowLayoutPanel3";
this.lpV6Brands.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// tabPage4
//
this.tabPage4.Controls.Add(this.lpAwesome);
this.tabPage4.Location = new System.Drawing.Point(0, 0);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Size = new System.Drawing.Size(200, 60);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "FontAwesome V4";
this.tabPage4.UseVisualStyleBackColor = true;
//
// lpAwesome
//
this.lpAwesome.Dock = System.Windows.Forms.DockStyle.Fill;
this.lpAwesome.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lpAwesome.Location = new System.Drawing.Point(0, 0);
this.lpAwesome.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.lpAwesome.MinimumSize = new System.Drawing.Size(1, 1);
this.lpAwesome.Name = "lpAwesome";
this.lpAwesome.Padding = new System.Windows.Forms.Padding(2);
this.lpAwesome.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.lpAwesome.ShowText = false;
this.lpAwesome.Size = new System.Drawing.Size(200, 60);
this.lpAwesome.TabIndex = 1;
this.lpAwesome.Text = "uiFlowLayoutPanel4";
this.lpAwesome.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// tabPage5
//
this.tabPage5.Controls.Add(this.lpElegant);
this.tabPage5.Location = new System.Drawing.Point(0, 0);
this.tabPage5.Name = "tabPage5";
this.tabPage5.Size = new System.Drawing.Size(200, 60);
this.tabPage5.TabIndex = 4;
this.tabPage5.Text = "ElegantIcons";
this.tabPage5.UseVisualStyleBackColor = true;
//
// lpElegant
//
this.lpElegant.Dock = System.Windows.Forms.DockStyle.Fill;
this.lpElegant.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lpElegant.Location = new System.Drawing.Point(0, 0);
this.lpElegant.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.lpElegant.MinimumSize = new System.Drawing.Size(1, 1);
this.lpElegant.Name = "lpElegant";
this.lpElegant.Padding = new System.Windows.Forms.Padding(2);
this.lpElegant.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.lpElegant.ShowText = false;
this.lpElegant.Size = new System.Drawing.Size(200, 60);
this.lpElegant.TabIndex = 1;
this.lpElegant.Text = "uiFlowLayoutPanel5";
this.lpElegant.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// tabPage6
//
this.tabPage6.Controls.Add(this.lpMaterialIcons);
this.tabPage6.Location = new System.Drawing.Point(0, 0);
this.tabPage6.Name = "tabPage6";
this.tabPage6.Size = new System.Drawing.Size(200, 60);
this.tabPage6.TabIndex = 5;
this.tabPage6.Text = "MaterialIcons";
this.tabPage6.UseVisualStyleBackColor = true;
//
// lpMaterialIcons
//
this.lpMaterialIcons.Dock = System.Windows.Forms.DockStyle.Fill;
this.lpMaterialIcons.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lpMaterialIcons.Location = new System.Drawing.Point(0, 0);
this.lpMaterialIcons.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.lpMaterialIcons.MinimumSize = new System.Drawing.Size(1, 1);
this.lpMaterialIcons.Name = "lpMaterialIcons";
this.lpMaterialIcons.Padding = new System.Windows.Forms.Padding(2);
this.lpMaterialIcons.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.lpMaterialIcons.ShowText = false;
this.lpMaterialIcons.Size = new System.Drawing.Size(200, 60);
this.lpMaterialIcons.TabIndex = 1;
this.lpMaterialIcons.Text = "uiFlowLayoutPanel6";
this.lpMaterialIcons.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// tabPage7
//
this.tabPage7.Controls.Add(this.lblResult);
this.tabPage7.Location = new System.Drawing.Point(0, 0);
this.tabPage7.Name = "tabPage7";
this.tabPage7.Size = new System.Drawing.Size(200, 60);
this.tabPage7.TabIndex = 6;
this.tabPage7.Text = "查找结果";
this.tabPage7.UseVisualStyleBackColor = true;
//
// lblResult
//
this.lblResult.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblResult.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblResult.Location = new System.Drawing.Point(0, 0);
this.lblResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.lblResult.MinimumSize = new System.Drawing.Size(1, 1);
this.lblResult.Name = "lblResult";
this.lblResult.Padding = new System.Windows.Forms.Padding(2);
this.lblResult.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
this.lblResult.ShowText = false;
this.lblResult.Size = new System.Drawing.Size(200, 60);
this.lblResult.TabIndex = 1;
this.lblResult.Text = "uiFlowLayoutPanel7";
this.lblResult.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
//
// FSymbols
//
this.AllowShowTitle = true;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1004, 692);
this.Controls.Add(this.uiTabControl1);
this.Controls.Add(this.uiPanel1);
this.Name = "FSymbols";
this.Padding = new System.Windows.Forms.Padding(0, 35, 0, 0);
this.PageIndex = 99999;
this.ShowTitle = true;
this.Symbol = 558426;
this.Text = "字体图标";
this.Shown += new System.EventHandler(this.FSymbols_Shown);
this.uiPanel1.ResumeLayout(false);
this.uiPanel1.PerformLayout();
this.uiTabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tabPage4.ResumeLayout(false);
this.tabPage5.ResumeLayout(false);
this.tabPage6.ResumeLayout(false);
this.tabPage7.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private UIPanel uiPanel1;
private UISymbolButton uiSymbolButton1;
private UILabel uiLabel1;
private UITextBox uiTextBox1;
private UITabControl uiTabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.TabPage tabPage5;
private System.Windows.Forms.TabPage tabPage6;
private System.Windows.Forms.TabPage tabPage7;
private UIFlowLayoutPanel lpV6Solid;
private UIFlowLayoutPanel lpV6Regular;
private UIFlowLayoutPanel lpV6Brands;
private UIFlowLayoutPanel lpAwesome;
private UIFlowLayoutPanel lpElegant;
private UIFlowLayoutPanel lpMaterialIcons;
private UIFlowLayoutPanel lblResult;
private UISymbolButton uiSymbolButton2;
private UITextBox uiTextBox2;
private UISymbolLabel uiSymbolLabel1;
}
}

View File

@ -0,0 +1,142 @@
using System.Windows.Forms;
namespace Sunny.UI.Demo
{
public partial class FSymbols : UIPage
{
private UISymbolPanel fontAwesomeV4;
private UISymbolPanel elegantIcons;
private UISymbolPanel fontAweSomeV6Regular;
private UISymbolPanel fontAweSomeV6Solid;
private UISymbolPanel fontAweSomeV6Brands;
private UISymbolPanel materialIcons;
private UISymbolPanel searchSymbolPanel;
public FSymbols()
{
InitializeComponent();
fontAwesomeV4 = new UISymbolPanel(typeof(FontAwesomeIcons), UISymbolType.FontAwesomeV4);
elegantIcons = new UISymbolPanel(typeof(FontElegantIcons), UISymbolType.FontAwesomeV4);
fontAweSomeV6Regular = new UISymbolPanel(typeof(FontAweSomeV6Regular), UISymbolType.FontAwesomeV6Regular);
fontAweSomeV6Solid = new UISymbolPanel(typeof(FontAweSomeV6Solid), UISymbolType.FontAwesomeV6Solid);
fontAweSomeV6Brands = new UISymbolPanel(typeof(FontAweSomeV6Brands), UISymbolType.FontAwesomeV6Brands);
materialIcons = new UISymbolPanel(typeof(MaterialIcons), UISymbolType.MaterialIcons);
searchSymbolPanel = new UISymbolPanel();
lpV6Solid.Add(fontAweSomeV6Solid);
lpV6Regular.Add(fontAweSomeV6Regular);
lpV6Brands.Add(fontAweSomeV6Brands);
lpElegant.Add(elegantIcons);
lpMaterialIcons.Add(materialIcons);
lblResult.Add(searchSymbolPanel);
lpAwesome.Add(fontAwesomeV4);
fontAwesomeV4.ValueChanged += CustomSymbolPanel_ValueChanged;
elegantIcons.ValueChanged += CustomSymbolPanel_ValueChanged;
fontAweSomeV6Brands.ValueChanged += CustomSymbolPanel_ValueChanged;
fontAweSomeV6Regular.ValueChanged += CustomSymbolPanel_ValueChanged;
fontAweSomeV6Solid.ValueChanged += CustomSymbolPanel_ValueChanged;
materialIcons.ValueChanged += CustomSymbolPanel_ValueChanged;
searchSymbolPanel.ValueChanged += CustomSymbolPanel_ValueChanged;
}
private void CustomSymbolPanel_ValueChanged(object sender, SymbolValue symbol)
{
uiTextBox2.IntValue = symbol.Value;
uiSymbolLabel1.Symbol = symbol.Value;
ShowInfoTip(symbol.ToString());
}
private void uiSymbolButton1_Click(object sender, System.EventArgs e)
{
string filter = uiTextBox1.Text.Trim();
fontAwesomeV4.Filter = filter;
elegantIcons.Filter = filter;
fontAweSomeV6Regular.Filter = filter;
fontAweSomeV6Solid.Filter = filter;
fontAweSomeV6Brands.Filter = filter;
materialIcons.Filter = filter;
searchSymbolPanel.Clear();
if (filter.IsNullOrEmpty()) return;
for (int i = 0; i < fontAwesomeV4.SymbolCount; i++)
{
var value = fontAwesomeV4.Get(i);
if (value.Name.ToUpper().Contains(filter.ToUpper()))
searchSymbolPanel.Add(value);
}
for (int i = 0; i < elegantIcons.SymbolCount; i++)
{
var value = elegantIcons.Get(i);
if (value.Name.ToUpper().Contains(filter.ToUpper()))
searchSymbolPanel.Add(value);
}
for (int i = 0; i < fontAweSomeV6Regular.SymbolCount; i++)
{
var value = fontAweSomeV6Regular.Get(i);
if (value.Name.ToUpper().Contains(filter.ToUpper()))
searchSymbolPanel.Add(value);
}
for (int i = 0; i < fontAweSomeV6Solid.SymbolCount; i++)
{
var value = fontAweSomeV6Solid.Get(i);
if (value.Name.ToUpper().Contains(filter.ToUpper()))
searchSymbolPanel.Add(value);
}
for (int i = 0; i < fontAweSomeV6Brands.SymbolCount; i++)
{
var value = fontAweSomeV6Brands.Get(i);
if (value.Name.ToUpper().Contains(filter.ToUpper()))
searchSymbolPanel.Add(value);
}
for (int i = 0; i < materialIcons.SymbolCount; i++)
{
var value = materialIcons.Get(i);
if (value.Name.ToUpper().Contains(filter.ToUpper()))
searchSymbolPanel.Add(value);
}
searchSymbolPanel.Invalidate();
uiTabControl1.SelectedTab = tabPage7;
}
private void FSymbols_Shown(object sender, System.EventArgs e)
{
uiTabControl1.SelectedTab = tabPage1;
uiTextBox1.Focus();
}
public override void Init()
{
base.Init();
uiTextBox1.Focus();
searchSymbolPanel.Clear();
}
private void uiSymbolButton2_Click(object sender, System.EventArgs e)
{
Clipboard.SetText(uiTextBox2.Text);
}
private void uiTextBox1_ButtonClick(object sender, System.EventArgs e)
{
uiTextBox1.Text = "";
uiSymbolButton1.PerformClick();
uiTabControl1.SelectedTab = tabPage1;
}
private void uiTextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
uiSymbolButton1.PerformClick();
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
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
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -145,6 +145,12 @@
<Compile Include="Forms\Frames\FCustomMain.Designer.cs">
<DependentUpon>FCustomMain.cs</DependentUpon>
</Compile>
<Compile Include="Forms\FSymbols.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\FSymbols.Designer.cs">
<DependentUpon>FSymbols.cs</DependentUpon>
</Compile>
<Compile Include="Industrial\FSwitch.cs">
<SubType>Form</SubType>
</Compile>
@ -430,6 +436,9 @@
<EmbeddedResource Include="Forms\Frames\FCustomMain.resx">
<DependentUpon>FCustomMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\FSymbols.resx">
<DependentUpon>FSymbols.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Industrial\FLight.resx">
<DependentUpon>FLight.cs</DependentUpon>
</EmbeddedResource>

View File

@ -23,6 +23,20 @@ namespace Sunny.UI
LoadFont(fonttype, symbolType, columnCount);
}
private Color selectedColor = Color.Red;
public Color SelectedColor
{
get => selectedColor;
set
{
if (selectedColor != value)
{
selectedColor = value;
Invalidate();
}
}
}
public void LoadFont(Type fonttype, UISymbolType symbolType, int columnCount = 24)
{
ColumnCount = columnCount;
@ -120,9 +134,9 @@ namespace Sunny.UI
Rectangle rect = new Rectangle(ic * symbolSize, ir * symbolSize, symbolSize, symbolSize);
SymbolValue symbol = Symbols[i];
Color color = Color.Black;
if (Filter.IsValid() && symbol.Name.ToUpper().Contains(Filter.ToUpper())) color = Color.Purple;
if (i == SelectedIndex) color = Color.Red;
Color color = ForeColor;
if (Filter.IsValid() && symbol.Name.ToUpper().Contains(Filter.ToUpper())) color = SelectedColor;
if (i == SelectedIndex) color = SelectedColor;
e.Graphics.DrawFontImage(symbol.Value, 28, color, rect);
}