* 增加控件属性显示值及显示分类
This commit is contained in:
parent
99b7db183c
commit
00f8d9e293
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.
1
SunnyUI.Demo/Controls/FOther.Designer.cs
generated
1
SunnyUI.Demo/Controls/FOther.Designer.cs
generated
@ -256,6 +256,7 @@
|
||||
this.uiLedBulb4.BlinkInterval = 500;
|
||||
this.uiLedBulb4.Location = new System.Drawing.Point(507, 52);
|
||||
this.uiLedBulb4.Name = "uiLedBulb4";
|
||||
this.uiLedBulb4.On = false;
|
||||
this.uiLedBulb4.Size = new System.Drawing.Size(32, 32);
|
||||
this.uiLedBulb4.TabIndex = 41;
|
||||
this.uiLedBulb4.Text = "uiLedBulb4";
|
||||
|
@ -123,6 +123,9 @@
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="uiToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>107, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>35</value>
|
||||
</metadata>
|
||||
|
@ -63,6 +63,7 @@ namespace Sunny.UI
|
||||
|
||||
public event EventHandler ValueChanged;
|
||||
|
||||
[Description("滚动条当前值"), Category("SunnyUI")]
|
||||
[DefaultValue(0)]
|
||||
public int Value
|
||||
{
|
||||
@ -75,6 +76,7 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
[Description("滚动条最大值"), Category("SunnyUI")]
|
||||
[DefaultValue(100)]
|
||||
public int Maximum
|
||||
{
|
||||
@ -448,6 +450,7 @@ namespace Sunny.UI
|
||||
set => SetFillColor(value);
|
||||
}
|
||||
|
||||
[Description("鼠标移上颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "111, 168, 255")]
|
||||
public Color HoverColor
|
||||
{
|
||||
@ -455,6 +458,7 @@ namespace Sunny.UI
|
||||
set => SetFillHoveColor(value);
|
||||
}
|
||||
|
||||
[Description("鼠标按下颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "74, 131, 229")]
|
||||
public Color PressColor
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ namespace Sunny.UI
|
||||
[Description("获取或设置包含有关控件的数据的对象字符串"), Category("SunnyUI")]
|
||||
public string TagString { get; set; }
|
||||
|
||||
[Category("外观")]
|
||||
[Category("SunnyUI")]
|
||||
[Description("按钮文字")]
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
@ -67,6 +67,7 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
[Description("文字对齐方式"), Category("SunnyUI")]
|
||||
[DefaultValue(ContentAlignment.MiddleCenter)]
|
||||
public ContentAlignment TextAlign
|
||||
{
|
||||
@ -78,7 +79,7 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
[Category("外观")]
|
||||
[Category("SunnyUI")]
|
||||
[Description("文字字体")]
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
@ -92,7 +93,7 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
[Category("外观")]
|
||||
[Category("SunnyUI")]
|
||||
[Description("文字颜色")]
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
@ -109,10 +110,12 @@ namespace Sunny.UI
|
||||
|
||||
[Browsable(false)]
|
||||
[DefaultValue(typeof(Image), "null")]
|
||||
[Description("初始化图片"), Category("SunnyUI")]
|
||||
public new Image InitialImage { get; set; }
|
||||
|
||||
[Browsable(false)]
|
||||
[DefaultValue(typeof(Image), "null")]
|
||||
[Description("出错图片"), Category("SunnyUI")]
|
||||
public new Image ErrorImage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@ -137,6 +140,7 @@ namespace Sunny.UI
|
||||
/// 鼠标移上图片
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Image), "null")]
|
||||
[Description("鼠标移上图片"), Category("SunnyUI")]
|
||||
public Image ImageHover
|
||||
{
|
||||
get => imageHover;
|
||||
@ -152,6 +156,7 @@ namespace Sunny.UI
|
||||
/// 鼠标按下图片
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Image), "null")]
|
||||
[Description("鼠标按下图片"), Category("SunnyUI")]
|
||||
public Image ImagePress
|
||||
{
|
||||
get => imagePress;
|
||||
@ -167,6 +172,7 @@ namespace Sunny.UI
|
||||
/// 不可用时图片
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Image), "null")]
|
||||
[Description("不可用时图片"), Category("SunnyUI")]
|
||||
public Image ImageDisabled
|
||||
{
|
||||
get => imageDisabled;
|
||||
@ -178,9 +184,10 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 不可用时图片
|
||||
/// 选中时图片
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(Image), "null")]
|
||||
[Description("选中时图片"), Category("SunnyUI")]
|
||||
public Image ImageSelected
|
||||
{
|
||||
get => imageSelected;
|
||||
@ -195,6 +202,7 @@ namespace Sunny.UI
|
||||
/// 是否选中
|
||||
/// </summary>
|
||||
[DefaultValue(typeof(bool), "false")]
|
||||
[Description("是否选中"), Category("SunnyUI")]
|
||||
public bool Selected
|
||||
{
|
||||
get => selected;
|
||||
@ -272,6 +280,7 @@ namespace Sunny.UI
|
||||
public Point imageOffset;
|
||||
|
||||
[DefaultValue(typeof(Point), "0, 0")]
|
||||
[Description("图片偏移位置"), Category("SunnyUI")]
|
||||
public Point ImageOffset
|
||||
{
|
||||
get => imageOffset;
|
||||
|
@ -124,6 +124,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(100)]
|
||||
[Description("列表项高度"), Category("SunnyUI")]
|
||||
public int ItemHeight
|
||||
{
|
||||
get => listbox.ItemHeight;
|
||||
@ -131,6 +132,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(4)]
|
||||
[Description("图片文字间间隔"), Category("SunnyUI")]
|
||||
public int ImageInterval
|
||||
{
|
||||
get => listbox.ImageInterval;
|
||||
@ -138,6 +140,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(true)]
|
||||
[Description("显示说明文字"), Category("SunnyUI")]
|
||||
public bool ShowDescription
|
||||
{
|
||||
get => listbox.ShowDescription;
|
||||
@ -197,6 +200,7 @@ namespace Sunny.UI
|
||||
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
|
||||
[MergableProperty(false)]
|
||||
[Browsable(false)]
|
||||
[Description("列表项"), Category("SunnyUI")]
|
||||
public ListBox.ObjectCollection Items => listbox.Items;
|
||||
|
||||
/// <summary>
|
||||
@ -224,6 +228,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||
[Description("选中项背景颜色"), Category("SunnyUI")]
|
||||
public Color ItemSelectBackColor
|
||||
{
|
||||
get => listbox.ItemSelectBackColor;
|
||||
@ -231,6 +236,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "White")]
|
||||
[Description("选中项字体颜色"), Category("SunnyUI")]
|
||||
public Color ItemSelectForeColor
|
||||
{
|
||||
get => listbox.ItemSelectForeColor;
|
||||
@ -264,6 +270,7 @@ namespace Sunny.UI
|
||||
private Color hoverColor = Color.FromArgb(155, 200, 255);
|
||||
|
||||
[DefaultValue(typeof(Color), "155, 200, 255")]
|
||||
[Description("鼠标移上颜色"), Category("SunnyUI")]
|
||||
public Color HoverColor
|
||||
{
|
||||
get => hoverColor;
|
||||
@ -275,6 +282,7 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
[ToolboxItem(false)]
|
||||
private sealed class ImageListBox : ListBox, IStyleInterface
|
||||
{
|
||||
private UIScrollBar bar;
|
||||
|
@ -30,6 +30,9 @@ using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
{
|
||||
[ToolboxItem(true)]
|
||||
[DefaultEvent("Click")]
|
||||
[DefaultProperty("Text")]
|
||||
public class UILabel : Label, IStyleInterface
|
||||
{
|
||||
public UILabel()
|
||||
@ -133,6 +136,7 @@ namespace Sunny.UI
|
||||
private bool autoSize;
|
||||
|
||||
[Browsable(true)]
|
||||
[Description("自动大小"), Category("SunnyUI")]
|
||||
public override bool AutoSize
|
||||
{
|
||||
get => autoSize;
|
||||
@ -167,6 +171,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(24)]
|
||||
[Description("字体大小"), Category("SunnyUI")]
|
||||
public int SymbolSize
|
||||
{
|
||||
get => _symbolSize;
|
||||
@ -179,6 +184,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(2)]
|
||||
[Description("图标和文字间间隔"), Category("SunnyUI")]
|
||||
public int ImageInterval
|
||||
{
|
||||
get => _imageInterval;
|
||||
@ -192,6 +198,7 @@ namespace Sunny.UI
|
||||
private bool _isCircle;
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("显示为圆形"), Category("SunnyUI")]
|
||||
public bool IsCircle
|
||||
{
|
||||
get => _isCircle;
|
||||
@ -214,6 +221,7 @@ namespace Sunny.UI
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
[Editor(typeof(UIImagePropertyEditor), typeof(UITypeEditor))]
|
||||
[DefaultValue(61452)]
|
||||
[Description("字体图标"), Category("SunnyUI")]
|
||||
public int Symbol
|
||||
{
|
||||
get => _symbol;
|
||||
@ -232,6 +240,7 @@ namespace Sunny.UI
|
||||
private int circleRectWidth = 1;
|
||||
|
||||
[DefaultValue(1)]
|
||||
[Description("圆形边框大小"), Category("SunnyUI")]
|
||||
public int CircleRectWidth
|
||||
{
|
||||
get => circleRectWidth;
|
||||
@ -328,6 +337,9 @@ namespace Sunny.UI
|
||||
}
|
||||
}
|
||||
|
||||
[ToolboxItem(true)]
|
||||
[DefaultEvent("Click")]
|
||||
[DefaultProperty("Text")]
|
||||
public sealed class UILinkLabel : LinkLabel, IStyleInterface
|
||||
{
|
||||
public UILinkLabel()
|
||||
@ -341,11 +353,6 @@ namespace Sunny.UI
|
||||
LinkColor = UIColor.Blue;
|
||||
}
|
||||
|
||||
private void UILabel_ForeColorChanged(object sender, EventArgs e)
|
||||
{
|
||||
_style = UIStyle.Custom;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tag字符串
|
||||
/// </summary>
|
||||
|
@ -94,7 +94,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 边框颜色
|
||||
/// </summary>
|
||||
[Description("边框颜色")]
|
||||
[Description("边框颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "0, 0, 0")]
|
||||
public Color BorderColor
|
||||
{
|
||||
@ -109,7 +109,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 内线颜色
|
||||
/// </summary>
|
||||
[Description("内线颜色")]
|
||||
[Description("内线颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "0xC0, 0xC0, 0xC0")]
|
||||
public Color BorderInColor
|
||||
{
|
||||
@ -124,7 +124,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// LED背景色
|
||||
/// </summary>
|
||||
[Description("LED背景色")]
|
||||
[Description("LED背景色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "0, 0x33, 0")]
|
||||
public Color LedBackColor
|
||||
{
|
||||
@ -147,7 +147,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 边框宽度
|
||||
/// </summary>
|
||||
[DefaultValue(1), Description("边框宽度")]
|
||||
[DefaultValue(1), Description("边框宽度"), Category("SunnyUI")]
|
||||
public int BorderWidth
|
||||
{
|
||||
get => borderWidth;
|
||||
@ -165,7 +165,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 内线宽度
|
||||
/// </summary>
|
||||
[DefaultValue(1), Description("内线宽度")]
|
||||
[DefaultValue(1), Description("内线宽度"), Category("SunnyUI")]
|
||||
public int BorderInWidth
|
||||
{
|
||||
get => borderInWidth;
|
||||
@ -183,7 +183,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 左右边距
|
||||
/// </summary>
|
||||
[DefaultValue(2), Description("左右边距")]
|
||||
[DefaultValue(2), Description("左右边距"), Category("SunnyUI")]
|
||||
public int IntervalH
|
||||
{
|
||||
get => intervalH;
|
||||
@ -201,7 +201,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 上下边距
|
||||
/// </summary>
|
||||
[DefaultValue(5), Description("上下边距")]
|
||||
[DefaultValue(5), Description("上下边距"), Category("SunnyUI")]
|
||||
public int IntervalV
|
||||
{
|
||||
get => intervalV;
|
||||
@ -219,7 +219,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// LED亮块间距
|
||||
/// </summary>
|
||||
[DefaultValue(1), Description("LED亮块间距")]
|
||||
[DefaultValue(1), Description("LED亮块间距"), Category("SunnyUI")]
|
||||
public int IntervalIn
|
||||
{
|
||||
get => intervalIn;
|
||||
@ -237,7 +237,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// LED亮块大小
|
||||
/// </summary>
|
||||
[DefaultValue(2), Description("LED亮块大小")]
|
||||
[DefaultValue(2), Description("LED亮块大小"), Category("SunnyUI")]
|
||||
public int IntervalOn
|
||||
{
|
||||
get => intervalOn;
|
||||
@ -255,7 +255,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 显示字符个数
|
||||
/// </summary>
|
||||
[DefaultValue(10), Description("显示字符个数")]
|
||||
[DefaultValue(10), Description("显示字符个数"), Category("SunnyUI")]
|
||||
public int CharCount
|
||||
{
|
||||
get => charCount;
|
||||
|
@ -94,6 +94,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 计时
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public TimeSpan TimeSpan { get; private set; }
|
||||
|
||||
private DateTime StartTime;
|
||||
@ -119,11 +120,12 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 是否开始工作
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
public bool IsWorking => timer.Enabled;
|
||||
|
||||
private bool _active;
|
||||
|
||||
[DefaultValue(false)]
|
||||
[DefaultValue(false), Description("是否开始工作"), Category("SunnyUI")]
|
||||
public bool Active
|
||||
{
|
||||
get => _active;
|
||||
|
@ -48,7 +48,7 @@ namespace Sunny.UI
|
||||
|
||||
private int interval = 500;
|
||||
|
||||
[DefaultValue(500)]
|
||||
[DefaultValue(500), Description("显示间隔"), Category("SunnyUI")]
|
||||
public int Interval
|
||||
{
|
||||
get => interval;
|
||||
@ -72,6 +72,7 @@ namespace Sunny.UI
|
||||
private UILightState state = UILightState.On;
|
||||
|
||||
[DefaultValue(UILightState.On)]
|
||||
[Description("显示状态"), Category("SunnyUI")]
|
||||
public UILightState State
|
||||
{
|
||||
get => state;
|
||||
@ -162,6 +163,7 @@ namespace Sunny.UI
|
||||
private bool showCenterColor = true;
|
||||
|
||||
[DefaultValue(true)]
|
||||
[Description("是否显示中心颜色"), Category("SunnyUI")]
|
||||
public bool ShowCenterColor
|
||||
{
|
||||
get => showCenterColor;
|
||||
@ -175,6 +177,7 @@ namespace Sunny.UI
|
||||
private bool showLightLine = true;
|
||||
|
||||
[DefaultValue(true)]
|
||||
[Description("显示灯光亮线"), Category("SunnyUI")]
|
||||
public bool ShowLightLine
|
||||
{
|
||||
get => showLightLine;
|
||||
@ -188,6 +191,7 @@ namespace Sunny.UI
|
||||
private Color onColor = UIColor.Green;
|
||||
|
||||
[DefaultValue(typeof(Color), "110, 190, 40")]
|
||||
[Description("打开状态颜色"), Category("SunnyUI")]
|
||||
public Color OnColor
|
||||
{
|
||||
get => onColor;
|
||||
@ -201,6 +205,7 @@ namespace Sunny.UI
|
||||
private Color centerColor = UIColor.LightGreen;
|
||||
|
||||
[DefaultValue(typeof(Color), "110, 190, 40")]
|
||||
[Description("中心颜色"), Category("SunnyUI")]
|
||||
public Color CenterColor
|
||||
{
|
||||
get => centerColor;
|
||||
@ -214,6 +219,7 @@ namespace Sunny.UI
|
||||
private Color offColor = UIColor.Gray;
|
||||
|
||||
[DefaultValue(typeof(Color), "140, 140, 140")]
|
||||
[Description("关闭状态颜色"), Category("SunnyUI")]
|
||||
public Color OffColor
|
||||
{
|
||||
get => offColor;
|
||||
|
@ -53,6 +53,7 @@ namespace Sunny.UI
|
||||
private LineDirection direction = LineDirection.Horizontal;
|
||||
|
||||
[DefaultValue(LineDirection.Horizontal)]
|
||||
[Description("线条方向"), Category("SunnyUI")]
|
||||
public LineDirection Direction
|
||||
{
|
||||
get => direction;
|
||||
@ -65,7 +66,7 @@ namespace Sunny.UI
|
||||
|
||||
private int lineSize = 1;
|
||||
|
||||
[Description("线宽")]
|
||||
[Description("线条宽度"), Category("SunnyUI")]
|
||||
[DefaultValue(1)]
|
||||
public int LineSize
|
||||
{
|
||||
@ -119,6 +120,7 @@ namespace Sunny.UI
|
||||
private int textInterval = 10;
|
||||
|
||||
[DefaultValue(10)]
|
||||
[Description("文字边距间隔"), Category("SunnyUI")]
|
||||
public int TextInterval
|
||||
{
|
||||
get => textInterval;
|
||||
|
@ -121,6 +121,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(25)]
|
||||
[Description("列表项高度"), Category("SunnyUI")]
|
||||
public int ItemHeight
|
||||
{
|
||||
get => listbox.ItemHeight;
|
||||
@ -173,6 +174,7 @@ namespace Sunny.UI
|
||||
[Localizable(true)]
|
||||
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
|
||||
[MergableProperty(false)]
|
||||
[Description("列表项"), Category("SunnyUI")]
|
||||
public ListBox.ObjectCollection Items => listbox.Items;
|
||||
|
||||
[Browsable(false)]
|
||||
@ -184,6 +186,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||
[Description("列表项选中背景颜色"), Category("SunnyUI")]
|
||||
public Color ItemSelectBackColor
|
||||
{
|
||||
get => listbox.ItemSelectBackColor;
|
||||
@ -191,6 +194,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "White")]
|
||||
[Description("列表项选中字体颜色"), Category("SunnyUI")]
|
||||
public Color ItemSelectForeColor
|
||||
{
|
||||
get => listbox.ItemSelectForeColor;
|
||||
@ -224,6 +228,7 @@ namespace Sunny.UI
|
||||
private Color hoverColor = Color.FromArgb(155, 200, 255);
|
||||
|
||||
[DefaultValue(typeof(Color), "155, 200, 255")]
|
||||
[Description("列表项鼠标移上颜色"), Category("SunnyUI")]
|
||||
public Color HoverColor
|
||||
{
|
||||
get => hoverColor;
|
||||
|
@ -57,6 +57,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(null)]
|
||||
[Description("关联的TabControl"), Category("SunnyUI")]
|
||||
public UITabControl TabControl { get; set; }
|
||||
|
||||
public void SetNodeItem(TreeNode node, NavMenuItem item)
|
||||
@ -94,6 +95,7 @@ namespace Sunny.UI
|
||||
private UIMenuStyle _menuStyle = UIMenuStyle.Black;
|
||||
|
||||
[DefaultValue(UIMenuStyle.Black)]
|
||||
[Description("导航栏主题风格"), Category("SunnyUI")]
|
||||
public UIMenuStyle MenuStyle
|
||||
{
|
||||
get => _menuStyle;
|
||||
@ -137,6 +139,7 @@ namespace Sunny.UI
|
||||
private Color backColor = Color.FromArgb(56, 56, 56);
|
||||
|
||||
[DefaultValue(typeof(Color), "56, 56, 56")]
|
||||
[Description("背景颜色"), Category("SunnyUI")]
|
||||
public override Color BackColor
|
||||
{
|
||||
get => backColor;
|
||||
@ -160,6 +163,7 @@ namespace Sunny.UI
|
||||
private Color menuHoverColor = Color.FromArgb(76, 76, 76);
|
||||
|
||||
[DefaultValue(typeof(Color), "76, 76, 76")]
|
||||
[Description("菜单栏鼠标移上颜色"), Category("SunnyUI")]
|
||||
public Color MenuHoverColor
|
||||
{
|
||||
get => menuHoverColor;
|
||||
@ -209,9 +213,11 @@ namespace Sunny.UI
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
||||
[Localizable(true)]
|
||||
[MergableProperty(false)]
|
||||
[Description("菜单栏显示节点集合"), Category("SunnyUI")]
|
||||
public TreeNodeCollection Nodes => Menu.Nodes;
|
||||
|
||||
[DefaultValue(null)]
|
||||
[Description("图片列表"), Category("SunnyUI")]
|
||||
public ImageList ImageList
|
||||
{
|
||||
get => Menu.ImageList;
|
||||
@ -219,6 +225,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(null)]
|
||||
[Description("下拉菜单图片列表"), Category("SunnyUI")]
|
||||
public ImageList DropMenuImageList
|
||||
{
|
||||
get => NavBarMenu.ImageList;
|
||||
@ -228,6 +235,7 @@ namespace Sunny.UI
|
||||
private StringAlignment nodeAlignment = StringAlignment.Far;
|
||||
|
||||
[DefaultValue(StringAlignment.Far)]
|
||||
[Description("显示节点位置"), Category("SunnyUI")]
|
||||
public StringAlignment NodeAlignment
|
||||
{
|
||||
get => nodeAlignment;
|
||||
@ -247,6 +255,7 @@ namespace Sunny.UI
|
||||
private readonly NavMenuHelper MenuHelper = new NavMenuHelper();
|
||||
|
||||
[DefaultValue(-1)]
|
||||
[Description("选中菜单索引"), Category("SunnyUI")]
|
||||
public int SelectedIndex
|
||||
{
|
||||
get => selectedIndex;
|
||||
@ -271,6 +280,7 @@ namespace Sunny.UI
|
||||
private Color selectedForeColor = UIColor.Blue;
|
||||
|
||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||
[Description("选中菜单字体颜色"), Category("SunnyUI")]
|
||||
public Color SelectedForeColor
|
||||
{
|
||||
get => selectedForeColor;
|
||||
@ -363,6 +373,7 @@ namespace Sunny.UI
|
||||
private int _nodeInterval = 100;
|
||||
|
||||
[DefaultValue(100)]
|
||||
[Description("显示菜单边距"), Category("SunnyUI")]
|
||||
public int NodeInterval
|
||||
{
|
||||
get => _nodeInterval;
|
||||
@ -379,6 +390,7 @@ namespace Sunny.UI
|
||||
private Size nodeSize = new Size(130, 45);
|
||||
|
||||
[DefaultValue(typeof(Size), "130, 45")]
|
||||
[Description("显示菜单大小"), Category("SunnyUI")]
|
||||
public Size NodeSize
|
||||
{
|
||||
get => nodeSize;
|
||||
|
@ -72,6 +72,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("只显示一个打开的节点"), Category("SunnyUI")]
|
||||
public bool ShowOneNode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@ -91,6 +92,7 @@ namespace Sunny.UI
|
||||
private Color backColor = Color.FromArgb(56, 56, 56);
|
||||
|
||||
[DefaultValue(typeof(Color), "56, 56, 56")]
|
||||
[Description("背景颜色"), Category("SunnyUI")]
|
||||
public override Color BackColor
|
||||
{
|
||||
get => backColor;
|
||||
@ -108,7 +110,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 填充颜色,当值为背景色或透明色或空值则不填充
|
||||
/// </summary>
|
||||
[Description("背景颜色"), Category("SunnyUI")]
|
||||
[Description("填充颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "56, 56, 56")]
|
||||
public Color FillColor
|
||||
{
|
||||
@ -129,7 +131,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 填充颜色,当值为背景色或透明色或空值则不填充
|
||||
/// </summary>
|
||||
[Description("背景颜色"), Category("SunnyUI")]
|
||||
[Description("字体颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "Silver")]
|
||||
public override Color ForeColor
|
||||
{
|
||||
@ -164,6 +166,7 @@ namespace Sunny.UI
|
||||
public bool StyleCustomMode { get; set; }
|
||||
|
||||
[DefaultValue(null)]
|
||||
[Description("关联的TabControl"), Category("SunnyUI")]
|
||||
public UITabControl TabControl { get; set; }
|
||||
|
||||
private Color selectedColor = Color.FromArgb(36, 36, 36);
|
||||
@ -203,6 +206,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "36, 36, 36")]
|
||||
[Description("选中节点颜色"), Category("SunnyUI")]
|
||||
public Color SelectedColor
|
||||
{
|
||||
get => selectedColor;
|
||||
@ -222,7 +226,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 边框颜色
|
||||
/// </summary>
|
||||
[Description("选中Tab页高亮"), Category("SunnyUI")]
|
||||
[Description("选中节点高亮颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||
public Color SelectedHighColor
|
||||
|
||||
@ -239,6 +243,7 @@ namespace Sunny.UI
|
||||
private Color hoverColor = Color.FromArgb(76, 76, 76);
|
||||
|
||||
[DefaultValue(typeof(Color), "76, 76, 76")]
|
||||
[Description("鼠标移上颜色"), Category("SunnyUI")]
|
||||
public Color HoverColor
|
||||
{
|
||||
get => hoverColor;
|
||||
@ -278,6 +283,7 @@ namespace Sunny.UI
|
||||
private UIMenuStyle menuStyle = UIMenuStyle.Black;
|
||||
|
||||
[DefaultValue(UIMenuStyle.Black)]
|
||||
[Description("导航菜单主题风格"), Category("SunnyUI")]
|
||||
public UIMenuStyle MenuStyle
|
||||
{
|
||||
get => menuStyle;
|
||||
@ -314,6 +320,7 @@ namespace Sunny.UI
|
||||
private Color selectedForeColor = UIColor.Blue;
|
||||
|
||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||
[Description("选中节点字体颜色"), Category("SunnyUI")]
|
||||
public Color SelectedForeColor
|
||||
{
|
||||
get => selectedForeColor;
|
||||
@ -499,7 +506,7 @@ namespace Sunny.UI
|
||||
e.State == (TreeNodeStates.Focused | TreeNodeStates.Selected);
|
||||
}
|
||||
|
||||
[Description("展开节点后选中第一个子节点"), DefaultValue(true)]
|
||||
[Description("展开节点后选中第一个子节点"), DefaultValue(true), Category("SunnyUI")]
|
||||
public bool ExpandSelectFirst { get; set; } = true;
|
||||
|
||||
public string Version { get; }
|
||||
@ -815,6 +822,4 @@ namespace Sunny.UI
|
||||
return childNode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -69,6 +69,7 @@ namespace Sunny.UI
|
||||
/// 总页数
|
||||
/// </summary>
|
||||
[Browsable(false)]
|
||||
[Description("总页数"), Category("SunnyUI")]
|
||||
public int PageCount { get; private set; }
|
||||
|
||||
private int pagerCount = 7;
|
||||
@ -213,6 +214,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(true)]
|
||||
[Description("显示页面跳转按钮"), Category("SunnyUI")]
|
||||
public bool ShowJumpButton
|
||||
{
|
||||
get => p1.Visible;
|
||||
@ -224,6 +226,7 @@ namespace Sunny.UI
|
||||
[DefaultValue(null)]
|
||||
[RefreshProperties(RefreshProperties.Repaint)]
|
||||
[AttributeProvider(typeof(IListSource))]
|
||||
[Description("数据源"), Category("SunnyUI")]
|
||||
public object DataSource
|
||||
{
|
||||
get => dataSource;
|
||||
@ -241,11 +244,12 @@ namespace Sunny.UI
|
||||
dataSource = value;
|
||||
activePage = 1;
|
||||
TotalCount = dataManager?.List.Count ?? 0;
|
||||
DataSourceChanged?.Invoke(this,null);
|
||||
DataSourceChanged?.Invoke(this, null);
|
||||
}
|
||||
}
|
||||
|
||||
[Browsable(false)] public object PageDataSource { get; private set; }
|
||||
[Browsable(false)]
|
||||
public object PageDataSource { get; private set; }
|
||||
|
||||
private void UIDataGridPage_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ namespace Sunny.UI
|
||||
|
||||
private string text;
|
||||
|
||||
[Category("外观")]
|
||||
[Category("SunnyUI")]
|
||||
[Description("按钮文字")]
|
||||
[Browsable(true)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
@ -107,7 +107,7 @@ namespace Sunny.UI
|
||||
|
||||
private ToolStripStatusLabelBorderSides _rectSides = ToolStripStatusLabelBorderSides.All;
|
||||
|
||||
[DefaultValue(ToolStripStatusLabelBorderSides.All), Description("边框显示位置")]
|
||||
[DefaultValue(ToolStripStatusLabelBorderSides.All), Description("边框显示位置"), Category("SunnyUI")]
|
||||
public ToolStripStatusLabelBorderSides RectSides
|
||||
{
|
||||
get => _rectSides;
|
||||
@ -157,7 +157,7 @@ namespace Sunny.UI
|
||||
|
||||
private UICornerRadiusSides _radiusSides = UICornerRadiusSides.All;
|
||||
|
||||
[DefaultValue(UICornerRadiusSides.All), Description("圆角显示位置")]
|
||||
[DefaultValue(UICornerRadiusSides.All), Description("圆角显示位置"), Category("SunnyUI")]
|
||||
public UICornerRadiusSides RadiusSides
|
||||
{
|
||||
get => _radiusSides;
|
||||
@ -270,7 +270,7 @@ namespace Sunny.UI
|
||||
|
||||
private bool showText = true;
|
||||
|
||||
[Description("是否显示文字")]
|
||||
[Description("是否显示文字"), Category("SunnyUI")]
|
||||
[Browsable(false)]
|
||||
protected bool ShowText
|
||||
{
|
||||
@ -520,6 +520,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "244, 244, 244")]
|
||||
[Description("不可用时填充颜色"), Category("SunnyUI")]
|
||||
public Color FillDisableColor
|
||||
{
|
||||
get => fillDisableColor;
|
||||
@ -527,6 +528,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "173, 178, 181")]
|
||||
[Description("不可用时边框颜色"), Category("SunnyUI")]
|
||||
public Color RectDisableColor
|
||||
{
|
||||
get => rectDisableColor;
|
||||
@ -534,6 +536,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "109, 109, 103")]
|
||||
[Description("不可用时字体颜色"), Category("SunnyUI")]
|
||||
public Color ForeDisableColor
|
||||
{
|
||||
get => foreDisableColor;
|
||||
@ -582,7 +585,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 文字对齐方向
|
||||
/// </summary>
|
||||
[Description("文字对齐方向")]
|
||||
[Description("文字对齐方向"), Category("SunnyUI")]
|
||||
[DefaultValue(ContentAlignment.MiddleCenter)]
|
||||
public ContentAlignment TextAlignment
|
||||
{
|
||||
|
@ -50,6 +50,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(100)]
|
||||
[Description("最大值"), Category("SunnyUI")]
|
||||
public int Maximum
|
||||
{
|
||||
get => maximum;
|
||||
@ -63,6 +64,7 @@ namespace Sunny.UI
|
||||
private int posValue;
|
||||
|
||||
[DefaultValue(0)]
|
||||
[Description("当前位置"), Category("SunnyUI")]
|
||||
public int Value
|
||||
{
|
||||
get => posValue;
|
||||
@ -84,6 +86,7 @@ namespace Sunny.UI
|
||||
private bool showValue = true;
|
||||
|
||||
[DefaultValue(true)]
|
||||
[Description("显示进度值"), Category("SunnyUI")]
|
||||
public bool ShowValue
|
||||
{
|
||||
get => showValue;
|
||||
@ -95,6 +98,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(1)]
|
||||
[Description("步进值"), Category("SunnyUI")]
|
||||
public int Step { get; set; } = 1;
|
||||
|
||||
public void StepIt()
|
||||
|
@ -49,6 +49,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否只读"), Category("SunnyUI")]
|
||||
public bool ReadOnly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@ -66,6 +67,7 @@ namespace Sunny.UI
|
||||
private int _imageInterval = 3;
|
||||
|
||||
[DefaultValue(16)]
|
||||
[Description("按钮图片大小"), Category("SunnyUI")]
|
||||
public int ImageSize
|
||||
{
|
||||
get => _imageSize;
|
||||
@ -78,6 +80,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(3)]
|
||||
[Description("按钮图片文字间间隔"), Category("SunnyUI")]
|
||||
public int ImageInterval
|
||||
{
|
||||
get => _imageInterval;
|
||||
@ -91,6 +94,7 @@ namespace Sunny.UI
|
||||
private bool _checked;
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否选中"), Category("SunnyUI")]
|
||||
public bool Checked
|
||||
{
|
||||
get => _checked;
|
||||
|
@ -60,6 +60,7 @@ namespace Sunny.UI
|
||||
[Localizable(true)]
|
||||
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
|
||||
[MergableProperty(false)]
|
||||
[Description("列表项"), Category("SunnyUI")]
|
||||
public ListBox.ObjectCollection Items => ListBox.Items;
|
||||
|
||||
private CheckedListBoxEx listbox;
|
||||
@ -173,6 +174,7 @@ namespace Sunny.UI
|
||||
private int columnCount = 1;
|
||||
|
||||
[DefaultValue(1)]
|
||||
[Description("显示列个数"), Category("SunnyUI")]
|
||||
public int ColumnCount
|
||||
{
|
||||
get => columnCount;
|
||||
@ -186,6 +188,7 @@ namespace Sunny.UI
|
||||
private Size itemSize = new Size(150, 35);
|
||||
|
||||
[DefaultValue(typeof(Size), "150, 35")]
|
||||
[Description("列表项大小"), Category("SunnyUI")]
|
||||
public Size ItemSize
|
||||
{
|
||||
get => itemSize;
|
||||
@ -199,6 +202,7 @@ namespace Sunny.UI
|
||||
private Point startPos = new Point(12, 12);
|
||||
|
||||
[DefaultValue(typeof(Point), "12, 12")]
|
||||
[Description("列表项起始位置"), Category("SunnyUI")]
|
||||
public Point StartPos
|
||||
{
|
||||
get => startPos;
|
||||
@ -212,6 +216,7 @@ namespace Sunny.UI
|
||||
public int columnInterval;
|
||||
|
||||
[DefaultValue(0)]
|
||||
[Description("显示列间隔"), Category("SunnyUI")]
|
||||
public int ColumnInterval
|
||||
{
|
||||
get => columnInterval;
|
||||
@ -225,6 +230,7 @@ namespace Sunny.UI
|
||||
private int rowInterval;
|
||||
|
||||
[DefaultValue(0)]
|
||||
[Description("显示行间隔"), Category("SunnyUI")]
|
||||
public int RowInterval
|
||||
{
|
||||
get => rowInterval;
|
||||
|
@ -62,6 +62,7 @@ namespace Sunny.UI
|
||||
// }
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否只读"), Category("SunnyUI")]
|
||||
public bool ReadOnly
|
||||
{
|
||||
get => edit.ReadOnly;
|
||||
@ -176,8 +177,7 @@ namespace Sunny.UI
|
||||
KeyUp?.Invoke(sender, e);
|
||||
}
|
||||
|
||||
[CategoryAttribute("文字"), Browsable(true)]
|
||||
[DefaultValue("")]
|
||||
[Category("SunnyUI"), Browsable(true), DefaultValue(""), Description("文字")]
|
||||
public override string Text
|
||||
{
|
||||
get => edit.Text;
|
||||
@ -209,7 +209,7 @@ namespace Sunny.UI
|
||||
private void OnMouseWheel(object sender, MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseWheel(e);
|
||||
if (bar!=null && bar.Visible && edit!=null)
|
||||
if (bar != null && bar.Visible && edit != null)
|
||||
{
|
||||
var si = ScrollBarInfo.GetInfo(edit.Handle);
|
||||
if (e.Delta > 10)
|
||||
@ -785,7 +785,7 @@ namespace Sunny.UI
|
||||
|
||||
public void Select(int start, int length)
|
||||
{
|
||||
edit.Select(start,length);
|
||||
edit.Select(start, length);
|
||||
}
|
||||
|
||||
public void SelectAll()
|
||||
|
@ -100,6 +100,7 @@ namespace Sunny.UI
|
||||
/// 旋转方式
|
||||
/// </summary>
|
||||
[DefaultValue(TRunType.ClockWise)]
|
||||
[Description("旋转方式"), Category("SunnyUI")]
|
||||
public TRunType RunType
|
||||
{
|
||||
get => _runType;
|
||||
@ -116,6 +117,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(TMeterType.Gps)]
|
||||
[Description("显示类型"), Category("SunnyUI")]
|
||||
public TMeterType MeterType
|
||||
{
|
||||
get => _meterType;
|
||||
@ -147,6 +149,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 背景图片
|
||||
/// </summary>
|
||||
[Description("背景图片"), Category("SunnyUI")]
|
||||
public new Image BackgroundImage
|
||||
{
|
||||
get => _backImage;
|
||||
@ -172,6 +175,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 箭头图片
|
||||
/// </summary>
|
||||
[Description("箭头图片"), Category("SunnyUI")]
|
||||
public Image AngleImage
|
||||
{
|
||||
get => _angleImage;
|
||||
@ -186,6 +190,7 @@ namespace Sunny.UI
|
||||
/// 角度
|
||||
/// </summary>
|
||||
[DefaultValue(0)]
|
||||
[Description("角度"), Category("SunnyUI")]
|
||||
public double Angle
|
||||
{
|
||||
get => _angle;
|
||||
|
@ -65,6 +65,7 @@ namespace Sunny.UI
|
||||
public event EventHandler ValueChanged;
|
||||
|
||||
[DefaultValue(0)]
|
||||
[Description("当前值"), Category("SunnyUI")]
|
||||
public int Value
|
||||
{
|
||||
get => scrollValue;
|
||||
@ -77,6 +78,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(100)]
|
||||
[Description("最大值"), Category("SunnyUI")]
|
||||
public int Maximum
|
||||
{
|
||||
get => maximum;
|
||||
@ -454,6 +456,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "111, 168, 255")]
|
||||
[Description("鼠标移上颜色"), Category("SunnyUI")]
|
||||
public Color HoverColor
|
||||
{
|
||||
get => fillHoverColor;
|
||||
@ -461,6 +464,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "74, 131, 229")]
|
||||
[Description("鼠标按下颜色"), Category("SunnyUI")]
|
||||
public Color PressColor
|
||||
{
|
||||
get => fillPressColor;
|
||||
|
@ -1,4 +1,25 @@
|
||||
using System;
|
||||
/******************************************************************************
|
||||
* 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.
|
||||
* 如果您使用此代码,请保留此说明。
|
||||
******************************************************************************
|
||||
* 文件名称: UIScrollingText.cs
|
||||
* 文件说明: 滚动文字
|
||||
* 当前版本: V2.2
|
||||
* 创建日期: 2020-06-29
|
||||
*
|
||||
* 2020-06-29: V2.2.6 新增控件
|
||||
******************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
@ -37,7 +58,7 @@ namespace Sunny.UI
|
||||
timer.Stop();
|
||||
}
|
||||
|
||||
[DefaultValue(200), Description("刷新间隔")]
|
||||
[DefaultValue(200), Description("刷新间隔"), Category("SunnyUI")]
|
||||
public int Interval
|
||||
{
|
||||
get => interval;
|
||||
@ -52,7 +73,7 @@ namespace Sunny.UI
|
||||
|
||||
private int offset = 10;
|
||||
|
||||
[DefaultValue(10), Description("偏移量")]
|
||||
[DefaultValue(10), Description("偏移量"), Category("SunnyUI")]
|
||||
public int Offset
|
||||
{
|
||||
get => offset;
|
||||
@ -167,7 +188,7 @@ namespace Sunny.UI
|
||||
|
||||
private UIScrollingType scrollingType;
|
||||
|
||||
[DefaultValue(UIScrollingType.RightToLeft), Description("滚动方向")]
|
||||
[DefaultValue(UIScrollingType.RightToLeft), Description("滚动方向"), Category("SunnyUI")]
|
||||
public UIScrollingType ScrollingType
|
||||
{
|
||||
get => scrollingType;
|
||||
@ -224,6 +245,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "244, 244, 244")]
|
||||
[Description("不可用时填充颜色"), Category("SunnyUI")]
|
||||
public Color FillDisableColor
|
||||
{
|
||||
get => fillDisableColor;
|
||||
@ -231,6 +253,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "173, 178, 181")]
|
||||
[Description("不可用时边框颜色"), Category("SunnyUI")]
|
||||
public Color RectDisableColor
|
||||
{
|
||||
get => rectDisableColor;
|
||||
@ -238,6 +261,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "109, 109, 103")]
|
||||
[Description("不可用时字体颜色"), Category("SunnyUI")]
|
||||
public Color ForeDisableColor
|
||||
{
|
||||
get => foreDisableColor;
|
||||
|
@ -61,6 +61,7 @@ namespace Sunny.UI
|
||||
private bool activeValue;
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否打开"), Category("SunnyUI")]
|
||||
public bool Active
|
||||
{
|
||||
get => activeValue;
|
||||
@ -75,6 +76,7 @@ namespace Sunny.UI
|
||||
private string activeText = "开";
|
||||
|
||||
[DefaultValue("开")]
|
||||
[Description("打开文字"), Category("SunnyUI")]
|
||||
public string ActiveText
|
||||
{
|
||||
get => activeText;
|
||||
@ -88,6 +90,7 @@ namespace Sunny.UI
|
||||
private string inActiveText = "关";
|
||||
|
||||
[DefaultValue("关")]
|
||||
[Description("关闭文字"), Category("SunnyUI")]
|
||||
public string InActiveText
|
||||
{
|
||||
get => inActiveText;
|
||||
@ -101,6 +104,7 @@ namespace Sunny.UI
|
||||
private Color inActiveColor;
|
||||
|
||||
[DefaultValue(typeof(Color), "Silver")]
|
||||
[Description("关闭颜色"), Category("SunnyUI")]
|
||||
public Color InActiveColor
|
||||
{
|
||||
get => inActiveColor;
|
||||
@ -125,7 +129,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 边框颜色
|
||||
/// </summary>
|
||||
[Description("选中颜色"), Category("SunnyUI")]
|
||||
[Description("打开颜色"), Category("SunnyUI")]
|
||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||
public Color ActiveColor
|
||||
{
|
||||
|
@ -42,6 +42,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(24)]
|
||||
[Description("字体图标大小"), Category("SunnyUI")]
|
||||
public int SymbolSize
|
||||
{
|
||||
get => _symbolSize;
|
||||
@ -54,11 +55,13 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(null)]
|
||||
[Description("图片"), Category("SunnyUI")]
|
||||
public Image Image { get; set; }
|
||||
|
||||
private ContentAlignment imageAlign = ContentAlignment.MiddleCenter;
|
||||
|
||||
[DefaultValue(ContentAlignment.MiddleCenter)]
|
||||
[Description("图片放置位置"), Category("SunnyUI")]
|
||||
public ContentAlignment ImageAlign
|
||||
{
|
||||
get => imageAlign;
|
||||
@ -70,6 +73,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(2)]
|
||||
[Description("图片文字间间隔"), Category("SunnyUI")]
|
||||
public int ImageInterval
|
||||
{
|
||||
get => _imageInterval;
|
||||
@ -83,6 +87,7 @@ namespace Sunny.UI
|
||||
private bool _isCircle;
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否是圆形"), Category("SunnyUI")]
|
||||
public bool IsCircle
|
||||
{
|
||||
get => _isCircle;
|
||||
@ -105,6 +110,7 @@ namespace Sunny.UI
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
|
||||
[Editor(typeof(UIImagePropertyEditor), typeof(UITypeEditor))]
|
||||
[DefaultValue(61452)]
|
||||
[Description("字体图标"), Category("SunnyUI")]
|
||||
public int Symbol
|
||||
{
|
||||
get => _symbol;
|
||||
@ -131,6 +137,7 @@ namespace Sunny.UI
|
||||
private int circleRectWidth = 1;
|
||||
|
||||
[DefaultValue(1)]
|
||||
[Description("圆形边框大小"), Category("SunnyUI")]
|
||||
public int CircleRectWidth
|
||||
{
|
||||
get => circleRectWidth;
|
||||
|
@ -85,6 +85,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(true)]
|
||||
[Description("是否禁用Ctrl+Tab"), Category("SunnyUI")]
|
||||
public bool ForbidCtrlTab { get; set; } = true;
|
||||
|
||||
public void SelectPage(int pageIndex) => Helper.SelectPage(pageIndex);
|
||||
@ -128,6 +129,7 @@ namespace Sunny.UI
|
||||
private HorizontalAlignment textAlignment = HorizontalAlignment.Center;
|
||||
|
||||
[DefaultValue(HorizontalAlignment.Center)]
|
||||
[Description("文字显示方向"), Category("SunnyUI")]
|
||||
public HorizontalAlignment TextAlignment
|
||||
{
|
||||
get => textAlignment;
|
||||
@ -141,6 +143,7 @@ namespace Sunny.UI
|
||||
private bool tabVisible = true;
|
||||
|
||||
[DefaultValue(true)]
|
||||
[Description("标签页是否显示"), Category("SunnyUI")]
|
||||
public bool TabVisible
|
||||
{
|
||||
get => tabVisible;
|
||||
@ -281,6 +284,7 @@ namespace Sunny.UI
|
||||
set => SetStyle(value);
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public override Rectangle DisplayRectangle
|
||||
{
|
||||
get
|
||||
@ -323,6 +327,7 @@ namespace Sunny.UI
|
||||
private UIMenuStyle _menuStyle = UIMenuStyle.Black;
|
||||
|
||||
[DefaultValue(UIMenuStyle.Black)]
|
||||
[Description("主题风格"), Category("SunnyUI")]
|
||||
public UIMenuStyle MenuStyle
|
||||
{
|
||||
get => _menuStyle;
|
||||
@ -356,7 +361,7 @@ namespace Sunny.UI
|
||||
|
||||
private bool showCloseButton;
|
||||
|
||||
[DefaultValue(false), Description("所有Tab页面标题显示关闭按钮")]
|
||||
[DefaultValue(false), Description("所有Tab页面标题显示关闭按钮"), Category("SunnyUI")]
|
||||
public bool ShowCloseButton
|
||||
{
|
||||
get => showCloseButton;
|
||||
@ -370,7 +375,7 @@ namespace Sunny.UI
|
||||
|
||||
private bool showActiveCloseButton;
|
||||
|
||||
[DefaultValue(false), Description("当前激活的Tab页面标题显示关闭按钮")]
|
||||
[DefaultValue(false), Description("当前激活的Tab页面标题显示关闭按钮"), Category("SunnyUI")]
|
||||
public bool ShowActiveCloseButton
|
||||
{
|
||||
get => showActiveCloseButton;
|
||||
@ -526,6 +531,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(UITabPosition.Left)]
|
||||
[Description("标签页显示位置"), Category("SunnyUI")]
|
||||
public UITabPosition TabPosition
|
||||
{
|
||||
get => (RightToLeftLayout && RightToLeft == RightToLeft.Yes)
|
||||
|
@ -59,6 +59,8 @@ namespace Sunny.UI
|
||||
|
||||
private HorizontalAlignment textAlignment = HorizontalAlignment.Center;
|
||||
|
||||
[Description("文字显示方向"), Category("SunnyUI")]
|
||||
[DefaultValue(HorizontalAlignment.Center)]
|
||||
public HorizontalAlignment TextAlignment
|
||||
{
|
||||
get => textAlignment;
|
||||
@ -225,6 +227,7 @@ namespace Sunny.UI
|
||||
private UIMenuStyle _menuStyle = UIMenuStyle.Black;
|
||||
|
||||
[DefaultValue(UIMenuStyle.Black)]
|
||||
[Description("主题风格"), Category("SunnyUI")]
|
||||
public UIMenuStyle MenuStyle
|
||||
{
|
||||
get => _menuStyle;
|
||||
|
@ -222,6 +222,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(null)]
|
||||
[Description("水印文字"), Category("SunnyUI")]
|
||||
public string Watermark
|
||||
{
|
||||
get => edit.Watermark;
|
||||
@ -345,6 +346,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue('\0')]
|
||||
[Description("密码掩码"), Category("SunnyUI")]
|
||||
public char PasswordChar
|
||||
{
|
||||
get => edit.PasswordChar;
|
||||
@ -352,6 +354,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否只读"), Category("SunnyUI")]
|
||||
public bool ReadOnly
|
||||
{
|
||||
get => edit.ReadOnly;
|
||||
@ -373,7 +376,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 当InputType为数字类型时,能输入的最大值
|
||||
/// </summary>
|
||||
[Description("当InputType为数字类型时,能输入的最大值。")]
|
||||
[Description("当InputType为数字类型时,能输入的最大值。"), Category("SunnyUI")]
|
||||
[DefaultValue(int.MaxValue)]
|
||||
public double Maximum
|
||||
{
|
||||
@ -384,7 +387,7 @@ namespace Sunny.UI
|
||||
/// <summary>
|
||||
/// 当InputType为数字类型时,能输入的最小值
|
||||
/// </summary>
|
||||
[Description("当InputType为数字类型时,能输入的最小值。")]
|
||||
[Description("当InputType为数字类型时,能输入的最小值。"), Category("SunnyUI")]
|
||||
[DefaultValue(int.MinValue)]
|
||||
public double Minimum
|
||||
{
|
||||
@ -393,6 +396,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否判断最大值显示"), Category("SunnyUI")]
|
||||
public bool HasMaximum
|
||||
{
|
||||
get => edit.HasMaxValue;
|
||||
@ -400,6 +404,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否判断最小值显示"), Category("SunnyUI")]
|
||||
public bool HasMinimum
|
||||
{
|
||||
get => edit.HasMinValue;
|
||||
@ -407,6 +412,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(0.00)]
|
||||
[Description("浮点返回值"), Category("SunnyUI")]
|
||||
public double DoubleValue
|
||||
{
|
||||
get => edit.DoubleValue;
|
||||
@ -414,13 +420,15 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(0)]
|
||||
[Description("整形返回值"), Category("SunnyUI")]
|
||||
public int IntValue
|
||||
{
|
||||
get => edit.IntValue;
|
||||
set => edit.IntValue = value;
|
||||
}
|
||||
|
||||
[CategoryAttribute("文字"), Browsable(true)]
|
||||
[Description("文本返回值"), Category("SunnyUI")]
|
||||
[Browsable(true)]
|
||||
[DefaultValue("")]
|
||||
public override string Text
|
||||
{
|
||||
@ -432,7 +440,7 @@ namespace Sunny.UI
|
||||
/// 当InputType为数字类型时,小数位数。
|
||||
/// </summary>
|
||||
[Description("当InputType为数字类型时,小数位数。")]
|
||||
[DefaultValue(2)]
|
||||
[DefaultValue(2), Category("SunnyUI")]
|
||||
public int DecLength
|
||||
{
|
||||
get => edit.DecLength;
|
||||
@ -440,6 +448,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("整形或浮点输入时,是否可空显示"), Category("SunnyUI")]
|
||||
public bool CanEmpty
|
||||
{
|
||||
get => edit.CanEmpty;
|
||||
|
@ -81,6 +81,7 @@ namespace Sunny.UI
|
||||
/// 文字对齐方向
|
||||
/// </summary>
|
||||
[DefaultValue(HorizontalAlignment.Center)]
|
||||
[Description("文字对齐方向"), Category("SunnyUI")]
|
||||
public HorizontalAlignment TextAlign
|
||||
{
|
||||
get => textAlign;
|
||||
@ -94,6 +95,7 @@ namespace Sunny.UI
|
||||
private Color titleColor = UIColor.Blue;
|
||||
|
||||
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||
[Description("标题颜色"), Category("SunnyUI")]
|
||||
public Color TitleColor
|
||||
{
|
||||
get => titleColor;
|
||||
@ -171,6 +173,7 @@ namespace Sunny.UI
|
||||
private int _titleInterval = 10;
|
||||
|
||||
[DefaultValue(10)]
|
||||
[Description("标题文字局左或者局右时与边框距离"), Category("SunnyUI")]
|
||||
public int TitleInterval
|
||||
{
|
||||
get => _titleInterval;
|
||||
|
@ -47,20 +47,22 @@ namespace Sunny.UI
|
||||
InitOwnerDraw();
|
||||
}
|
||||
|
||||
[DefaultValue("ToolTip title"), Category("SunnyUI"), Description("标题")]
|
||||
public new string ToolTipTitle { get; set; } = "ToolTip title";
|
||||
|
||||
[DefaultValue(typeof(Font), "微软雅黑, 9pt")]
|
||||
[DefaultValue(typeof(Font), "微软雅黑, 9pt"), Description("字体"), Category("SunnyUI")]
|
||||
public Font Font { get; set; } = new Font("微软雅黑", 9);
|
||||
|
||||
[DefaultValue(typeof(Font), "微软雅黑, 12pt")]
|
||||
[DefaultValue(typeof(Font), "微软雅黑, 12pt"), Description("标题字体"), Category("SunnyUI")]
|
||||
public Font TitleFont { get; set; } = new Font("微软雅黑", 12);
|
||||
|
||||
[DefaultValue(typeof(Color), "239, 239, 239")]
|
||||
[DefaultValue(typeof(Color), "239, 239, 239"), Description("边框颜色"), Category("SunnyUI")]
|
||||
public Color RectColor { get; set; } = UIChartStyles.Dark.ForeColor;
|
||||
|
||||
[DefaultValue(true)] public bool AutoSize { get; set; } = true;
|
||||
[DefaultValue(true), Description("自动大小"), Category("SunnyUI")]
|
||||
public bool AutoSize { get; set; } = true;
|
||||
|
||||
[DefaultValue(typeof(Size), "100, 70")]
|
||||
[DefaultValue(typeof(Size), "100, 70"), Description("不自动缩放时大小"), Category("SunnyUI")]
|
||||
public Size Size { get; set; } = new Size(100, 70);
|
||||
|
||||
public void SetToolTip(Control control, string description, string title, int symbol, int symbolSize,
|
||||
@ -189,7 +191,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
SizeF textSize = g.MeasureString(tooltip.Description, Font);
|
||||
int allWidth = (int) Math.Max(textSize.Width, titleSize.Width) + 10;
|
||||
int allWidth = (int)Math.Max(textSize.Width, titleSize.Width) + 10;
|
||||
if (symbolWidth > 0) allWidth = allWidth + symbolWidth + 5;
|
||||
int allHeight = titleSize.Height > 0 ?
|
||||
(int)titleSize.Height + (int)textSize.Height + 15 :
|
||||
@ -226,20 +228,20 @@ namespace Sunny.UI
|
||||
titleSize = e.Graphics.MeasureString(tooltip.Title, TitleFont);
|
||||
}
|
||||
|
||||
e.Graphics.DrawString(tooltip.Title,TitleFont,ForeColor,
|
||||
tooltip.Symbol>0?tooltip.SymbolSize+5:5, 5);
|
||||
e.Graphics.DrawString(tooltip.Title, TitleFont, ForeColor,
|
||||
tooltip.Symbol > 0 ? tooltip.SymbolSize + 5 : 5, 5);
|
||||
}
|
||||
|
||||
if (titleSize.Height > 0)
|
||||
{
|
||||
e.Graphics.DrawLine(ForeColor,
|
||||
symbolWidth==0?5:symbolWidth+5, 5+ titleSize.Height + 3,
|
||||
symbolWidth == 0 ? 5 : symbolWidth + 5, 5 + titleSize.Height + 3,
|
||||
e.Bounds.Width - 5, 5 + titleSize.Height + 3);
|
||||
}
|
||||
|
||||
e.Graphics.DrawString(e.ToolTipText, Font, ForeColor,
|
||||
tooltip.Symbol > 0 ? tooltip.SymbolSize + 5 : 5,
|
||||
titleSize.Height > 0? 10+ titleSize.Height : 5);
|
||||
titleSize.Height > 0 ? 10 + titleSize.Height : 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -52,9 +52,11 @@ namespace Sunny.UI
|
||||
private int trackBarValue;
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否只读"), Category("SunnyUI")]
|
||||
public bool ReadOnly { get; set; }
|
||||
|
||||
[DefaultValue(100)]
|
||||
[Description("最大值"), Category("SunnyUI")]
|
||||
public int Maximum
|
||||
{
|
||||
get => _maximum;
|
||||
@ -69,6 +71,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(0)]
|
||||
[Description("最小值"), Category("SunnyUI")]
|
||||
public int Minimum
|
||||
{
|
||||
get => _minimum;
|
||||
@ -83,6 +86,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(0)]
|
||||
[Description("当前值"), Category("SunnyUI")]
|
||||
public int Value
|
||||
{
|
||||
get => trackBarValue;
|
||||
@ -202,6 +206,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(typeof(Color), "173, 178, 181")]
|
||||
[Description("不可用时颜色"), Category("SunnyUI")]
|
||||
public Color DisableColor
|
||||
{
|
||||
get => rectDisableColor;
|
||||
|
@ -48,7 +48,7 @@ namespace Sunny.UI
|
||||
[Localizable(true)]
|
||||
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
|
||||
[MergableProperty(false)]
|
||||
[Description("左侧列表")]
|
||||
[Description("左侧列表"), Category("SunnyUI")]
|
||||
public ListBox.ObjectCollection ItemsLeft => l1.Items;
|
||||
|
||||
/// <summary>
|
||||
@ -58,7 +58,7 @@ namespace Sunny.UI
|
||||
[Localizable(true)]
|
||||
[Editor("System.Windows.Forms.Design.ListControlStringCollectionEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
|
||||
[MergableProperty(false)]
|
||||
[Description("右侧列表")]
|
||||
[Description("右侧列表"), Category("SunnyUI")]
|
||||
public ListBox.ObjectCollection ItemsRight => l2.Items;
|
||||
|
||||
private void b1_Click(object sender, EventArgs e)
|
||||
|
@ -59,6 +59,7 @@ namespace Sunny.UI
|
||||
private int blockCount = 20;
|
||||
|
||||
[DefaultValue(20)]
|
||||
[Description("显示块个数,此数越大,移动速度越快"), Category("SunnyUI")]
|
||||
public int BlockCount
|
||||
{
|
||||
get => blockCount;
|
||||
@ -88,6 +89,7 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
[DefaultValue(200)]
|
||||
[Description("移动显示时间间隔"), Category("SunnyUI")]
|
||||
public int Interval
|
||||
{
|
||||
get => timer.Interval;
|
||||
@ -102,6 +104,7 @@ namespace Sunny.UI
|
||||
private int sliderWidth = 60;
|
||||
|
||||
[DefaultValue(60)]
|
||||
[Description("滑块宽度"), Category("SunnyUI")]
|
||||
public int SliderWidth
|
||||
{
|
||||
get => sliderWidth;
|
||||
|
Loading…
x
Reference in New Issue
Block a user