* 写WIKI时对控件的一些描述进行了更新
This commit is contained in:
parent
46d36e6636
commit
74271f14ea
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -23,6 +23,7 @@
|
|||||||
uiRoundMeter2.Angle = value * 10;
|
uiRoundMeter2.Angle = value * 10;
|
||||||
uiAnalogMeter1.Value = value;
|
uiAnalogMeter1.Value = value;
|
||||||
uiBattery1.Power = value;
|
uiBattery1.Power = value;
|
||||||
|
uiLedDisplay1.Text = value + " Ω";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -26,6 +26,7 @@ using System.Drawing.Drawing2D;
|
|||||||
|
|
||||||
namespace Sunny.UI
|
namespace Sunny.UI
|
||||||
{
|
{
|
||||||
|
[DefaultProperty("Power")]
|
||||||
[ToolboxItem(true)]
|
[ToolboxItem(true)]
|
||||||
public sealed class UIBattery : UIControl
|
public sealed class UIBattery : UIControl
|
||||||
{
|
{
|
||||||
@ -119,9 +120,9 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 字体颜色
|
/// 默认电量颜色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("字体颜色")]
|
[Description("默认电量颜色")]
|
||||||
[Category("SunnyUI")]
|
[Category("SunnyUI")]
|
||||||
[DefaultValue(typeof(Color), "White")]
|
[DefaultValue(typeof(Color), "White")]
|
||||||
public override Color ForeColor
|
public override Color ForeColor
|
||||||
|
@ -48,11 +48,16 @@ namespace Sunny.UI
|
|||||||
foreColor = Color.White;
|
foreColor = Color.White;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~UIBreadcrumb()
|
||||||
|
{
|
||||||
|
listbox.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
public delegate void OnValueChanged(object sender, int value);
|
public delegate void OnValueChanged(object sender, int value);
|
||||||
|
|
||||||
public event OnValueChanged ItemIndexChanged;
|
public event OnValueChanged ItemIndexChanged;
|
||||||
|
|
||||||
private readonly ListBoxEx listbox = new ListBoxEx();
|
private readonly ListBox listbox = new ListBox();
|
||||||
|
|
||||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||||
[Localizable(true)]
|
[Localizable(true)]
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* 如果您使用此代码,请保留此说明。
|
* 如果您使用此代码,请保留此说明。
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* 文件名称: UILedDisplay.cs
|
* 文件名称: UILedDisplay.cs
|
||||||
* 文件说明: LED 显示器
|
* 文件说明: LED显示屏
|
||||||
* 当前版本: V3.0
|
* 当前版本: V3.0
|
||||||
* 创建日期: 2020-01-01
|
* 创建日期: 2020-01-01
|
||||||
*
|
*
|
||||||
@ -30,6 +30,7 @@ namespace Sunny.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// LED显示屏
|
/// LED显示屏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[DefaultProperty("Text")]
|
||||||
public class UILedDisplay : Control
|
public class UILedDisplay : Control
|
||||||
{
|
{
|
||||||
#region 组件设计器生成的代码
|
#region 组件设计器生成的代码
|
||||||
@ -86,6 +87,13 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
public string Version { get; }
|
public string Version { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Tag字符串
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(null)]
|
||||||
|
[Description("获取或设置包含有关控件的数据的对象字符串"), Category("SunnyUI")]
|
||||||
|
public string TagString { get; set; }
|
||||||
|
|
||||||
private Color borderColor = Color.Black;
|
private Color borderColor = Color.Black;
|
||||||
private Color borderInColor = Color.Silver;
|
private Color borderInColor = Color.Silver;
|
||||||
private Color ledBackColor = Color.FromArgb(0, 0x33, 0);
|
private Color ledBackColor = Color.FromArgb(0, 0x33, 0);
|
||||||
@ -272,7 +280,7 @@ namespace Sunny.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 计算大小
|
/// 计算大小
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void CalcSize()
|
private void CalcSize()
|
||||||
{
|
{
|
||||||
Width = BorderWidth * 2 + BorderInWidth * 2 + IntervalH * 2 + CharCount * IntervalOn * 5 +
|
Width = BorderWidth * 2 + BorderInWidth * 2 + IntervalH * 2 + CharCount * IntervalOn * 5 +
|
||||||
CharCount * IntervalIn * 4 + (CharCount + 1) * IntervalOn + CharCount * 2 * IntervalIn;
|
CharCount * IntervalIn * 4 + (CharCount + 1) * IntervalOn + CharCount * 2 * IntervalIn;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* 如果您使用此代码,请保留此说明。
|
* 如果您使用此代码,请保留此说明。
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
* 文件名称: UILedStopwatch.cs
|
* 文件名称: UILedStopwatch.cs
|
||||||
* 文件说明: LED 时钟
|
* 文件说明: LED计时器
|
||||||
* 当前版本: V3.0
|
* 当前版本: V3.0
|
||||||
* 创建日期: 2020-01-01
|
* 创建日期: 2020-01-01
|
||||||
*
|
*
|
||||||
@ -27,14 +27,14 @@ namespace Sunny.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// LED计时器
|
/// LED计时器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultEvent("Click")]
|
[DefaultEvent("TimerTick")]
|
||||||
[DefaultProperty("TimerTick")]
|
[DefaultProperty("Text")]
|
||||||
public sealed class UILedStopwatch : UILedDisplay
|
public sealed class UILedStopwatch : UILedDisplay
|
||||||
{
|
{
|
||||||
private readonly System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
|
private readonly System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当定时器启动后,每隔1秒触发一次
|
/// 当定时器启动后,Text变化时触发一次
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event EventHandler TimerTick;
|
public event EventHandler TimerTick;
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ namespace Sunny.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public UILedStopwatch()
|
public UILedStopwatch()
|
||||||
{
|
{
|
||||||
timer.Interval = 50;
|
timer.Interval = 100;
|
||||||
timer.Tick += Timer_Tick;
|
timer.Tick += Timer_Tick;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,6 +61,7 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue(TimeShowType.mmss)]
|
[DefaultValue(TimeShowType.mmss)]
|
||||||
|
[Description("显示方式"), Category("SunnyUI")]
|
||||||
public TimeShowType ShowType { get; set; } = TimeShowType.mmss;
|
public TimeShowType ShowType { get; set; } = TimeShowType.mmss;
|
||||||
|
|
||||||
private void Timer_Tick(object sender, EventArgs e)
|
private void Timer_Tick(object sender, EventArgs e)
|
||||||
@ -85,7 +86,7 @@ namespace Sunny.UI
|
|||||||
if (text != Text)
|
if (text != Text)
|
||||||
{
|
{
|
||||||
Text = text;
|
Text = text;
|
||||||
TimerTick?.Invoke(this, null);
|
TimerTick?.Invoke(this, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user