* UIDatePicker: 选中的年月日标记显示
This commit is contained in:
parent
2ab07bcf0e
commit
bb2673c3ee
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -74,7 +74,7 @@ namespace Sunny.UI
|
||||
this.TopPanel.Controls.Add(this.b1);
|
||||
this.TopPanel.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.TopPanel.FillColor = System.Drawing.Color.White;
|
||||
this.TopPanel.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.TopPanel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.TopPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.TopPanel.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.TopPanel.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
@ -87,6 +87,7 @@ namespace Sunny.UI
|
||||
this.TopPanel.StyleCustomMode = true;
|
||||
this.TopPanel.TabIndex = 0;
|
||||
this.TopPanel.Text = "2020-05-05";
|
||||
this.TopPanel.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.TopPanel.Click += new System.EventHandler(this.TopPanel_Click);
|
||||
//
|
||||
// b4
|
||||
@ -96,7 +97,7 @@ namespace Sunny.UI
|
||||
this.b4.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.b4.FillColor = System.Drawing.Color.White;
|
||||
this.b4.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.b4.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.b4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.b4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.b4.ImageInterval = 0;
|
||||
this.b4.Location = new System.Drawing.Point(427, 4);
|
||||
@ -120,7 +121,7 @@ namespace Sunny.UI
|
||||
this.b3.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.b3.FillColor = System.Drawing.Color.White;
|
||||
this.b3.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.b3.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.b3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.b3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.b3.ImageInterval = 0;
|
||||
this.b3.Location = new System.Drawing.Point(391, 4);
|
||||
@ -143,7 +144,7 @@ namespace Sunny.UI
|
||||
this.b2.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.b2.FillColor = System.Drawing.Color.White;
|
||||
this.b2.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.b2.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.b2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.b2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.b2.ImageInterval = 0;
|
||||
this.b2.Location = new System.Drawing.Point(40, 4);
|
||||
@ -166,7 +167,7 @@ namespace Sunny.UI
|
||||
this.b1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.b1.FillColor = System.Drawing.Color.White;
|
||||
this.b1.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.b1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.b1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.b1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.b1.ImageInterval = 0;
|
||||
this.b1.Location = new System.Drawing.Point(4, 4);
|
||||
@ -190,15 +191,17 @@ namespace Sunny.UI
|
||||
this.TabControl.Controls.Add(this.tabPage3);
|
||||
this.TabControl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.TabControl.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
|
||||
this.TabControl.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.TabControl.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.TabControl.ItemSize = new System.Drawing.Size(150, 40);
|
||||
this.TabControl.Location = new System.Drawing.Point(0, 31);
|
||||
this.TabControl.MainPage = "";
|
||||
this.TabControl.Name = "TabControl";
|
||||
this.TabControl.SelectedIndex = 0;
|
||||
this.TabControl.Size = new System.Drawing.Size(461, 317);
|
||||
this.TabControl.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
|
||||
this.TabControl.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.TabControl.TabIndex = 1;
|
||||
this.TabControl.TabUnSelectedForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(240)))), ((int)(((byte)(240)))));
|
||||
this.TabControl.SelectedIndexChanged += new System.EventHandler(this.TabControl_SelectedIndexChanged);
|
||||
//
|
||||
// tabPage1
|
||||
@ -215,7 +218,7 @@ namespace Sunny.UI
|
||||
//
|
||||
this.p1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.p1.FillColor = System.Drawing.Color.White;
|
||||
this.p1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.p1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.p1.Location = new System.Drawing.Point(0, 0);
|
||||
this.p1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.p1.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
@ -225,8 +228,10 @@ namespace Sunny.UI
|
||||
this.p1.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.p1.TabIndex = 0;
|
||||
this.p1.Text = null;
|
||||
this.p1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.p1.Paint += new System.Windows.Forms.PaintEventHandler(this.p1_Paint);
|
||||
this.p1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.p1_MouseClick);
|
||||
this.p1.MouseLeave += new System.EventHandler(this.p1_MouseLeave);
|
||||
this.p1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.p1_MouseMove);
|
||||
//
|
||||
// tabPage2
|
||||
@ -234,7 +239,7 @@ namespace Sunny.UI
|
||||
this.tabPage2.Controls.Add(this.p2);
|
||||
this.tabPage2.Location = new System.Drawing.Point(0, 40);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Size = new System.Drawing.Size(450, 230);
|
||||
this.tabPage2.Size = new System.Drawing.Size(461, 277);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "tabPage2";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
@ -243,18 +248,20 @@ namespace Sunny.UI
|
||||
//
|
||||
this.p2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.p2.FillColor = System.Drawing.Color.White;
|
||||
this.p2.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.p2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.p2.Location = new System.Drawing.Point(0, 0);
|
||||
this.p2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.p2.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.p2.Name = "p2";
|
||||
this.p2.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.p2.Size = new System.Drawing.Size(450, 230);
|
||||
this.p2.Size = new System.Drawing.Size(461, 277);
|
||||
this.p2.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.p2.TabIndex = 1;
|
||||
this.p2.Text = null;
|
||||
this.p2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.p2.Paint += new System.Windows.Forms.PaintEventHandler(this.p2_Paint);
|
||||
this.p2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.p2_MouseClick);
|
||||
this.p2.MouseLeave += new System.EventHandler(this.p2_MouseLeave);
|
||||
this.p2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.p2_MouseMove);
|
||||
//
|
||||
// tabPage3
|
||||
@ -271,7 +278,7 @@ namespace Sunny.UI
|
||||
//
|
||||
this.p3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.p3.FillColor = System.Drawing.Color.White;
|
||||
this.p3.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.p3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
this.p3.Location = new System.Drawing.Point(0, 0);
|
||||
this.p3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.p3.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
@ -281,8 +288,10 @@ namespace Sunny.UI
|
||||
this.p3.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.p3.TabIndex = 2;
|
||||
this.p3.Text = null;
|
||||
this.p3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.p3.Paint += new System.Windows.Forms.PaintEventHandler(this.p3_Paint);
|
||||
this.p3.MouseClick += new System.Windows.Forms.MouseEventHandler(this.p3_MouseClick);
|
||||
this.p3.MouseLeave += new System.EventHandler(this.p3_MouseLeave);
|
||||
this.p3.MouseMove += new System.Windows.Forms.MouseEventHandler(this.p3_MouseMove);
|
||||
//
|
||||
// UIDateItem
|
||||
@ -547,7 +556,14 @@ namespace Sunny.UI
|
||||
int top = height * (i / 4);
|
||||
|
||||
SizeF sf = e.Graphics.MeasureString(months[i], Font);
|
||||
e.Graphics.DrawString(months[i], Font, i == activeMonth ? PrimaryColor : ForeColor, left + (width - sf.Width) / 2, top + (height - sf.Height) / 2);
|
||||
if (i + 1 == Month)
|
||||
{
|
||||
e.Graphics.DrawString(months[i], Font, PrimaryColor, left + (width - sf.Width) / 2, top + (height - sf.Height) / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Graphics.DrawString(months[i], Font, i == activeMonth ? PrimaryColor : ForeColor, left + (width - sf.Width) / 2, top + (height - sf.Height) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -607,7 +623,7 @@ namespace Sunny.UI
|
||||
Color color = (i == 0 || i == 11) ? Color.DarkGray : ForeColor;
|
||||
if (years[i] != 10000)
|
||||
{
|
||||
e.Graphics.DrawString(years[i].ToString(), Font, i == activeYear ? PrimaryColor : color, left + (width - sf.Width) / 2, top + (height - sf.Height) / 2);
|
||||
e.Graphics.DrawString(years[i].ToString(), Font, (i == activeYear || years[i] == Year) ? PrimaryColor : color, left + (width - sf.Width) / 2, top + (height - sf.Height) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -749,5 +765,23 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
public Color PrimaryColor { get; set; } = UIColor.Blue;
|
||||
|
||||
private void p1_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
activeYear = -1;
|
||||
p1.Invalidate();
|
||||
}
|
||||
|
||||
private void p2_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
activeMonth = -1;
|
||||
p2.Invalidate();
|
||||
}
|
||||
|
||||
private void p3_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
activeDay = -1;
|
||||
p3.Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,64 +1,4 @@
|
||||
<?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.
|
||||
-->
|
||||
<root>
|
||||
<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">
|
||||
|
Loading…
x
Reference in New Issue
Block a user