diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe
index 567a4738..d2ca0ff1 100644
Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ
diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll
index 4ca98abe..3ecd576f 100644
Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ
diff --git a/SunnyUI.Demo/FMain.cs b/SunnyUI.Demo/FMain.cs
index 0c7807ee..b6ccfb9f 100644
--- a/SunnyUI.Demo/FMain.cs
+++ b/SunnyUI.Demo/FMain.cs
@@ -14,26 +14,26 @@ namespace Sunny.UI.Demo
Header.SetNodeSymbol(Header.Nodes[0], 61451);
TreeNode parent = Aside.CreateNode("控件", 61451, 24, pageIndex);
//通过设置PageIndex关联,节点文字、图标由相应的Page的Text、Symbol提供
+ Aside.CreateChildNode(parent, AddPage(new FAvatar(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FButton(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FCheckBox(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FCombobox(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FContextMenuStrip(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FDataGridView(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FFlowLayoutPanel(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FHeaderButton(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FLabel(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FCheckBox(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FRadioButton(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FTextBox(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FCombobox(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FDataGridView(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FListBox(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FTreeView(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FNavigation(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FTabControl(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FLine(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FListBox(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FNavigation(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FPanel(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FFlowLayoutPanel(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FTransfer(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FAvatar(), ++pageIndex));
- Aside.CreateChildNode(parent, AddPage(new FContextMenuStrip(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FProcess(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FRadioButton(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FScrollBar(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FTabControl(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FTextBox(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FTransfer(), ++pageIndex));
+ Aside.CreateChildNode(parent, AddPage(new FTreeView(), ++pageIndex));
Aside.CreateChildNode(parent, AddPage(new FOther(), ++pageIndex));
//示例设置某个节点的小红点提示
Aside.ShowTips = true;
@@ -81,7 +81,7 @@ namespace Sunny.UI.Demo
AddPage(new FColorful());
//选中第一个节点
- Aside.SelectFirst();
+ Aside.SelectPage(1002);
}
private void Header_MenuItemClick(string text, int menuIndex, int pageIndex)
diff --git a/SunnyUI/Controls/UIHeaderButton.cs b/SunnyUI/Controls/UIHeaderButton.cs
index 43d3da6b..b3f4f163 100644
--- a/SunnyUI/Controls/UIHeaderButton.cs
+++ b/SunnyUI/Controls/UIHeaderButton.cs
@@ -20,6 +20,7 @@
* 2021-03-27: V3.0.2 增加字体图标背景时鼠标移上背景色
* 2021-06-01: V3.0.4 增加图片与文字的位置
* 2021-06-22: V3.0.4 增加ShowSelected,是否显示选中状态
+ * 2021-09-21: V3.0.7 增加Disabled颜色
******************************************************************************/
using System;
@@ -51,10 +52,16 @@ namespace Sunny.UI
foreHoverColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForeHoverColor;
forePressColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForePressColor;
foreSelectedColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonForeSelectedColor;
+
fillHoverColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillHoverColor;
fillPressColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillPressColor;
fillSelectedColor = UIStyles.GetStyleColor(UIStyle.Blue).ButtonFillSelectedColor;
+
SetStyle(ControlStyles.StandardDoubleClick, UseDoubleClick);
+
+ fillDisableColor = fillColor;
+ foreDisableColor = foreColor;
+ rectDisableColor = UIStyles.GetStyleColor(UIStyle.Blue).RectDisableColor;
}
private bool isClick;
@@ -141,9 +148,21 @@ namespace Sunny.UI
fillSelectedColor = uiColor.ButtonFillSelectedColor;
foreSelectedColor = uiColor.ButtonForeSelectedColor;
+ rectDisableColor = uiColor.RectDisableColor;
+ fillDisableColor = fillColor;
+ foreDisableColor = foreColor;
+
Invalidate();
}
+ [Description("不可用颜色"), Category("SunnyUI")]
+ [DefaultValue(typeof(Color), "173, 178, 181")]
+ public Color CircleDisabledColor
+ {
+ get => rectDisableColor;
+ set => SetRectDisableColor(value);
+ }
+
///
/// 填充颜色,当值为背景色或透明色或空值则不填充
///
@@ -155,6 +174,14 @@ namespace Sunny.UI
set => SetFillColor(value);
}
+ [Description("填充颜色"), Category("SunnyUI")]
+ [DefaultValue(typeof(Color), "80, 160, 255")]
+ public Color FillDisableColor
+ {
+ get => fillDisableColor;
+ set => SetFillDisableColor(value);
+ }
+
///
/// 字体颜色
///
@@ -166,15 +193,7 @@ namespace Sunny.UI
set => SetForeColor(value);
}
- [DefaultValue(typeof(Color), "244, 244, 244"), Category("SunnyUI")]
- [Description("不可用时填充颜色")]
- public Color FillDisableColor
- {
- get => fillDisableColor;
- set => SetFillDisableColor(value);
- }
-
- [DefaultValue(typeof(Color), "109, 109, 103"), Category("SunnyUI")]
+ [DefaultValue(typeof(Color), "White"), Category("SunnyUI")]
[Description("不可用时字体颜色")]
public Color ForeDisableColor
{
@@ -457,6 +476,7 @@ namespace Sunny.UI
if (Symbol > 0 && Image == null)
{
Color bcColor = CircleColor;
+ if (!Enabled) bcColor = CircleDisabledColor;
if (ShowCircleHoverColor && IsHover)
{
bcColor = CircleHoverColor;
@@ -484,6 +504,7 @@ namespace Sunny.UI
if (Symbol > 0 && Image == null)
{
Color bcColor = CircleColor;
+ if (!Enabled) bcColor = CircleDisabledColor;
if (ShowCircleHoverColor && IsHover)
{
bcColor = CircleHoverColor;
@@ -515,6 +536,7 @@ namespace Sunny.UI
if (Symbol > 0 && Image == null)
{
Color bcColor = CircleColor;
+ if (!Enabled) bcColor = CircleDisabledColor;
if (ShowCircleHoverColor && IsHover)
{
bcColor = CircleHoverColor;
@@ -542,6 +564,7 @@ namespace Sunny.UI
if (Symbol > 0 && Image == null)
{
Color bcColor = CircleColor;
+ if (!Enabled) bcColor = CircleDisabledColor;
if (ShowCircleHoverColor && IsHover)
{
bcColor = CircleHoverColor;
diff --git a/SunnyUI/Controls/UISwitch.cs b/SunnyUI/Controls/UISwitch.cs
index 6b19ec2b..c6b4cac9 100644
--- a/SunnyUI/Controls/UISwitch.cs
+++ b/SunnyUI/Controls/UISwitch.cs
@@ -196,11 +196,10 @@ namespace Sunny.UI
rectColor = uiColor.SwitchActiveColor;
fillColor = uiColor.SwitchFillColor;
inActiveColor = uiColor.SwitchInActiveColor;
- disabledColor = uiColor.RectDisableColor;
+ rectDisableColor = uiColor.RectDisableColor;
Invalidate();
}
- private Color disabledColor;
[Description("不可用颜色"), Category("SunnyUI")]
[DefaultValue(typeof(Color), "173, 178, 181")]
public Color DisabledColor
@@ -218,7 +217,7 @@ namespace Sunny.UI
protected override void OnPaintFill(Graphics g, GraphicsPath path)
{
Color color = Active ? ActiveColor : InActiveColor;
- if (!Enabled) color = disabledColor;
+ if (!Enabled) color = rectDisableColor;
if (SwitchShape == UISwitchShape.Round)
{