* 增加XML文档文件
This commit is contained in:
parent
98d8681698
commit
a471882183
@ -189,6 +189,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -116,6 +116,10 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -247,6 +247,10 @@ namespace Sunny.UI
|
||||
SetIndex(index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
Size = new Size(253, 148);
|
||||
|
@ -117,6 +117,10 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
if (Width != Height)
|
||||
|
@ -107,6 +107,10 @@ namespace Sunny.UI
|
||||
Version = UIGlobal.Version;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
e.Graphics.FillRectangle(BackColor, ClientRectangle);
|
||||
|
@ -224,6 +224,11 @@ namespace Sunny.UI
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
protected virtual void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
}
|
||||
@ -418,6 +423,10 @@ namespace Sunny.UI
|
||||
|
||||
protected bool fullControlSelect;
|
||||
|
||||
/// <summary>
|
||||
/// 点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
if (!ReadOnly)
|
||||
|
@ -328,6 +328,10 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
if (Width <= 0 || Height <= 0) return;
|
||||
|
@ -314,9 +314,9 @@ namespace Sunny.UI
|
||||
public event PaintEventHandler PaintAgain;
|
||||
|
||||
/// <summary>
|
||||
/// OnPaint
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">e</param>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -58,6 +58,9 @@ namespace Sunny.UI
|
||||
Height = 24;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电量
|
||||
/// </summary>
|
||||
[DefaultValue(100), Description("电量"), Category("SunnyUI")]
|
||||
public int Power
|
||||
{
|
||||
@ -85,6 +88,9 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 多种颜色显示电量
|
||||
/// </summary>
|
||||
[DefaultValue(true), Description("多种颜色"), Category("SunnyUI")]
|
||||
public bool MultiColor
|
||||
{
|
||||
@ -96,6 +102,9 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电量为空颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "230, 80, 80"), Description("电量为空颜色"), Category("SunnyUI")]
|
||||
public Color ColorEmpty
|
||||
{
|
||||
@ -107,6 +116,9 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电量少时颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "220, 155, 40"), Description("电量少时颜色"), Category("SunnyUI")]
|
||||
public Color ColorDanger
|
||||
{
|
||||
@ -118,6 +130,9 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 电量安全颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "110, 190, 40"), Description("电量安全颜色"), Category("SunnyUI")]
|
||||
public Color ColorSafe
|
||||
{
|
||||
|
@ -33,11 +33,17 @@ using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// 面包屑导航条
|
||||
/// </summary>
|
||||
[ToolboxItem(true)]
|
||||
[DefaultEvent("ItemIndexChanged")]
|
||||
[DefaultProperty("ItemIndex")]
|
||||
public class UIBreadcrumb : UIControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public UIBreadcrumb()
|
||||
{
|
||||
items.CountChange += Items_CountChange;
|
||||
@ -59,6 +65,9 @@ namespace Sunny.UI
|
||||
|
||||
private bool alignBothEnds;
|
||||
|
||||
/// <summary>
|
||||
/// 显示时两端对齐
|
||||
/// </summary>
|
||||
[DefaultValue(false)]
|
||||
[Description("显示时两端对齐"), Category("SunnyUI")]
|
||||
public bool AlignBothEnds
|
||||
@ -74,10 +83,21 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 步骤值变化事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="value"></param>
|
||||
public delegate void OnValueChanged(object sender, int value);
|
||||
|
||||
/// <summary>
|
||||
/// 步骤值变化事件
|
||||
/// </summary>
|
||||
public event OnValueChanged ItemIndexChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 步骤条目列表
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||
[Localizable(true)]
|
||||
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, " + AssemblyRefEx.SystemDesign, typeof(UITypeEditor))]
|
||||
@ -89,11 +109,17 @@ namespace Sunny.UI
|
||||
|
||||
private readonly ConcurrentDictionary<int, Point[]> ClickArea = new ConcurrentDictionary<int, Point[]>();
|
||||
|
||||
/// <summary>
|
||||
/// 步骤个数
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public int Count => Items.Count;
|
||||
|
||||
private int itemIndex = -1;
|
||||
|
||||
/// <summary>
|
||||
/// 当前节点索引
|
||||
/// </summary>
|
||||
[DefaultValue(-1)]
|
||||
[Description("当前节点索引"), Category("SunnyUI")]
|
||||
public int ItemIndex
|
||||
@ -221,6 +247,9 @@ namespace Sunny.UI
|
||||
|
||||
private int itemWidth;
|
||||
|
||||
/// <summary>
|
||||
/// 节点宽度
|
||||
/// </summary>
|
||||
[DefaultValue(160)]
|
||||
[Description("节点宽度"), Category("SunnyUI")]
|
||||
public int ItemWidth
|
||||
@ -235,6 +264,9 @@ namespace Sunny.UI
|
||||
|
||||
private int interval = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 节点间隔
|
||||
/// </summary>
|
||||
[DefaultValue(1)]
|
||||
[Description("节点间隔"), Category("SunnyUI")]
|
||||
public int Interval
|
||||
@ -248,7 +280,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 已选节点颜色
|
||||
/// 已选节点颜色
|
||||
/// </summary>
|
||||
[Description("已选节点颜色")]
|
||||
[Category("SunnyUI")]
|
||||
@ -260,7 +292,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 未选节点颜色
|
||||
/// 未选节点颜色
|
||||
/// </summary>
|
||||
[Description("未选节点颜色")]
|
||||
[Category("SunnyUI")]
|
||||
@ -274,7 +306,7 @@ namespace Sunny.UI
|
||||
private Color unSelectedForeColor = Color.White;
|
||||
|
||||
/// <summary>
|
||||
/// 未选节点颜色
|
||||
/// 未选节点文字颜色
|
||||
/// </summary>
|
||||
[Description("未选节点文字颜色")]
|
||||
[Category("SunnyUI")]
|
||||
@ -293,7 +325,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 字体颜色
|
||||
/// 字体颜色
|
||||
/// </summary>
|
||||
[Description("字体颜色")]
|
||||
[Category("SunnyUI")]
|
||||
@ -316,6 +348,10 @@ namespace Sunny.UI
|
||||
rectColor = uiColor.BreadcrumbUnSelectedColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnMouseClick(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseClick(e);
|
||||
|
@ -38,11 +38,17 @@ using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// 按钮
|
||||
/// </summary>
|
||||
[DefaultEvent("Click")]
|
||||
[DefaultProperty("Text")]
|
||||
[ToolboxItem(true)]
|
||||
public class UIButton : UIControl, IButtonControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public UIButton()
|
||||
{
|
||||
SetStyleFlags();
|
||||
@ -65,6 +71,9 @@ namespace Sunny.UI
|
||||
SetStyle(ControlStyles.StandardDoubleClick, UseDoubleClick);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示浅色背景
|
||||
/// </summary>
|
||||
[DefaultValue(false)]
|
||||
[Description("是否显示浅色背景"), Category("SunnyUI")]
|
||||
public bool LightStyle
|
||||
@ -82,6 +91,9 @@ namespace Sunny.UI
|
||||
|
||||
private bool autoSize;
|
||||
|
||||
/// <summary>
|
||||
/// 自动大小
|
||||
/// </summary>
|
||||
[Browsable(true), DefaultValue(false)]
|
||||
[Description("自动大小"), Category("SunnyUI")]
|
||||
public override bool AutoSize
|
||||
@ -96,6 +108,9 @@ namespace Sunny.UI
|
||||
|
||||
private bool isClick;
|
||||
|
||||
/// <summary>
|
||||
/// 调用点击事件
|
||||
/// </summary>
|
||||
public void PerformClick()
|
||||
{
|
||||
if (isClick) return;
|
||||
@ -107,6 +122,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
Form form = FindFormInternal();
|
||||
@ -129,6 +148,9 @@ namespace Sunny.UI
|
||||
|
||||
private bool showTips = false;
|
||||
|
||||
/// <summary>
|
||||
/// 是否显示角标
|
||||
/// </summary>
|
||||
[Description("是否显示角标"), Category("SunnyUI")]
|
||||
[DefaultValue(false)]
|
||||
public bool ShowTips
|
||||
@ -149,6 +171,9 @@ namespace Sunny.UI
|
||||
|
||||
private string tipsText = "";
|
||||
|
||||
/// <summary>
|
||||
/// 角标文字
|
||||
/// </summary>
|
||||
[Description("角标文字"), Category("SunnyUI")]
|
||||
[DefaultValue("")]
|
||||
public string TipsText
|
||||
@ -169,6 +194,9 @@ namespace Sunny.UI
|
||||
|
||||
private Font tipsFont = UIFontColor.SubFont();
|
||||
|
||||
/// <summary>
|
||||
/// 角标文字字体
|
||||
/// </summary>
|
||||
[Description("角标文字字体"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Font), "微软雅黑, 9pt")]
|
||||
public Font TipsFont
|
||||
@ -213,6 +241,9 @@ namespace Sunny.UI
|
||||
|
||||
private Color tipsColor = Color.Red;
|
||||
|
||||
/// <summary>
|
||||
/// 角标背景颜色
|
||||
/// </summary>
|
||||
[Description("角标背景颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "Red")]
|
||||
public Color TipsColor
|
||||
@ -227,6 +258,9 @@ namespace Sunny.UI
|
||||
|
||||
private Color tipsForeColor = Color.White;
|
||||
|
||||
/// <summary>
|
||||
/// 角标文字颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "White"), Category("SunnyUI"), Description("角标文字颜色")]
|
||||
public Color TipsForeColor
|
||||
{
|
||||
@ -254,12 +288,20 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 析构函数
|
||||
/// </summary>
|
||||
/// <param name="disposing">释放参数</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
tmpFont?.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
@ -357,6 +399,9 @@ namespace Sunny.UI
|
||||
set => SetFillColor2(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 填充颜色渐变
|
||||
/// </summary>
|
||||
[Description("填充颜色渐变"), Category("SunnyUI")]
|
||||
[DefaultValue(false)]
|
||||
public bool FillColorGradient
|
||||
@ -394,6 +439,9 @@ namespace Sunny.UI
|
||||
set => SetForeColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 不可用时填充颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "244, 244, 244"), Category("SunnyUI")]
|
||||
[Description("不可用时填充颜色")]
|
||||
public Color FillDisableColor
|
||||
@ -402,6 +450,9 @@ namespace Sunny.UI
|
||||
set => SetFillDisableColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 不可用时边框颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "173, 178, 181"), Category("SunnyUI")]
|
||||
[Description("不可用时边框颜色")]
|
||||
public Color RectDisableColor
|
||||
@ -410,6 +461,9 @@ namespace Sunny.UI
|
||||
set => SetRectDisableColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 不可用时字体颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "109, 109, 103"), Category("SunnyUI")]
|
||||
[Description("不可用时字体颜色")]
|
||||
public Color ForeDisableColor
|
||||
@ -418,6 +472,9 @@ namespace Sunny.UI
|
||||
set => SetForeDisableColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标移上时填充颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "115, 179, 255"), Category("SunnyUI")]
|
||||
[Description("鼠标移上时填充颜色")]
|
||||
public Color FillHoverColor
|
||||
@ -426,6 +483,9 @@ namespace Sunny.UI
|
||||
set => SetFillHoverColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标按下时填充颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "64, 128, 204"), Category("SunnyUI")]
|
||||
[Description("鼠标按下时填充颜色")]
|
||||
public Color FillPressColor
|
||||
@ -434,6 +494,9 @@ namespace Sunny.UI
|
||||
set => SetFillPressColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标移上时字体颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "White"), Category("SunnyUI")]
|
||||
[Description("鼠标移上时字体颜色")]
|
||||
public Color ForeHoverColor
|
||||
@ -442,6 +505,9 @@ namespace Sunny.UI
|
||||
set => SetForeHoverColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标按下时字体颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "White"), Category("SunnyUI")]
|
||||
[Description("鼠标按下时字体颜色")]
|
||||
public Color ForePressColor
|
||||
@ -450,6 +516,9 @@ namespace Sunny.UI
|
||||
set => SetForePressColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标移上时边框颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "115, 179, 255"), Category("SunnyUI")]
|
||||
[Description("鼠标移上时边框颜色")]
|
||||
public Color RectHoverColor
|
||||
@ -458,6 +527,9 @@ namespace Sunny.UI
|
||||
set => SetRectHoverColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鼠标按下时边框颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "64, 128, 204"), Category("SunnyUI")]
|
||||
[Description("鼠标按下时边框颜色")]
|
||||
public Color RectPressColor
|
||||
@ -466,6 +538,9 @@ namespace Sunny.UI
|
||||
set => SetRectPressColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选中时填充颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "64, 128, 204"), Category("SunnyUI")]
|
||||
[Description("选中时填充颜色")]
|
||||
public Color FillSelectedColor
|
||||
@ -474,6 +549,9 @@ namespace Sunny.UI
|
||||
set => SetFillSelectedColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选中时字体颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "White"), Category("SunnyUI")]
|
||||
[Description("选中时字体颜色")]
|
||||
public Color ForeSelectedColor
|
||||
@ -482,6 +560,9 @@ namespace Sunny.UI
|
||||
set => SetForeSelectedColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选中时边框颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "64, 128, 204"), Category("SunnyUI")]
|
||||
[Description("选中时边框颜色")]
|
||||
public Color RectSelectedColor
|
||||
@ -490,6 +571,10 @@ namespace Sunny.UI
|
||||
set => SetRectSelectedColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载鼠标按下事件
|
||||
/// </summary>
|
||||
/// <param name="e">鼠标参数</param>
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseDown(e);
|
||||
@ -497,6 +582,10 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载鼠标抬起事件
|
||||
/// </summary>
|
||||
/// <param name="e">鼠标参数</param>
|
||||
protected override void OnMouseUp(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseUp(e);
|
||||
@ -504,6 +593,10 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载鼠标离开事件
|
||||
/// </summary>
|
||||
/// <param name="e">鼠标参数</param>
|
||||
protected override void OnMouseLeave(EventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
@ -512,6 +605,10 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载鼠标进入事件
|
||||
/// </summary>
|
||||
/// <param name="e">鼠标参数</param>
|
||||
protected override void OnMouseEnter(EventArgs e)
|
||||
{
|
||||
base.OnMouseEnter(e);
|
||||
@ -519,14 +616,25 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通知控件它是默认按钮
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
public void NotifyDefault(bool value)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 指定标识符以指示对话框的返回值
|
||||
/// </summary>
|
||||
[DefaultValue(DialogResult.None)]
|
||||
[Description("指定标识符以指示对话框的返回值"), Category("SunnyUI")]
|
||||
public DialogResult DialogResult { get; set; } = DialogResult.None;
|
||||
|
||||
/// <summary>
|
||||
/// 键盘按下事件
|
||||
/// </summary>
|
||||
/// <param name="e">按键参数</param>
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
if (Focused && e.KeyCode == Keys.Space)
|
||||
@ -539,6 +647,10 @@ namespace Sunny.UI
|
||||
base.OnKeyDown(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 键盘抬起事件
|
||||
/// </summary>
|
||||
/// <param name="e">按键参数</param>
|
||||
protected override void OnKeyUp(KeyEventArgs e)
|
||||
{
|
||||
IsPress = false;
|
||||
@ -547,6 +659,9 @@ namespace Sunny.UI
|
||||
base.OnKeyUp(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示激活时边框线
|
||||
/// </summary>
|
||||
[DefaultValue(false)]
|
||||
[Description("显示激活时边框线"), Category("SunnyUI")]
|
||||
public bool ShowFocusLine { get; set; }
|
||||
|
@ -31,11 +31,17 @@ using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// 复选框
|
||||
/// </summary>
|
||||
[DefaultEvent("CheckedChanged")]
|
||||
[DefaultProperty("Checked")]
|
||||
[ToolboxItem(true)]
|
||||
public class UICheckBox : UIControl
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public UICheckBox()
|
||||
{
|
||||
SetStyleFlags();
|
||||
@ -48,6 +54,10 @@ namespace Sunny.UI
|
||||
fillColor = UIStyles.Blue.CheckBoxColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
@ -63,6 +73,9 @@ namespace Sunny.UI
|
||||
|
||||
private bool autoSize;
|
||||
|
||||
/// <summary>
|
||||
/// 自动大小
|
||||
/// </summary>
|
||||
[Browsable(true)]
|
||||
[Description("自动大小"), Category("SunnyUI")]
|
||||
public override bool AutoSize
|
||||
@ -75,13 +88,24 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
public delegate void OnValueChanged(object sender, bool value);
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
public event OnValueChanged ValueChanged;
|
||||
|
||||
private int _imageSize = 16;
|
||||
private int _imageInterval = 3;
|
||||
|
||||
/// <summary>
|
||||
/// 图标大小
|
||||
/// </summary>
|
||||
[DefaultValue(16)]
|
||||
[Description("图标大小"), Category("SunnyUI")]
|
||||
public int ImageSize
|
||||
@ -95,6 +119,9 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否只读
|
||||
/// </summary>
|
||||
[DefaultValue(false)]
|
||||
[Description("是否只读"), Category("SunnyUI")]
|
||||
public bool ReadOnly { get; set; }
|
||||
@ -110,6 +137,9 @@ namespace Sunny.UI
|
||||
set => SetForeColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 图标与文字之间间隔
|
||||
/// </summary>
|
||||
[DefaultValue(3)]
|
||||
[Description("图标与文字之间间隔"), Category("SunnyUI")]
|
||||
public int ImageInterval
|
||||
@ -124,6 +154,9 @@ namespace Sunny.UI
|
||||
|
||||
private bool _checked;
|
||||
|
||||
/// <summary>
|
||||
/// 是否选中
|
||||
/// </summary>
|
||||
[Description("是否选中"), Category("SunnyUI")]
|
||||
[DefaultValue(false)]
|
||||
public bool Checked
|
||||
@ -142,6 +175,9 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
public event EventHandler CheckedChanged;
|
||||
|
||||
/// <summary>
|
||||
@ -201,6 +237,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
if (!ReadOnly)
|
||||
|
@ -41,7 +41,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 值切换事件
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="index">索引</param>
|
||||
/// <param name="text">文字</param>
|
||||
/// <param name="isChecked">是否选中</param>
|
||||
@ -52,6 +52,9 @@ namespace Sunny.UI
|
||||
/// </summary>
|
||||
public event OnValueChanged ValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public UICheckBoxGroup()
|
||||
{
|
||||
items.CountChange += Items_CountChange;
|
||||
@ -62,6 +65,11 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取和设置条目值
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
public bool this[int index]
|
||||
{
|
||||
get => GetItemCheckState(index);
|
||||
@ -87,6 +95,9 @@ namespace Sunny.UI
|
||||
boxes.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除所有条目
|
||||
/// </summary>
|
||||
public void Clear()
|
||||
{
|
||||
Items.Clear();
|
||||
@ -94,6 +105,9 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 条目列表
|
||||
/// </summary>
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||
[Localizable(true)]
|
||||
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
|
||||
@ -124,6 +138,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
@ -157,6 +175,9 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选中状态列表
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public List<int> SelectedIndexes
|
||||
{
|
||||
@ -189,6 +210,11 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置条目状态
|
||||
/// </summary>
|
||||
/// <param name="index">索引</param>
|
||||
/// <param name="isChecked">是否选中</param>
|
||||
public void SetItemCheckState(int index, bool isChecked)
|
||||
{
|
||||
if (index >= 0 && index < boxes.Count)
|
||||
@ -197,6 +223,11 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取条目状态
|
||||
/// </summary>
|
||||
/// <param name="index">索引</param>
|
||||
/// <returns>是否选中</returns>
|
||||
public bool GetItemCheckState(int index)
|
||||
{
|
||||
if (index >= 0 && index < items.Count)
|
||||
@ -205,6 +236,9 @@ namespace Sunny.UI
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 所有选中条目列表
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public List<object> SelectedItems
|
||||
{
|
||||
@ -226,6 +260,9 @@ namespace Sunny.UI
|
||||
|
||||
private int columnCount = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 显示列的个数
|
||||
/// </summary>
|
||||
[DefaultValue(1)]
|
||||
[Description("显示列的个数"), Category("SunnyUI")]
|
||||
public int ColumnCount
|
||||
@ -240,6 +277,9 @@ namespace Sunny.UI
|
||||
|
||||
private Size _itemSize = new Size(150, 35);
|
||||
|
||||
/// <summary>
|
||||
/// 显示项的大小
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Size), "150, 35")]
|
||||
[Description("显示项的大小"), Category("SunnyUI")]
|
||||
public Size ItemSize
|
||||
@ -254,6 +294,9 @@ namespace Sunny.UI
|
||||
|
||||
private Point startPos = new Point(12, 12);
|
||||
|
||||
/// <summary>
|
||||
/// 显示项的起始位置
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Point), "12, 12")]
|
||||
[Description("显示项的起始位置"), Category("SunnyUI")]
|
||||
public Point StartPos
|
||||
@ -266,8 +309,12 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
public int columnInterval;
|
||||
|
||||
private int columnInterval;
|
||||
|
||||
/// <summary>
|
||||
/// 显示项列之间的间隔
|
||||
/// </summary>
|
||||
[DefaultValue(0)]
|
||||
[Description("显示项列之间的间隔"), Category("SunnyUI")]
|
||||
public int ColumnInterval
|
||||
@ -282,6 +329,9 @@ namespace Sunny.UI
|
||||
|
||||
private int rowInterval;
|
||||
|
||||
/// <summary>
|
||||
/// 显示项行之间的间隔
|
||||
/// </summary>
|
||||
[DefaultValue(0)]
|
||||
[Description("显示项行之间的间隔"), Category("SunnyUI")]
|
||||
public int RowInterval
|
||||
|
@ -34,6 +34,9 @@ using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// 颜色选择框
|
||||
/// </summary>
|
||||
[DefaultProperty("ValueChanged")]
|
||||
[ToolboxItem(true)]
|
||||
public sealed class UIColorPicker : UIDropControl
|
||||
@ -52,10 +55,21 @@ namespace Sunny.UI
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 颜色改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">颜色</param>
|
||||
public delegate void OnColorChanged(object sender, Color value);
|
||||
|
||||
/// <summary>
|
||||
/// 颜色改变事件
|
||||
/// </summary>
|
||||
public event OnColorChanged ValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public UIColorPicker()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -71,6 +85,9 @@ namespace Sunny.UI
|
||||
ItemForm.Show(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 整个控件点击下拉选择颜色
|
||||
/// </summary>
|
||||
[DefaultValue(false)]
|
||||
[Description("整个控件点击下拉选择颜色"), Category("SunnyUI")]
|
||||
public bool FullControlSelect
|
||||
@ -79,6 +96,11 @@ namespace Sunny.UI
|
||||
set => fullControlSelect = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
protected override void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
if (Value != (Color)value)
|
||||
@ -91,6 +113,9 @@ namespace Sunny.UI
|
||||
|
||||
private readonly UIColorItem item = new UIColorItem();
|
||||
|
||||
/// <summary>
|
||||
/// 创建对象
|
||||
/// </summary>
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(item);
|
||||
@ -98,6 +123,9 @@ namespace Sunny.UI
|
||||
|
||||
private Color selectColor;
|
||||
|
||||
/// <summary>
|
||||
/// 选中颜色
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||
[Description("选中颜色"), Category("SunnyUI")]
|
||||
public Color Value
|
||||
@ -124,6 +152,10 @@ namespace Sunny.UI
|
||||
g.FillPath(Value, pathColor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -40,12 +40,18 @@ using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// 组合框
|
||||
/// </summary>
|
||||
[DefaultProperty("Items")]
|
||||
[DefaultEvent("SelectedIndexChanged")]
|
||||
[ToolboxItem(true)]
|
||||
[LookupBindingProperties("DataSource", "DisplayMember", "ValueMember", "SelectedValue")]
|
||||
public sealed partial class UIComboBox : UIDropControl, IToolTip
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public UIComboBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -176,6 +182,9 @@ namespace Sunny.UI
|
||||
private object filterSelectedValue;
|
||||
private bool showFilter;
|
||||
|
||||
/// <summary>
|
||||
/// 显示过滤
|
||||
/// </summary>
|
||||
[DefaultValue(false)]
|
||||
[Description("显示过滤"), Category("SunnyUI")]
|
||||
public bool ShowFilter
|
||||
@ -191,10 +200,16 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 过滤显示最大条目数
|
||||
/// </summary>
|
||||
[DefaultValue(100)]
|
||||
[Description("过滤显示最大条目数"), Category("SunnyUI")]
|
||||
public int FilterMaxCount { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// 下拉状态改变事件
|
||||
/// </summary>
|
||||
protected override void DropDownStyleChanged()
|
||||
{
|
||||
if (DropDownStyle == UIDropDownStyle.DropDownList)
|
||||
@ -232,6 +247,10 @@ namespace Sunny.UI
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return edit;
|
||||
@ -443,6 +462,11 @@ namespace Sunny.UI
|
||||
|
||||
public event EventHandler SelectedValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
protected override void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
Invalidate();
|
||||
@ -482,6 +506,9 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建对象
|
||||
/// </summary>
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(dropForm);
|
||||
|
@ -91,6 +91,10 @@ namespace Sunny.UI
|
||||
CreateInstance();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return edit;
|
||||
@ -107,6 +111,9 @@ namespace Sunny.UI
|
||||
|
||||
private readonly UIComboDataGridViewItem item = new UIComboDataGridViewItem();
|
||||
|
||||
/// <summary>
|
||||
/// 创建对象
|
||||
/// </summary>
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(item);
|
||||
@ -119,6 +126,11 @@ namespace Sunny.UI
|
||||
public delegate void OnValueChanged(object sender, object value);
|
||||
public event OnValueChanged ValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
protected override void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
if (DataGridView.MultiSelect)
|
||||
|
@ -67,6 +67,10 @@ namespace Sunny.UI
|
||||
[Description("下拉框高度"), Category("SunnyUI")]
|
||||
public int DropDownHeight { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return edit;
|
||||
@ -124,6 +128,9 @@ namespace Sunny.UI
|
||||
|
||||
private readonly UIComboTreeViewItem item = new UIComboTreeViewItem();
|
||||
|
||||
/// <summary>
|
||||
/// 创建对象
|
||||
/// </summary>
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(item);
|
||||
@ -146,6 +153,11 @@ namespace Sunny.UI
|
||||
public event OnNodeSelected NodeSelected;
|
||||
public event OnNodesSelected NodesSelected;
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
protected override void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
if (!CheckBoxes)
|
||||
|
@ -389,9 +389,9 @@ namespace Sunny.UI
|
||||
protected bool lightStyle;
|
||||
|
||||
/// <summary>
|
||||
/// OnPaint
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">e</param>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
if (!Visible || Width <= 0 || Height <= 0) return;
|
||||
|
@ -337,6 +337,10 @@ namespace Sunny.UI
|
||||
SetBarPosition();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -79,6 +79,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return edit;
|
||||
@ -124,6 +128,11 @@ namespace Sunny.UI
|
||||
|
||||
public event OnDateTimeChanged ValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
protected override void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
Value = (DateTime)value;
|
||||
@ -132,6 +141,9 @@ namespace Sunny.UI
|
||||
|
||||
private readonly UIDateItem item = new UIDateItem();
|
||||
|
||||
/// <summary>
|
||||
/// 创建对象
|
||||
/// </summary>
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(item);
|
||||
|
@ -50,6 +50,10 @@ namespace Sunny.UI
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return edit;
|
||||
@ -115,6 +119,11 @@ namespace Sunny.UI
|
||||
|
||||
public event OnDateTimeChanged ValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
protected override void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
Value = (DateTime)value;
|
||||
@ -123,6 +132,9 @@ namespace Sunny.UI
|
||||
|
||||
private readonly UIDateTimeItem item = new UIDateTimeItem();
|
||||
|
||||
/// <summary>
|
||||
/// 创建对象
|
||||
/// </summary>
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(item);
|
||||
|
@ -59,6 +59,10 @@ namespace Sunny.UI
|
||||
[Description("禁止输入"), Category("SunnyUI")]
|
||||
public bool ForbidInput { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return pnlValue;
|
||||
|
@ -137,6 +137,10 @@ namespace Sunny.UI
|
||||
this.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -74,6 +74,10 @@ namespace Sunny.UI
|
||||
|
||||
public new event ScrollEventHandler Scroll;
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return Panel;
|
||||
|
@ -174,6 +174,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
Focus();
|
||||
@ -583,6 +587,10 @@ namespace Sunny.UI
|
||||
base.OnKeyUp(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
//重绘父类
|
||||
|
@ -162,6 +162,10 @@ namespace Sunny.UI
|
||||
return new Rectangle(17, 1, Width - 17 * 2, Height - 2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
e.Graphics.Clear(fillColor);
|
||||
|
@ -250,6 +250,10 @@ namespace Sunny.UI
|
||||
txt4.ForeColor = UIFontColor.Primary;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -67,6 +67,10 @@ namespace Sunny.UI
|
||||
listbox.MouseMove += Listbox_MouseMove;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return listbox;
|
||||
|
@ -56,6 +56,10 @@ namespace Sunny.UI
|
||||
[Description("禁止输入"), Category("SunnyUI")]
|
||||
public bool ForbidInput { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return pnlValue;
|
||||
|
@ -157,6 +157,10 @@ namespace Sunny.UI
|
||||
set => SetStyle(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
if (TextAlign == ContentAlignment.MiddleCenter && Angle != 0 && !AutoSize)
|
||||
|
@ -137,8 +137,9 @@ namespace Sunny.UI
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Handles the Paint event for this UserControl
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
// Create an offscreen graphics object for double buffering
|
||||
|
@ -288,9 +288,9 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重绘
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">e</param>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -39,6 +39,10 @@ namespace Sunny.UI
|
||||
foreColor = UIStyles.Blue.LedLabelForeColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -177,6 +177,10 @@ namespace Sunny.UI
|
||||
KeyPress?.Invoke(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return listbox;
|
||||
|
@ -46,6 +46,10 @@ namespace Sunny.UI
|
||||
fillColor = UIColor.Blue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -118,6 +118,10 @@ namespace Sunny.UI
|
||||
markColor = uiColor.MarkLabelForeColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -423,6 +423,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -127,6 +127,10 @@ namespace Sunny.UI
|
||||
private Bitmap image;
|
||||
private int imageRadius;
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -54,6 +54,10 @@ namespace Sunny.UI
|
||||
fillColor = UIStyles.Blue.CheckBoxColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
@ -221,6 +225,10 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
if (!ReadOnly)
|
||||
|
@ -107,6 +107,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -163,6 +163,10 @@ namespace Sunny.UI
|
||||
DoubleClick?.Invoke(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return edit;
|
||||
|
@ -227,9 +227,9 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重绘
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">e</param>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
if (_backImage != null)
|
||||
|
@ -167,6 +167,10 @@ namespace Sunny.UI
|
||||
return clip;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
e.Graphics.Clear(fillColor);
|
||||
|
@ -135,6 +135,10 @@ namespace Sunny.UI
|
||||
//
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -243,6 +243,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
if (Text.IsNullOrEmpty()) return;
|
||||
|
@ -348,6 +348,10 @@ namespace Sunny.UI
|
||||
handler?.Invoke(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -182,6 +182,10 @@ namespace Sunny.UI
|
||||
set => SetRectColor(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
if (!ReadOnly) Active = !Active;
|
||||
|
@ -346,6 +346,10 @@ namespace Sunny.UI
|
||||
return Enabled ? color : symbolDisableColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
//重绘父类
|
||||
|
@ -243,6 +243,10 @@ namespace Sunny.UI
|
||||
foreColor = uiColor.LabelForeColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
//重绘父类
|
||||
|
@ -604,6 +604,10 @@ namespace Sunny.UI
|
||||
|
||||
private ConcurrentDictionary<int, bool> CloseRects = new ConcurrentDictionary<int, bool>();
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -334,6 +334,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -230,6 +230,10 @@ namespace Sunny.UI
|
||||
MouseLeave?.Invoke(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return edit;
|
||||
@ -1155,6 +1159,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -47,6 +47,10 @@ namespace Sunny.UI
|
||||
this.PerformLayout();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return edit;
|
||||
@ -106,6 +110,11 @@ namespace Sunny.UI
|
||||
|
||||
public event OnDateTimeChanged ValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">控件</param>
|
||||
/// <param name="value">值</param>
|
||||
protected override void ItemForm_ValueChanged(object sender, object value)
|
||||
{
|
||||
Value = (DateTime)value;
|
||||
@ -114,6 +123,9 @@ namespace Sunny.UI
|
||||
|
||||
private readonly UITimeItem item = new UITimeItem();
|
||||
|
||||
/// <summary>
|
||||
/// 创建对象
|
||||
/// </summary>
|
||||
protected override void CreateInstance()
|
||||
{
|
||||
ItemForm = new UIDropDown(item);
|
||||
|
@ -249,9 +249,9 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OnPaint
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">e</param>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -141,6 +141,10 @@ namespace Sunny.UI
|
||||
AfterLabelEdit?.Invoke(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 需要额外设置ToolTip的控件
|
||||
/// </summary>
|
||||
/// <returns>控件</returns>
|
||||
public Control ExToolTipControl()
|
||||
{
|
||||
return view;
|
||||
|
@ -372,6 +372,10 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
if (!Visible || Width <= 0 || Height <= 0) return;
|
||||
|
@ -65,6 +65,10 @@ namespace Sunny.UI
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
base.OnClick(e);
|
||||
@ -193,6 +197,10 @@ namespace Sunny.UI
|
||||
|
||||
int pipeSize = 20;
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -49,6 +49,10 @@ namespace Sunny.UI
|
||||
fillColor = uiColor.PlainColor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 点击事件
|
||||
/// </summary>
|
||||
/// <param name="e">参数</param>
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
base.OnClick(e);
|
||||
|
@ -65,6 +65,10 @@ namespace Sunny.UI
|
||||
timer.Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -981,6 +981,10 @@ namespace Sunny.UI
|
||||
|
||||
protected bool IsActive;
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
@ -539,6 +539,10 @@ namespace Sunny.UI
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重载绘图
|
||||
/// </summary>
|
||||
/// <param name="e">绘图参数</param>
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user