diff --git a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe index ce12ed1b..465cdd78 100644 Binary files a/SunnyUI.Demo/Bin/SunnyUI.Demo.exe and b/SunnyUI.Demo/Bin/SunnyUI.Demo.exe differ diff --git a/SunnyUI.Demo/FMain.cs b/SunnyUI.Demo/FMain.cs index 41ea7fee..0cd2da88 100644 --- a/SunnyUI.Demo/FMain.cs +++ b/SunnyUI.Demo/FMain.cs @@ -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); diff --git a/SunnyUI.Demo/Forms/FSymbols.Designer.cs b/SunnyUI.Demo/Forms/FSymbols.Designer.cs new file mode 100644 index 00000000..765cf658 --- /dev/null +++ b/SunnyUI.Demo/Forms/FSymbols.Designer.cs @@ -0,0 +1,430 @@ +namespace Sunny.UI.Demo +{ + partial class FSymbols + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + 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; + } +} \ No newline at end of file diff --git a/SunnyUI.Demo/Forms/FSymbols.cs b/SunnyUI.Demo/Forms/FSymbols.cs new file mode 100644 index 00000000..1036c5a1 --- /dev/null +++ b/SunnyUI.Demo/Forms/FSymbols.cs @@ -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(); + } + } + } +} diff --git a/SunnyUI.Demo/Forms/FSymbols.resx b/SunnyUI.Demo/Forms/FSymbols.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/SunnyUI.Demo/Forms/FSymbols.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SunnyUI.Demo/SunnyUI.Demo.csproj b/SunnyUI.Demo/SunnyUI.Demo.csproj index b0831373..1f22a039 100644 --- a/SunnyUI.Demo/SunnyUI.Demo.csproj +++ b/SunnyUI.Demo/SunnyUI.Demo.csproj @@ -145,6 +145,12 @@ FCustomMain.cs + + Form + + + FSymbols.cs + Form @@ -430,6 +436,9 @@ FCustomMain.cs + + FSymbols.cs + FLight.cs diff --git a/SunnyUI/Font/UISymbolPanel.cs b/SunnyUI/Font/UISymbolPanel.cs index 1112162a..190fc0d2 100644 --- a/SunnyUI/Font/UISymbolPanel.cs +++ b/SunnyUI/Font/UISymbolPanel.cs @@ -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); }