* UIButton:Tips颜色可设置
This commit is contained in:
parent
7b0b79da56
commit
81c8b43879
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/FButton.Designer.cs
generated
1
SunnyUI.Demo/Controls/FButton.Designer.cs
generated
@ -174,6 +174,7 @@
|
|||||||
this.uiButton1.StyleCustomMode = true;
|
this.uiButton1.StyleCustomMode = true;
|
||||||
this.uiButton1.TabIndex = 0;
|
this.uiButton1.TabIndex = 0;
|
||||||
this.uiButton1.Text = "White";
|
this.uiButton1.Text = "White";
|
||||||
|
this.uiButton1.TipsText = "1";
|
||||||
this.uiToolTip1.SetToolTip(this.uiButton1, "White");
|
this.uiToolTip1.SetToolTip(this.uiButton1, "White");
|
||||||
//
|
//
|
||||||
// uiButton2
|
// uiButton2
|
||||||
|
@ -120,9 +120,6 @@
|
|||||||
<metadata name="uiToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="uiToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="uiToolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
|
||||||
<value>17, 17</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>52</value>
|
<value>52</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
1
SunnyUI.Demo/Forms/FEdit.Designer.cs
generated
1
SunnyUI.Demo/Forms/FEdit.Designer.cs
generated
@ -188,6 +188,7 @@
|
|||||||
this.edtDate.Font = new System.Drawing.Font("微软雅黑", 12F);
|
this.edtDate.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||||
this.edtDate.Location = new System.Drawing.Point(150, 215);
|
this.edtDate.Location = new System.Drawing.Point(150, 215);
|
||||||
this.edtDate.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.edtDate.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
|
this.edtDate.MaxLength = 10;
|
||||||
this.edtDate.MinimumSize = new System.Drawing.Size(63, 0);
|
this.edtDate.MinimumSize = new System.Drawing.Size(63, 0);
|
||||||
this.edtDate.Name = "edtDate";
|
this.edtDate.Name = "edtDate";
|
||||||
this.edtDate.Padding = new System.Windows.Forms.Padding(0, 0, 30, 0);
|
this.edtDate.Padding = new System.Windows.Forms.Padding(0, 0, 30, 0);
|
||||||
|
@ -146,6 +146,19 @@ namespace Sunny.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Color tipsColor = Color.Red;
|
||||||
|
|
||||||
|
[DefaultValue(typeof(Color), "Red")]
|
||||||
|
public Color TipsColor
|
||||||
|
{
|
||||||
|
get => tipsColor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
tipsColor = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnPaint(PaintEventArgs e)
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnPaint(e);
|
base.OnPaint(e);
|
||||||
@ -157,7 +170,7 @@ namespace Sunny.UI
|
|||||||
float sfMax = Math.Max(sf.Width, sf.Height);
|
float sfMax = Math.Max(sf.Width, sf.Height);
|
||||||
float x = Width - 1 - 2 - sfMax;
|
float x = Width - 1 - 2 - sfMax;
|
||||||
float y = 1 + 1;
|
float y = 1 + 1;
|
||||||
e.Graphics.FillEllipse(UIColor.Red, x, y, sfMax, sfMax);
|
e.Graphics.FillEllipse(TipsColor, x, y, sfMax, sfMax);
|
||||||
e.Graphics.DrawString(TipsText, TipsFont, Color.White, x + sfMax / 2.0f - sf.Width / 2.0f, y + sfMax / 2.0f - sf.Height / 2.0f);
|
e.Graphics.DrawString(TipsText, TipsFont, Color.White, x + sfMax / 2.0f - sf.Width / 2.0f, y + sfMax / 2.0f - sf.Height / 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -494,12 +494,25 @@ namespace Sunny.UI
|
|||||||
float tipsLeft = Width - (ScrollBarVisible ? 50 : 30) - 6 - sfMax;
|
float tipsLeft = Width - (ScrollBarVisible ? 50 : 30) - 6 - sfMax;
|
||||||
float tipsTop = e.Bounds.Y + (ItemHeight - sfMax) / 2;
|
float tipsTop = e.Bounds.Y + (ItemHeight - sfMax) / 2;
|
||||||
|
|
||||||
e.Graphics.FillEllipse(UIColor.Red, tipsLeft, tipsTop, sfMax, sfMax);
|
e.Graphics.FillEllipse(TipsColor, tipsLeft, tipsTop, sfMax, sfMax);
|
||||||
e.Graphics.DrawString(MenuHelper.GetTipsText(e.Node), TipsFont, Color.White, tipsLeft + sfMax / 2.0f - tipsSize.Width / 2.0f, tipsTop + 1 + sfMax / 2.0f - tipsSize.Height / 2.0f);
|
e.Graphics.DrawString(MenuHelper.GetTipsText(e.Node), TipsFont, Color.White, tipsLeft + sfMax / 2.0f - tipsSize.Width / 2.0f, tipsTop + 1 + sfMax / 2.0f - tipsSize.Height / 2.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Color tipsColor = Color.Red;
|
||||||
|
|
||||||
|
[DefaultValue(typeof(Color), "Red")]
|
||||||
|
public Color TipsColor
|
||||||
|
{
|
||||||
|
get => tipsColor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
tipsColor = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool TreeNodeSelected(DrawTreeNodeEventArgs e)
|
private bool TreeNodeSelected(DrawTreeNodeEventArgs e)
|
||||||
{
|
{
|
||||||
return e.State == TreeNodeStates.Selected || e.State == TreeNodeStates.Focused ||
|
return e.State == TreeNodeStates.Selected || e.State == TreeNodeStates.Focused ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user