* UIComboTreeView: 修改下拉框全选按钮跟随主题,修改一处内置国际化翻译
This commit is contained in:
parent
1e03aed0a7
commit
759f6f0901
@ -229,6 +229,8 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
public static string Open = "打开";
|
public static string Open = "打开";
|
||||||
public static string Save = "保存";
|
public static string Save = "保存";
|
||||||
|
|
||||||
|
public static string All = "全部";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -290,6 +292,8 @@ namespace Sunny.UI
|
|||||||
UILocalize.Open = "Open";
|
UILocalize.Open = "Open";
|
||||||
UILocalize.Save = "Save";
|
UILocalize.Save = "Save";
|
||||||
|
|
||||||
|
UILocalize.All = "All";
|
||||||
|
|
||||||
UIStyles.Translate();
|
UIStyles.Translate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,6 +352,8 @@ namespace Sunny.UI
|
|||||||
UILocalize.Open = "打开";
|
UILocalize.Open = "打开";
|
||||||
UILocalize.Save = "保存";
|
UILocalize.Save = "保存";
|
||||||
|
|
||||||
|
UILocalize.All = "全部";
|
||||||
|
|
||||||
UIStyles.Translate();
|
UIStyles.Translate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,121 +54,111 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
btnOK.Text = UILocalize.OK;
|
btnOK.Text = UILocalize.OK;
|
||||||
btnCancel.Text = UILocalize.Cancel;
|
btnCancel.Text = UILocalize.Cancel;
|
||||||
|
uiCheckBox1.Text = UILocalize.All;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.treeView = new Sunny.UI.UITreeView();
|
treeView = new UITreeView();
|
||||||
this.panel = new Sunny.UI.UIPanel();
|
panel = new UIPanel();
|
||||||
this.btnCancel = new Sunny.UI.UISymbolButton();
|
uiCheckBox1 = new UICheckBox();
|
||||||
this.btnOK = new Sunny.UI.UISymbolButton();
|
btnCancel = new UISymbolButton();
|
||||||
this.uiCheckBox1 = new Sunny.UI.UICheckBox();
|
btnOK = new UISymbolButton();
|
||||||
this.panel.SuspendLayout();
|
panel.SuspendLayout();
|
||||||
this.SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// treeView
|
// treeView
|
||||||
//
|
//
|
||||||
this.treeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
treeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
this.treeView.FillColor = System.Drawing.Color.White;
|
treeView.FillColor = System.Drawing.Color.White;
|
||||||
this.treeView.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
treeView.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
this.treeView.LineColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
|
treeView.LineColor = System.Drawing.Color.FromArgb(48, 48, 48);
|
||||||
this.treeView.Location = new System.Drawing.Point(0, 0);
|
treeView.Location = new System.Drawing.Point(0, 0);
|
||||||
this.treeView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
treeView.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.treeView.MinimumSize = new System.Drawing.Size(1, 1);
|
treeView.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.treeView.Name = "treeView";
|
treeView.Name = "treeView";
|
||||||
this.treeView.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
treeView.RadiusSides = UICornerRadiusSides.None;
|
||||||
this.treeView.ShowText = false;
|
treeView.ScrollBarStyleInherited = false;
|
||||||
this.treeView.Size = new System.Drawing.Size(250, 176);
|
treeView.ShowText = false;
|
||||||
this.treeView.TabIndex = 0;
|
treeView.Size = new System.Drawing.Size(250, 176);
|
||||||
this.treeView.Text = "uiTreeView1";
|
treeView.TabIndex = 0;
|
||||||
this.treeView.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
treeView.Text = "uiTreeView1";
|
||||||
this.treeView.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
|
treeView.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
this.treeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.TreeView_NodeMouseClick);
|
treeView.NodeMouseClick += TreeView_NodeMouseClick;
|
||||||
//
|
//
|
||||||
// panel
|
// panel
|
||||||
//
|
//
|
||||||
this.panel.Controls.Add(this.uiCheckBox1);
|
panel.Controls.Add(uiCheckBox1);
|
||||||
this.panel.Controls.Add(this.btnCancel);
|
panel.Controls.Add(btnCancel);
|
||||||
this.panel.Controls.Add(this.btnOK);
|
panel.Controls.Add(btnOK);
|
||||||
this.panel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
panel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
this.panel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
panel.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
this.panel.Location = new System.Drawing.Point(0, 176);
|
panel.Location = new System.Drawing.Point(0, 176);
|
||||||
this.panel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
panel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.panel.MinimumSize = new System.Drawing.Size(1, 1);
|
panel.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.panel.Name = "panel";
|
panel.Name = "panel";
|
||||||
this.panel.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
panel.RadiusSides = UICornerRadiusSides.None;
|
||||||
this.panel.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
panel.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom;
|
||||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
panel.Size = new System.Drawing.Size(250, 44);
|
||||||
this.panel.Size = new System.Drawing.Size(250, 44);
|
panel.TabIndex = 1;
|
||||||
this.panel.TabIndex = 1;
|
panel.Text = null;
|
||||||
this.panel.Text = null;
|
panel.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||||
this.panel.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
panel.Visible = false;
|
||||||
this.panel.Visible = false;
|
|
||||||
this.panel.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
|
|
||||||
//
|
|
||||||
// btnCancel
|
|
||||||
//
|
|
||||||
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
|
|
||||||
this.btnCancel.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80)))));
|
|
||||||
this.btnCancel.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80)))));
|
|
||||||
this.btnCancel.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(115)))), ((int)(((byte)(115)))));
|
|
||||||
this.btnCancel.FillPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
|
||||||
this.btnCancel.FillSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
|
||||||
this.btnCancel.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
|
||||||
this.btnCancel.Location = new System.Drawing.Point(159, 8);
|
|
||||||
this.btnCancel.MinimumSize = new System.Drawing.Size(1, 1);
|
|
||||||
this.btnCancel.Name = "btnCancel";
|
|
||||||
this.btnCancel.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(80)))), ((int)(((byte)(80)))));
|
|
||||||
this.btnCancel.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(115)))), ((int)(((byte)(115)))));
|
|
||||||
this.btnCancel.RectPressColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
|
||||||
this.btnCancel.RectSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
|
|
||||||
this.btnCancel.Size = new System.Drawing.Size(80, 29);
|
|
||||||
this.btnCancel.Style = Sunny.UI.UIStyle.Red;
|
|
||||||
this.btnCancel.StyleCustomMode = true;
|
|
||||||
this.btnCancel.Symbol = 61453;
|
|
||||||
this.btnCancel.TabIndex = 1;
|
|
||||||
this.btnCancel.Text = "取消";
|
|
||||||
this.btnCancel.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
|
|
||||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
|
||||||
//
|
|
||||||
// btnOK
|
|
||||||
//
|
|
||||||
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
|
|
||||||
this.btnOK.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
|
||||||
this.btnOK.Location = new System.Drawing.Point(70, 8);
|
|
||||||
this.btnOK.MinimumSize = new System.Drawing.Size(1, 1);
|
|
||||||
this.btnOK.Name = "btnOK";
|
|
||||||
this.btnOK.Size = new System.Drawing.Size(80, 29);
|
|
||||||
this.btnOK.TabIndex = 0;
|
|
||||||
this.btnOK.Text = "确定";
|
|
||||||
this.btnOK.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
|
|
||||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
|
||||||
//
|
//
|
||||||
// uiCheckBox1
|
// uiCheckBox1
|
||||||
//
|
//
|
||||||
this.uiCheckBox1.BackColor = System.Drawing.Color.Transparent;
|
uiCheckBox1.BackColor = System.Drawing.Color.Transparent;
|
||||||
this.uiCheckBox1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
uiCheckBox1.Font = new System.Drawing.Font("宋体", 12F);
|
||||||
this.uiCheckBox1.Location = new System.Drawing.Point(3, 8);
|
uiCheckBox1.ForeColor = System.Drawing.Color.FromArgb(48, 48, 48);
|
||||||
this.uiCheckBox1.MinimumSize = new System.Drawing.Size(1, 1);
|
uiCheckBox1.Location = new System.Drawing.Point(3, 8);
|
||||||
this.uiCheckBox1.Name = "uiCheckBox1";
|
uiCheckBox1.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
this.uiCheckBox1.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0);
|
uiCheckBox1.Name = "uiCheckBox1";
|
||||||
this.uiCheckBox1.Size = new System.Drawing.Size(64, 29);
|
uiCheckBox1.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0);
|
||||||
this.uiCheckBox1.TabIndex = 2;
|
uiCheckBox1.Size = new System.Drawing.Size(64, 29);
|
||||||
this.uiCheckBox1.Text = "全选";
|
uiCheckBox1.TabIndex = 2;
|
||||||
this.uiCheckBox1.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
|
uiCheckBox1.Text = "全选";
|
||||||
this.uiCheckBox1.CheckedChanged += new System.EventHandler(this.uiCheckBox1_CheckedChanged);
|
uiCheckBox1.CheckedChanged += uiCheckBox1_CheckedChanged;
|
||||||
|
//
|
||||||
|
// btnCancel
|
||||||
|
//
|
||||||
|
btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||||
|
btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||||
|
btnCancel.Font = new System.Drawing.Font("宋体", 10.5F);
|
||||||
|
btnCancel.Location = new System.Drawing.Point(159, 8);
|
||||||
|
btnCancel.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
|
btnCancel.Name = "btnCancel";
|
||||||
|
btnCancel.Size = new System.Drawing.Size(80, 29);
|
||||||
|
btnCancel.StyleCustomMode = true;
|
||||||
|
btnCancel.Symbol = 361453;
|
||||||
|
btnCancel.SymbolSize = 22;
|
||||||
|
btnCancel.TabIndex = 1;
|
||||||
|
btnCancel.Text = "取消";
|
||||||
|
btnCancel.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||||||
|
btnCancel.Click += btnCancel_Click;
|
||||||
|
//
|
||||||
|
// btnOK
|
||||||
|
//
|
||||||
|
btnOK.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||||
|
btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||||
|
btnOK.Font = new System.Drawing.Font("宋体", 10.5F);
|
||||||
|
btnOK.Location = new System.Drawing.Point(70, 8);
|
||||||
|
btnOK.MinimumSize = new System.Drawing.Size(1, 1);
|
||||||
|
btnOK.Name = "btnOK";
|
||||||
|
btnOK.Size = new System.Drawing.Size(80, 29);
|
||||||
|
btnOK.SymbolSize = 22;
|
||||||
|
btnOK.TabIndex = 0;
|
||||||
|
btnOK.Text = "确定";
|
||||||
|
btnOK.TipsFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
|
||||||
|
btnOK.Click += btnOK_Click;
|
||||||
//
|
//
|
||||||
// UIComboTreeViewItem
|
// UIComboTreeViewItem
|
||||||
//
|
//
|
||||||
this.Controls.Add(this.treeView);
|
Controls.Add(treeView);
|
||||||
this.Controls.Add(this.panel);
|
Controls.Add(panel);
|
||||||
this.Name = "UIComboTreeViewItem";
|
Name = "UIComboTreeViewItem";
|
||||||
this.Size = new System.Drawing.Size(250, 220);
|
Size = new System.Drawing.Size(250, 220);
|
||||||
this.panel.ResumeLayout(false);
|
panel.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TreeView_NodeMouseClick(object sender, System.Windows.Forms.TreeNodeMouseClickEventArgs e)
|
private void TreeView_NodeMouseClick(object sender, System.Windows.Forms.TreeNodeMouseClickEventArgs e)
|
||||||
@ -192,6 +182,8 @@ namespace Sunny.UI
|
|||||||
treeView.Style = style.Name;
|
treeView.Style = style.Name;
|
||||||
panel.Style = style.Name;
|
panel.Style = style.Name;
|
||||||
btnOK.Style = style.Name;
|
btnOK.Style = style.Name;
|
||||||
|
btnCancel.Style = style.Name;
|
||||||
|
uiCheckBox1.Style = style.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCancel_Click(object sender, System.EventArgs e)
|
private void btnCancel_Click(object sender, System.EventArgs e)
|
||||||
|
@ -1,4 +1,64 @@
|
|||||||
<root>
|
<?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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
* 2023-04-02: V3.3.4 显示清除按钮
|
* 2023-04-02: V3.3.4 显示清除按钮
|
||||||
* 2023-06-12: V3.3.8 修复使用清空按钮后,再次打开下拉框,上次的选择内容还是存在
|
* 2023-06-12: V3.3.8 修复使用清空按钮后,再次打开下拉框,上次的选择内容还是存在
|
||||||
* 2024-03-22: V3.6.5 增加ShowDropDown()
|
* 2024-03-22: V3.6.5 增加ShowDropDown()
|
||||||
|
* 2024-07-13: V3.6.7 修改下拉框全选按钮跟随主题,修改一处内置国际化翻译
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user