* UIDatePicker:重写日期选择界面
+ UITimePicker:新增
This commit is contained in:
parent
3b9d4e03da
commit
2bf4578df7
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
BIN
Bin/SunnyUI.pdb
BIN
Bin/SunnyUI.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
74
SunnyUI.Demo/Controls/FTextBox.Designer.cs
generated
74
SunnyUI.Demo/Controls/FTextBox.Designer.cs
generated
@ -37,25 +37,29 @@
|
||||
this.uiTextBox3 = new Sunny.UI.UITextBox();
|
||||
this.uiComboBox1 = new Sunny.UI.UIComboBox();
|
||||
this.uiComboBox2 = new Sunny.UI.UIComboBox();
|
||||
this._uiDatePicker1 = new Sunny.UI.UIDatePicker();
|
||||
this.uiDatePicker1 = new Sunny.UI.UIDatePicker();
|
||||
this.uiDoubleUpDown1 = new Sunny.UI.UIDoubleUpDown();
|
||||
this.uiLine1 = new Sunny.UI.UILine();
|
||||
this.uiLine2 = new Sunny.UI.UILine();
|
||||
this.uiLine3 = new Sunny.UI.UILine();
|
||||
this.uiLine4 = new Sunny.UI.UILine();
|
||||
this.uiLine5 = new Sunny.UI.UILine();
|
||||
this.uiTimePicker1 = new Sunny.UI.UITimePicker();
|
||||
this.uiLine6 = new Sunny.UI.UILine();
|
||||
this.PagePanel.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// PagePanel
|
||||
//
|
||||
this.PagePanel.Controls.Add(this.uiLine6);
|
||||
this.PagePanel.Controls.Add(this.uiTimePicker1);
|
||||
this.PagePanel.Controls.Add(this.uiLine5);
|
||||
this.PagePanel.Controls.Add(this.uiLine4);
|
||||
this.PagePanel.Controls.Add(this.uiLine3);
|
||||
this.PagePanel.Controls.Add(this.uiLine2);
|
||||
this.PagePanel.Controls.Add(this.uiLine1);
|
||||
this.PagePanel.Controls.Add(this.uiDoubleUpDown1);
|
||||
this.PagePanel.Controls.Add(this._uiDatePicker1);
|
||||
this.PagePanel.Controls.Add(this.uiDatePicker1);
|
||||
this.PagePanel.Controls.Add(this.uiComboBox2);
|
||||
this.PagePanel.Controls.Add(this.uiComboBox1);
|
||||
this.PagePanel.Controls.Add(this.uiLabel3);
|
||||
@ -200,23 +204,23 @@
|
||||
this.uiComboBox2.TabIndex = 12;
|
||||
this.uiComboBox2.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// _uiDatePicker1
|
||||
// uiDatePicker1
|
||||
//
|
||||
this._uiDatePicker1.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList;
|
||||
this._uiDatePicker1.FillColor = System.Drawing.Color.White;
|
||||
this._uiDatePicker1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this._uiDatePicker1.Location = new System.Drawing.Point(30, 294);
|
||||
this._uiDatePicker1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this._uiDatePicker1.MinimumSize = new System.Drawing.Size(63, 0);
|
||||
this._uiDatePicker1.Name = "_uiDatePicker1";
|
||||
this._uiDatePicker1.Padding = new System.Windows.Forms.Padding(0, 0, 30, 0);
|
||||
this._uiDatePicker1.Size = new System.Drawing.Size(150, 29);
|
||||
this._uiDatePicker1.SymbolDropDown = 61555;
|
||||
this._uiDatePicker1.SymbolNormal = 61555;
|
||||
this._uiDatePicker1.TabIndex = 13;
|
||||
this._uiDatePicker1.Text = "2020-04-16";
|
||||
this._uiDatePicker1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this._uiDatePicker1.Value = new System.DateTime(2020, 4, 16, 0, 0, 0, 0);
|
||||
this.uiDatePicker1.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList;
|
||||
this.uiDatePicker1.FillColor = System.Drawing.Color.White;
|
||||
this.uiDatePicker1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.uiDatePicker1.Location = new System.Drawing.Point(30, 294);
|
||||
this.uiDatePicker1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.uiDatePicker1.MinimumSize = new System.Drawing.Size(63, 0);
|
||||
this.uiDatePicker1.Name = "uiDatePicker1";
|
||||
this.uiDatePicker1.Padding = new System.Windows.Forms.Padding(0, 0, 30, 0);
|
||||
this.uiDatePicker1.Size = new System.Drawing.Size(150, 29);
|
||||
this.uiDatePicker1.SymbolDropDown = 61555;
|
||||
this.uiDatePicker1.SymbolNormal = 61555;
|
||||
this.uiDatePicker1.TabIndex = 13;
|
||||
this.uiDatePicker1.Text = "2020-04-16";
|
||||
this.uiDatePicker1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.uiDatePicker1.Value = new System.DateTime(2020, 4, 16, 0, 0, 0, 0);
|
||||
//
|
||||
// uiDoubleUpDown1
|
||||
//
|
||||
@ -258,7 +262,7 @@
|
||||
this.uiLine3.Location = new System.Drawing.Point(30, 260);
|
||||
this.uiLine3.MinimumSize = new System.Drawing.Size(16, 16);
|
||||
this.uiLine3.Name = "uiLine3";
|
||||
this.uiLine3.Size = new System.Drawing.Size(306, 20);
|
||||
this.uiLine3.Size = new System.Drawing.Size(150, 20);
|
||||
this.uiLine3.TabIndex = 22;
|
||||
this.uiLine3.Text = "UIDatePicker";
|
||||
this.uiLine3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
@ -285,6 +289,34 @@
|
||||
this.uiLine5.Text = "UIDoubleUpDown";
|
||||
this.uiLine5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// uiTimePicker1
|
||||
//
|
||||
this.uiTimePicker1.FillColor = System.Drawing.Color.White;
|
||||
this.uiTimePicker1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.uiTimePicker1.Location = new System.Drawing.Point(188, 294);
|
||||
this.uiTimePicker1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.uiTimePicker1.MinimumSize = new System.Drawing.Size(63, 0);
|
||||
this.uiTimePicker1.Name = "uiTimePicker1";
|
||||
this.uiTimePicker1.Padding = new System.Windows.Forms.Padding(0, 0, 30, 0);
|
||||
this.uiTimePicker1.Size = new System.Drawing.Size(150, 29);
|
||||
this.uiTimePicker1.SymbolDropDown = 61555;
|
||||
this.uiTimePicker1.SymbolNormal = 61555;
|
||||
this.uiTimePicker1.TabIndex = 25;
|
||||
this.uiTimePicker1.Text = "uiTimePicker1";
|
||||
this.uiTimePicker1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
this.uiTimePicker1.Value = new System.DateTime(2020, 5, 29, 23, 41, 39, 684);
|
||||
//
|
||||
// uiLine6
|
||||
//
|
||||
this.uiLine6.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.uiLine6.Location = new System.Drawing.Point(188, 260);
|
||||
this.uiLine6.MinimumSize = new System.Drawing.Size(16, 16);
|
||||
this.uiLine6.Name = "uiLine6";
|
||||
this.uiLine6.Size = new System.Drawing.Size(150, 20);
|
||||
this.uiLine6.TabIndex = 26;
|
||||
this.uiLine6.Text = "UITimePicker";
|
||||
this.uiLine6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
||||
//
|
||||
// FTextBox
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
|
||||
@ -307,7 +339,7 @@
|
||||
private UILabel uiLabel1;
|
||||
private UITextBox uiTextBox1;
|
||||
private UIIntegerUpDown uiIntegerUpDown1;
|
||||
private UIDatePicker _uiDatePicker1;
|
||||
private UIDatePicker uiDatePicker1;
|
||||
private UIComboBox uiComboBox2;
|
||||
private UIComboBox uiComboBox1;
|
||||
private UIDoubleUpDown uiDoubleUpDown1;
|
||||
@ -316,5 +348,7 @@
|
||||
private UILine uiLine2;
|
||||
private UILine uiLine1;
|
||||
private UILine uiLine5;
|
||||
private UITimePicker uiTimePicker1;
|
||||
private UILine uiLine6;
|
||||
}
|
||||
}
|
@ -14,6 +14,9 @@ namespace Sunny.UI.Demo
|
||||
public FTextBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
uiDatePicker1.Value = DateTime.Today;
|
||||
uiTimePicker1.Value = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
61
SunnyUI/Controls/DropItem/UIDateTimeItem.Designer.cs
generated
61
SunnyUI/Controls/DropItem/UIDateTimeItem.Designer.cs
generated
@ -1,61 +0,0 @@
|
||||
namespace Sunny.UI
|
||||
{
|
||||
partial class UIDateTimeControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 必需的设计器变量。
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 清理所有正在使用的资源。
|
||||
/// </summary>
|
||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.monthCalendar = new System.Windows.Forms.MonthCalendar();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// monthCalendar
|
||||
//
|
||||
this.monthCalendar.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
this.monthCalendar.Location = new System.Drawing.Point(0, 0);
|
||||
this.monthCalendar.Margin = new System.Windows.Forms.Padding(15, 16, 15, 16);
|
||||
this.monthCalendar.MaxSelectionCount = 1;
|
||||
this.monthCalendar.Name = "monthCalendar";
|
||||
this.monthCalendar.TabIndex = 2;
|
||||
this.monthCalendar.DateChanged += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar_DateChanged);
|
||||
this.monthCalendar.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.monthCalendar_DateSelected);
|
||||
//
|
||||
// UIDateTimeControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.Controls.Add(this.monthCalendar);
|
||||
this.Margin = new System.Windows.Forms.Padding(7, 9, 7, 9);
|
||||
this.Name = "UIDateTimeControl";
|
||||
this.Size = new System.Drawing.Size(220, 180);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MonthCalendar monthCalendar;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
120
SunnyUI/Controls/DropItem/UIDateTimeItem.resx
Normal file
120
SunnyUI/Controls/DropItem/UIDateTimeItem.resx
Normal 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>
|
504
SunnyUI/Controls/DropItem/UITimeItem.cs
Normal file
504
SunnyUI/Controls/DropItem/UITimeItem.cs
Normal file
@ -0,0 +1,504 @@
|
||||
/******************************************************************************
|
||||
* SunnyUI 开源控件库、工具类库、扩展类库、多页面开发框架。
|
||||
* CopyRight (C) 2012-2020 ShenYongHua(沈永华).
|
||||
* QQ群:56829229 QQ:17612584 EMail:SunnyUI@qq.com
|
||||
*
|
||||
* Blog: https://www.cnblogs.com/yhuse
|
||||
* Gitee: https://gitee.com/yhuse/SunnyUI
|
||||
* GitHub: https://github.com/yhuse/SunnyUI
|
||||
*
|
||||
* SunnyUI.dll can be used for free under the GPL-3.0 license.
|
||||
* If you use this code, please keep this note.
|
||||
* 如果您使用此代码,请保留此说明。
|
||||
******************************************************************************
|
||||
* 文件名称: UIDateTimeItem.cs
|
||||
* 文件说明: 时间选择框弹出窗体
|
||||
* 当前版本: V2.2
|
||||
* 创建日期: 2020-05-29
|
||||
*
|
||||
* 2020-05-29: V2.2.5 创建
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
public sealed class UITimeItem : UIDropDownItem
|
||||
{
|
||||
private UILine uiLine1;
|
||||
private UISymbolButton s1;
|
||||
private UISymbolButton m1;
|
||||
private UISymbolButton h1;
|
||||
private UISymbolButton s2;
|
||||
private UISymbolButton m2;
|
||||
private UISymbolButton h2;
|
||||
private UISymbolButton btnOK;
|
||||
private UISymbolButton btnCancel;
|
||||
private UILabel hc;
|
||||
private UILabel mc;
|
||||
private UILabel sc;
|
||||
private UILabel st;
|
||||
private UILabel mt;
|
||||
private UILabel ht;
|
||||
private UILabel sb;
|
||||
private UILabel mb;
|
||||
private UILabel hb;
|
||||
private UILine uiLine2;
|
||||
|
||||
public UITimeItem()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private DateTime time;
|
||||
|
||||
public DateTime Time
|
||||
{
|
||||
get => time;
|
||||
set
|
||||
{
|
||||
time = value;
|
||||
Hour = time.Hour;
|
||||
Minute = time.Minute;
|
||||
Second = time.Second;
|
||||
ShowOther();
|
||||
}
|
||||
}
|
||||
|
||||
private int hour;
|
||||
private int minute;
|
||||
private int second;
|
||||
|
||||
public int Hour
|
||||
{
|
||||
get => hour;
|
||||
set
|
||||
{
|
||||
hour = value;
|
||||
hc.Text = hour.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public int Minute
|
||||
{
|
||||
get => minute;
|
||||
set
|
||||
{
|
||||
minute = value;
|
||||
mc.Text = minute.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public int Second
|
||||
{
|
||||
get => second;
|
||||
set
|
||||
{
|
||||
second = value;
|
||||
sc.Text = second.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowOther()
|
||||
{
|
||||
ht.Text = (hour - 1 + 24).Mod(24).ToString();
|
||||
hb.Text = (hour + 1 + 24).Mod(24).ToString();
|
||||
mt.Text = (minute - 1 + 60).Mod(60).ToString();
|
||||
mb.Text = (minute + 1 + 60).Mod(60).ToString();
|
||||
st.Text = (second - 1 + 60).Mod(60).ToString();
|
||||
sb.Text = (second + 1 + 60).Mod(60).ToString();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.uiLine1 = new Sunny.UI.UILine();
|
||||
this.uiLine2 = new Sunny.UI.UILine();
|
||||
this.s1 = new Sunny.UI.UISymbolButton();
|
||||
this.m1 = new Sunny.UI.UISymbolButton();
|
||||
this.h1 = new Sunny.UI.UISymbolButton();
|
||||
this.s2 = new Sunny.UI.UISymbolButton();
|
||||
this.m2 = new Sunny.UI.UISymbolButton();
|
||||
this.h2 = new Sunny.UI.UISymbolButton();
|
||||
this.btnOK = new Sunny.UI.UISymbolButton();
|
||||
this.btnCancel = new Sunny.UI.UISymbolButton();
|
||||
this.hc = new Sunny.UI.UILabel();
|
||||
this.mc = new Sunny.UI.UILabel();
|
||||
this.sc = new Sunny.UI.UILabel();
|
||||
this.st = new Sunny.UI.UILabel();
|
||||
this.mt = new Sunny.UI.UILabel();
|
||||
this.ht = new Sunny.UI.UILabel();
|
||||
this.sb = new Sunny.UI.UILabel();
|
||||
this.mb = new Sunny.UI.UILabel();
|
||||
this.hb = new Sunny.UI.UILabel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// uiLine1
|
||||
//
|
||||
this.uiLine1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.uiLine1.LineColor = System.Drawing.Color.Silver;
|
||||
this.uiLine1.Location = new System.Drawing.Point(11, 60);
|
||||
this.uiLine1.MinimumSize = new System.Drawing.Size(16, 16);
|
||||
this.uiLine1.Name = "uiLine1";
|
||||
this.uiLine1.Size = new System.Drawing.Size(157, 16);
|
||||
this.uiLine1.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.uiLine1.StyleCustomMode = true;
|
||||
this.uiLine1.TabIndex = 2;
|
||||
//
|
||||
// uiLine2
|
||||
//
|
||||
this.uiLine2.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.uiLine2.LineColor = System.Drawing.Color.Silver;
|
||||
this.uiLine2.Location = new System.Drawing.Point(11, 94);
|
||||
this.uiLine2.MinimumSize = new System.Drawing.Size(16, 16);
|
||||
this.uiLine2.Name = "uiLine2";
|
||||
this.uiLine2.Size = new System.Drawing.Size(157, 16);
|
||||
this.uiLine2.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.uiLine2.StyleCustomMode = true;
|
||||
this.uiLine2.TabIndex = 3;
|
||||
//
|
||||
// s1
|
||||
//
|
||||
this.s1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.s1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.s1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||
this.s1.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.s1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.s1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.s1.ImageInterval = 0;
|
||||
this.s1.Location = new System.Drawing.Point(127, 13);
|
||||
this.s1.Name = "s1";
|
||||
this.s1.Padding = new System.Windows.Forms.Padding(24, 0, 0, 0);
|
||||
this.s1.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.s1.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.s1.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
|
||||
this.s1.Size = new System.Drawing.Size(30, 24);
|
||||
this.s1.Style = Sunny.UI.UIStyle.LightBlue;
|
||||
this.s1.StyleCustomMode = true;
|
||||
this.s1.Symbol = 61702;
|
||||
this.s1.TabIndex = 6;
|
||||
this.s1.Click += new System.EventHandler(this.s1_Click);
|
||||
//
|
||||
// m1
|
||||
//
|
||||
this.m1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.m1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.m1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||
this.m1.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.m1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.m1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.m1.ImageInterval = 0;
|
||||
this.m1.Location = new System.Drawing.Point(74, 13);
|
||||
this.m1.Name = "m1";
|
||||
this.m1.Padding = new System.Windows.Forms.Padding(24, 0, 0, 0);
|
||||
this.m1.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.m1.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.m1.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
|
||||
this.m1.Size = new System.Drawing.Size(30, 24);
|
||||
this.m1.Style = Sunny.UI.UIStyle.LightBlue;
|
||||
this.m1.StyleCustomMode = true;
|
||||
this.m1.Symbol = 61702;
|
||||
this.m1.TabIndex = 5;
|
||||
this.m1.Click += new System.EventHandler(this.m1_Click);
|
||||
//
|
||||
// h1
|
||||
//
|
||||
this.h1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.h1.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.h1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||
this.h1.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.h1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.h1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.h1.ImageInterval = 0;
|
||||
this.h1.Location = new System.Drawing.Point(21, 13);
|
||||
this.h1.Name = "h1";
|
||||
this.h1.Padding = new System.Windows.Forms.Padding(24, 0, 0, 0);
|
||||
this.h1.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.h1.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.h1.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
|
||||
this.h1.Size = new System.Drawing.Size(30, 24);
|
||||
this.h1.Style = Sunny.UI.UIStyle.LightBlue;
|
||||
this.h1.StyleCustomMode = true;
|
||||
this.h1.Symbol = 61702;
|
||||
this.h1.TabIndex = 4;
|
||||
this.h1.Click += new System.EventHandler(this.h1_Click);
|
||||
//
|
||||
// s2
|
||||
//
|
||||
this.s2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.s2.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.s2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||
this.s2.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.s2.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.s2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.s2.ImageInterval = 0;
|
||||
this.s2.Location = new System.Drawing.Point(127, 132);
|
||||
this.s2.Name = "s2";
|
||||
this.s2.Padding = new System.Windows.Forms.Padding(24, 0, 0, 0);
|
||||
this.s2.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.s2.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.s2.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
|
||||
this.s2.Size = new System.Drawing.Size(30, 24);
|
||||
this.s2.Style = Sunny.UI.UIStyle.LightBlue;
|
||||
this.s2.StyleCustomMode = true;
|
||||
this.s2.Symbol = 61703;
|
||||
this.s2.TabIndex = 9;
|
||||
this.s2.Click += new System.EventHandler(this.s2_Click);
|
||||
//
|
||||
// m2
|
||||
//
|
||||
this.m2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.m2.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.m2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||
this.m2.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.m2.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.m2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.m2.ImageInterval = 0;
|
||||
this.m2.Location = new System.Drawing.Point(74, 132);
|
||||
this.m2.Name = "m2";
|
||||
this.m2.Padding = new System.Windows.Forms.Padding(24, 0, 0, 0);
|
||||
this.m2.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.m2.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.m2.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
|
||||
this.m2.Size = new System.Drawing.Size(30, 24);
|
||||
this.m2.Style = Sunny.UI.UIStyle.LightBlue;
|
||||
this.m2.StyleCustomMode = true;
|
||||
this.m2.Symbol = 61703;
|
||||
this.m2.TabIndex = 8;
|
||||
this.m2.Click += new System.EventHandler(this.m2_Click);
|
||||
//
|
||||
// h2
|
||||
//
|
||||
this.h2.BackColor = System.Drawing.Color.Transparent;
|
||||
this.h2.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.h2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||
this.h2.FillHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.h2.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.h2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.h2.ImageInterval = 0;
|
||||
this.h2.Location = new System.Drawing.Point(21, 131);
|
||||
this.h2.Name = "h2";
|
||||
this.h2.Padding = new System.Windows.Forms.Padding(24, 0, 0, 0);
|
||||
this.h2.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.h2.RectHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
||||
this.h2.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
|
||||
this.h2.Size = new System.Drawing.Size(30, 24);
|
||||
this.h2.Style = Sunny.UI.UIStyle.LightBlue;
|
||||
this.h2.StyleCustomMode = true;
|
||||
this.h2.Symbol = 61703;
|
||||
this.h2.TabIndex = 7;
|
||||
this.h2.Click += new System.EventHandler(this.h2_Click);
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.btnOK.Location = new System.Drawing.Point(13, 166);
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.Padding = new System.Windows.Forms.Padding(28, 0, 0, 0);
|
||||
this.btnOK.Size = new System.Drawing.Size(74, 27);
|
||||
this.btnOK.TabIndex = 10;
|
||||
this.btnOK.Text = "确定";
|
||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.btnCancel.Location = new System.Drawing.Point(92, 166);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Padding = new System.Windows.Forms.Padding(28, 0, 0, 0);
|
||||
this.btnCancel.Size = new System.Drawing.Size(74, 27);
|
||||
this.btnCancel.Symbol = 61453;
|
||||
this.btnCancel.TabIndex = 11;
|
||||
this.btnCancel.Text = "取消";
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// hc
|
||||
//
|
||||
this.hc.BackColor = System.Drawing.Color.Transparent;
|
||||
this.hc.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.hc.Location = new System.Drawing.Point(20, 73);
|
||||
this.hc.Name = "hc";
|
||||
this.hc.Size = new System.Drawing.Size(35, 22);
|
||||
this.hc.StyleCustomMode = true;
|
||||
this.hc.TabIndex = 12;
|
||||
this.hc.Text = "00";
|
||||
this.hc.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// mc
|
||||
//
|
||||
this.mc.BackColor = System.Drawing.Color.Transparent;
|
||||
this.mc.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.mc.Location = new System.Drawing.Point(73, 73);
|
||||
this.mc.Name = "mc";
|
||||
this.mc.Size = new System.Drawing.Size(35, 22);
|
||||
this.mc.StyleCustomMode = true;
|
||||
this.mc.TabIndex = 13;
|
||||
this.mc.Text = "00";
|
||||
this.mc.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// sc
|
||||
//
|
||||
this.sc.BackColor = System.Drawing.Color.Transparent;
|
||||
this.sc.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.sc.Location = new System.Drawing.Point(126, 73);
|
||||
this.sc.Name = "sc";
|
||||
this.sc.Size = new System.Drawing.Size(35, 22);
|
||||
this.sc.StyleCustomMode = true;
|
||||
this.sc.TabIndex = 14;
|
||||
this.sc.Text = "00";
|
||||
this.sc.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// st
|
||||
//
|
||||
this.st.BackColor = System.Drawing.Color.Transparent;
|
||||
this.st.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.st.ForeColor = System.Drawing.Color.Gray;
|
||||
this.st.Location = new System.Drawing.Point(126, 40);
|
||||
this.st.Name = "st";
|
||||
this.st.Size = new System.Drawing.Size(35, 22);
|
||||
this.st.StyleCustomMode = true;
|
||||
this.st.TabIndex = 17;
|
||||
this.st.Text = "00";
|
||||
this.st.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// mt
|
||||
//
|
||||
this.mt.BackColor = System.Drawing.Color.Transparent;
|
||||
this.mt.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.mt.ForeColor = System.Drawing.Color.Gray;
|
||||
this.mt.Location = new System.Drawing.Point(73, 40);
|
||||
this.mt.Name = "mt";
|
||||
this.mt.Size = new System.Drawing.Size(35, 22);
|
||||
this.mt.StyleCustomMode = true;
|
||||
this.mt.TabIndex = 16;
|
||||
this.mt.Text = "00";
|
||||
this.mt.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// ht
|
||||
//
|
||||
this.ht.BackColor = System.Drawing.Color.Transparent;
|
||||
this.ht.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.ht.ForeColor = System.Drawing.Color.Gray;
|
||||
this.ht.Location = new System.Drawing.Point(20, 40);
|
||||
this.ht.Name = "ht";
|
||||
this.ht.Size = new System.Drawing.Size(35, 22);
|
||||
this.ht.StyleCustomMode = true;
|
||||
this.ht.TabIndex = 15;
|
||||
this.ht.Text = "00";
|
||||
this.ht.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// sb
|
||||
//
|
||||
this.sb.BackColor = System.Drawing.Color.Transparent;
|
||||
this.sb.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.sb.ForeColor = System.Drawing.Color.Gray;
|
||||
this.sb.Location = new System.Drawing.Point(126, 106);
|
||||
this.sb.Name = "sb";
|
||||
this.sb.Size = new System.Drawing.Size(35, 22);
|
||||
this.sb.StyleCustomMode = true;
|
||||
this.sb.TabIndex = 20;
|
||||
this.sb.Text = "00";
|
||||
this.sb.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// mb
|
||||
//
|
||||
this.mb.BackColor = System.Drawing.Color.Transparent;
|
||||
this.mb.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.mb.ForeColor = System.Drawing.Color.Gray;
|
||||
this.mb.Location = new System.Drawing.Point(73, 106);
|
||||
this.mb.Name = "mb";
|
||||
this.mb.Size = new System.Drawing.Size(35, 22);
|
||||
this.mb.StyleCustomMode = true;
|
||||
this.mb.TabIndex = 19;
|
||||
this.mb.Text = "00";
|
||||
this.mb.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// hb
|
||||
//
|
||||
this.hb.BackColor = System.Drawing.Color.Transparent;
|
||||
this.hb.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||
this.hb.ForeColor = System.Drawing.Color.Gray;
|
||||
this.hb.Location = new System.Drawing.Point(20, 106);
|
||||
this.hb.Name = "hb";
|
||||
this.hb.Size = new System.Drawing.Size(35, 22);
|
||||
this.hb.StyleCustomMode = true;
|
||||
this.hb.TabIndex = 18;
|
||||
this.hb.Text = "00";
|
||||
this.hb.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// UITimeItem
|
||||
//
|
||||
this.Controls.Add(this.sb);
|
||||
this.Controls.Add(this.mb);
|
||||
this.Controls.Add(this.hb);
|
||||
this.Controls.Add(this.st);
|
||||
this.Controls.Add(this.mt);
|
||||
this.Controls.Add(this.ht);
|
||||
this.Controls.Add(this.sc);
|
||||
this.Controls.Add(this.mc);
|
||||
this.Controls.Add(this.hc);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Controls.Add(this.s2);
|
||||
this.Controls.Add(this.m2);
|
||||
this.Controls.Add(this.h2);
|
||||
this.Controls.Add(this.s1);
|
||||
this.Controls.Add(this.m1);
|
||||
this.Controls.Add(this.h1);
|
||||
this.Controls.Add(this.uiLine2);
|
||||
this.Controls.Add(this.uiLine1);
|
||||
this.Name = "UITimeItem";
|
||||
this.Size = new System.Drawing.Size(179, 200);
|
||||
this.ResumeLayout(false);
|
||||
}
|
||||
|
||||
private void h1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Hour = (hour - 1 + 24).Mod(24);
|
||||
ShowOther();
|
||||
}
|
||||
|
||||
private void m1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Minute = (Minute - 1 + 60).Mod(60);
|
||||
ShowOther();
|
||||
}
|
||||
|
||||
private void s1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Second = (Second - 1 + 60).Mod(60);
|
||||
ShowOther();
|
||||
}
|
||||
|
||||
private void h2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Hour = (hour + 1 + 24).Mod(24);
|
||||
ShowOther();
|
||||
}
|
||||
|
||||
private void m2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Minute = (Minute + 1 + 60).Mod(60);
|
||||
ShowOther();
|
||||
}
|
||||
|
||||
private void s2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Second = (Second + 1 + 60).Mod(60);
|
||||
ShowOther();
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, Hour, Minute, Second);
|
||||
DoValueChanged(this, time);
|
||||
CloseParent();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
CloseParent();
|
||||
}
|
||||
}
|
||||
}
|
120
SunnyUI/Controls/DropItem/UITimeItem.resx
Normal file
120
SunnyUI/Controls/DropItem/UITimeItem.resx
Normal 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>
|
@ -46,33 +46,27 @@ namespace Sunny.UI
|
||||
ValueChanged?.Invoke(this, Value);
|
||||
}
|
||||
|
||||
private readonly UIDateTimeControl item = new UIDateTimeControl();
|
||||
private readonly UIDateTimeItem item = new UIDateTimeItem();
|
||||
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(item);
|
||||
}
|
||||
|
||||
private MonthCalendar MonthCalendar
|
||||
{
|
||||
get
|
||||
{
|
||||
return item.MonthCalendar;
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime Value
|
||||
{
|
||||
get => MonthCalendar.SelectionStart.Date;
|
||||
get => item.Date;
|
||||
set
|
||||
{
|
||||
Text = value.ToString(dateFormat);
|
||||
MonthCalendar.SelectionStart = value;
|
||||
item.Date = value;
|
||||
}
|
||||
}
|
||||
|
||||
private void UIDatetimePicker_ButtonClick(object sender, EventArgs e)
|
||||
{
|
||||
item.Date = Value;
|
||||
Application.DoEvents();
|
||||
ItemForm.Show(this);
|
||||
}
|
||||
|
||||
|
@ -132,6 +132,8 @@ namespace Sunny.UI
|
||||
|
||||
protected override void OnPaintFore(Graphics g, GraphicsPath path)
|
||||
{
|
||||
if (Text.IsNullOrEmpty()) return;
|
||||
|
||||
SizeF sf = g.MeasureString(Text, Font);
|
||||
|
||||
if (Direction == LineDirection.Horizontal)
|
||||
|
104
SunnyUI/Controls/UITimePicker.cs
Normal file
104
SunnyUI/Controls/UITimePicker.cs
Normal file
@ -0,0 +1,104 @@
|
||||
/******************************************************************************
|
||||
* SunnyUI 开源控件库、工具类库、扩展类库、多页面开发框架。
|
||||
* CopyRight (C) 2012-2020 ShenYongHua(沈永华).
|
||||
* QQ群:56829229 QQ:17612584 EMail:SunnyUI@qq.com
|
||||
*
|
||||
* Blog: https://www.cnblogs.com/yhuse
|
||||
* Gitee: https://gitee.com/yhuse/SunnyUI
|
||||
* GitHub: https://github.com/yhuse/SunnyUI
|
||||
*
|
||||
* SunnyUI.dll can be used for free under the GPL-3.0 license.
|
||||
* If you use this code, please keep this note.
|
||||
* 如果您使用此代码,请保留此说明。
|
||||
******************************************************************************
|
||||
* 文件名称: UIDatePicker.cs
|
||||
* 文件说明: 时间选择框
|
||||
* 当前版本: V2.2
|
||||
* 创建日期: 2020-05-29
|
||||
*
|
||||
* 2020-05-29: V2.2.5 增加文件
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
[ToolboxItem(true)]
|
||||
public sealed partial class UITimePicker : UIDropControl
|
||||
{
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// UITimePicker
|
||||
//
|
||||
this.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList;
|
||||
this.Name = "UITimePicker";
|
||||
this.Padding = new System.Windows.Forms.Padding(0, 0, 30, 0);
|
||||
this.SymbolDropDown = 61555;
|
||||
this.SymbolNormal = 61555;
|
||||
this.ButtonClick += new System.EventHandler(this.UITimePicker_ButtonClick);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
public UITimePicker()
|
||||
{
|
||||
InitializeComponent();
|
||||
Value = DateTime.Now;
|
||||
}
|
||||
|
||||
public delegate void OnDateTimeChanged(object sender, DateTime value);
|
||||
|
||||
public event OnDateTimeChanged ValueChanged;
|
||||
|
||||
protected override void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
Value = (DateTime)value;
|
||||
Text = Value.ToString(timeFormat);
|
||||
Invalidate();
|
||||
ValueChanged?.Invoke(this, Value);
|
||||
}
|
||||
|
||||
private readonly UITimeItem item = new UITimeItem();
|
||||
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(item);
|
||||
}
|
||||
|
||||
public DateTime Value
|
||||
{
|
||||
get => item.Time;
|
||||
set
|
||||
{
|
||||
Text = value.ToString(timeFormat);
|
||||
item.Time = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string timeFormat = "HH:mm:ss";
|
||||
|
||||
[Description("时间格式化掩码"), Category("自定义")]
|
||||
[DefaultValue("HH:mm:ss")]
|
||||
public string TimeFormat
|
||||
{
|
||||
get => timeFormat;
|
||||
set
|
||||
{
|
||||
timeFormat = value;
|
||||
Text = Value.ToString(timeFormat);
|
||||
}
|
||||
}
|
||||
|
||||
private void UITimePicker_ButtonClick(object sender, EventArgs e)
|
||||
{
|
||||
item.Time = Value;
|
||||
Application.DoEvents();
|
||||
ItemForm.Show(this);
|
||||
}
|
||||
}
|
||||
}
|
120
SunnyUI/Controls/UITimePicker.resx
Normal file
120
SunnyUI/Controls/UITimePicker.resx
Normal 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>
|
@ -60,9 +60,6 @@
|
||||
<Compile Include="Controls\DropItem\UIDateTimeItem.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\DropItem\UIDateTimeItem.Designer.cs">
|
||||
<DependentUpon>UIDateTimeItem.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\DropItem\UIDropDown.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@ -72,6 +69,12 @@
|
||||
<Compile Include="Controls\DropItem\UIDropDownItem.Designer.cs">
|
||||
<DependentUpon>UIDropDownItem.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\DropItem\UITimeItem.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\UITimePicker.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\UINotifier.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -421,6 +424,12 @@
|
||||
<EmbeddedResource Include="Controls\DropItem\UIComboBoxItem.resx">
|
||||
<DependentUpon>UIComboBoxItem.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\DropItem\UITimeItem.resx">
|
||||
<DependentUpon>UITimeItem.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Controls\UITimePicker.resx">
|
||||
<DependentUpon>UITimePicker.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\UINotifier.resx">
|
||||
<DependentUpon>UINotifier.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -1,5 +1,9 @@
|
||||
+ 增加; - 删除; * 修改
|
||||
|
||||
2020.05.29
|
||||
* UIDatePicker:重写日期选择界面
|
||||
+ UITimePicker:新增
|
||||
|
||||
2020.05.28
|
||||
* UIForm:更新了点击标题栏移动的方法,以及双击最大化/正常
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user