* UICombobox:增加TextChange事件
* 取消部分ResizeRedraw
This commit is contained in:
parent
1fac28592f
commit
f30ffa9f19
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/FMain.Designer.cs
generated
1
SunnyUI.Demo/FMain.Designer.cs
generated
@ -105,6 +105,7 @@
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1024, 720);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.MinimumSize = new System.Drawing.Size(1024, 720);
|
||||
this.Name = "FMain";
|
||||
this.Padding = new System.Windows.Forms.Padding(2, 35, 2, 2);
|
||||
this.ShowDragStretch = true;
|
||||
|
@ -81,6 +81,7 @@ namespace Sunny.UI
|
||||
|
||||
public new event KeyPressEventHandler KeyPress;
|
||||
|
||||
[Browsable(true)]
|
||||
public new event EventHandler TextChanged;
|
||||
|
||||
private void EditOnKeyPress(object sender, KeyPressEventArgs e)
|
||||
|
@ -92,7 +92,7 @@ namespace Sunny.UI
|
||||
InitializeComponent();
|
||||
AutoSize = false;
|
||||
DoubleBuffered = true;
|
||||
ResizeRedraw = true;
|
||||
//ResizeRedraw = true;
|
||||
ToolStripControlHost _host = new ToolStripControlHost(item);
|
||||
Padding = Margin = _host.Padding = _host.Margin = Padding.Empty;
|
||||
item.MinimumSize = item.Size;
|
||||
|
@ -115,7 +115,6 @@ namespace Sunny.UI
|
||||
/// <param name="value">数值</param>
|
||||
protected override void InitValue(object value)
|
||||
{
|
||||
Console.WriteLine(value.ToString());
|
||||
UICornerRadiusSides sides = (UICornerRadiusSides)value;
|
||||
ResetCheckBoxState();
|
||||
if ((sides & UICornerRadiusSides.All) == UICornerRadiusSides.All)
|
||||
|
@ -39,7 +39,12 @@ namespace Sunny.UI
|
||||
/// </summary>
|
||||
public UIControl()
|
||||
{
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.Selectable, true);
|
||||
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
base.DoubleBuffered = true;
|
||||
UpdateStyles();
|
||||
|
||||
|
@ -41,11 +41,10 @@ namespace Sunny.UI
|
||||
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
SetStyle(ControlStyles.Selectable, true);
|
||||
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
DoubleBuffered = true;
|
||||
UpdateStyles();
|
||||
Font = UIFontColor.Font;
|
||||
@ -57,6 +56,12 @@ namespace Sunny.UI
|
||||
Version = UIGlobal.Version;
|
||||
}
|
||||
|
||||
protected override void OnFontChanged(EventArgs e)
|
||||
{
|
||||
base.OnFontChanged(e);
|
||||
if (NavBarMenu != null) NavBarMenu.Font = Font;
|
||||
}
|
||||
|
||||
[DefaultValue(null)]
|
||||
[Description("关联的TabControl"), Category("SunnyUI")]
|
||||
public UITabControl TabControl { get; set; }
|
||||
|
@ -44,9 +44,9 @@ namespace Sunny.UI
|
||||
public UIPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
SetStyle(ControlStyles.Selectable, true);
|
||||
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
@ -55,6 +55,7 @@ namespace Sunny.UI
|
||||
UpdateStyles();
|
||||
|
||||
Version = UIGlobal.Version;
|
||||
AutoScaleMode = AutoScaleMode.None;
|
||||
base.Font = UIFontColor.Font;
|
||||
base.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
}
|
||||
|
@ -46,20 +46,13 @@ namespace Sunny.UI
|
||||
edit.ScrollBars = RichTextBoxScrollBars.Vertical;
|
||||
}
|
||||
|
||||
private bool showScrollBar = true;
|
||||
protected override void OnFontChanged(EventArgs e)
|
||||
{
|
||||
base.OnFontChanged(e);
|
||||
if (edit != null) edit.Font = Font;
|
||||
}
|
||||
|
||||
// [DefaultValue(true)]
|
||||
// public bool ShowScrollBar
|
||||
// {
|
||||
// get => showScrollBar;
|
||||
// set
|
||||
// {
|
||||
// showScrollBar = value;
|
||||
// bar.Visible = value;
|
||||
// edit.ScrollBars = value ? RichTextBoxScrollBars.Vertical : RichTextBoxScrollBars.None;
|
||||
// SetScrollInfo();
|
||||
// }
|
||||
// }
|
||||
private bool showScrollBar = true;
|
||||
|
||||
[DefaultValue(false)]
|
||||
[Description("是否只读"), Category("SunnyUI")]
|
||||
|
@ -34,6 +34,12 @@ namespace Sunny.UI
|
||||
{
|
||||
public delegate void OnValueChanged(object sender, bool value);
|
||||
|
||||
public enum UISwitchShape
|
||||
{
|
||||
Round,
|
||||
Square
|
||||
}
|
||||
|
||||
public UISwitch()
|
||||
{
|
||||
Height = 29;
|
||||
@ -45,6 +51,20 @@ namespace Sunny.UI
|
||||
fillColor = Color.White;
|
||||
}
|
||||
|
||||
public UISwitchShape switchShape = UISwitchShape.Round;
|
||||
|
||||
[Description("开关形状"), Category("SunnyUI")]
|
||||
[DefaultValue(UISwitchShape.Round)]
|
||||
public UISwitchShape SwitchShape
|
||||
{
|
||||
get => switchShape;
|
||||
set
|
||||
{
|
||||
switchShape = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public event OnValueChanged ValueChanged;
|
||||
|
||||
/// <summary>
|
||||
@ -169,7 +189,7 @@ namespace Sunny.UI
|
||||
|
||||
protected override void OnPaintFill(Graphics g, GraphicsPath path)
|
||||
{
|
||||
Width = (int)(Height * 2.6);
|
||||
//Width = (int)(Height * 2.6);
|
||||
Rectangle rect = new Rectangle(0, 0, Width - 1, Height - 1);
|
||||
g.FillRoundRectangle(Active ? ActiveColor : InActiveColor, rect, rect.Height);
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace Sunny.UI
|
||||
|
||||
public UITabControl()
|
||||
{
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
|
||||
|
||||
ItemSize = new Size(150, 40);
|
||||
DrawMode = TabDrawMode.OwnerDrawFixed;
|
||||
|
@ -31,7 +31,7 @@ namespace Sunny.UI
|
||||
{
|
||||
public UITabControlMenu()
|
||||
{
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
|
||||
|
||||
ItemSize = new Size(40, 200);
|
||||
DrawMode = TabDrawMode.OwnerDrawFixed;
|
||||
|
@ -55,14 +55,12 @@ namespace Sunny.UI
|
||||
ControlStyles.DoubleBuffer |
|
||||
ControlStyles.OptimizedDoubleBuffer |
|
||||
ControlStyles.AllPaintingInWmPaint |
|
||||
//ControlStyles.ResizeRedraw |
|
||||
ControlStyles.SupportsTransparentBackColor, true);
|
||||
UpdateStyles();
|
||||
|
||||
Version = UIGlobal.Version;
|
||||
FormBorderStyle = FormBorderStyle.None;
|
||||
m_aeroEnabled = false;
|
||||
base.MaximumSize = ShowFullScreen ? Screen.PrimaryScreen.Bounds.Size : Screen.PrimaryScreen.WorkingArea.Size;
|
||||
}
|
||||
|
||||
//不显示FormBorderStyle属性
|
||||
@ -72,11 +70,7 @@ namespace Sunny.UI
|
||||
public new FormBorderStyle FormBorderStyle
|
||||
{
|
||||
get { return base.FormBorderStyle; }
|
||||
set
|
||||
{
|
||||
base.FormBorderStyle = FormBorderStyle.None;
|
||||
Console.WriteLine(value);
|
||||
}
|
||||
set { base.FormBorderStyle = FormBorderStyle.None; }
|
||||
}
|
||||
|
||||
public void Render()
|
||||
@ -281,11 +275,21 @@ namespace Sunny.UI
|
||||
{
|
||||
}
|
||||
|
||||
private bool showFullScreen;
|
||||
|
||||
/// <summary>
|
||||
/// 是否以全屏模式进入最大化
|
||||
/// </summary>
|
||||
[Description("是否以全屏模式进入最大化"), Category("WindowStyle"), DefaultValue(false)]
|
||||
public bool ShowFullScreen { get; set; }
|
||||
public bool ShowFullScreen
|
||||
{
|
||||
get => showFullScreen;
|
||||
set
|
||||
{
|
||||
showFullScreen = value;
|
||||
base.MaximumSize = ShowFullScreen ? Screen.PrimaryScreen.Bounds.Size : Screen.PrimaryScreen.WorkingArea.Size;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 标题栏高度
|
||||
@ -1019,7 +1023,6 @@ namespace Sunny.UI
|
||||
protected override void OnShown(EventArgs e)
|
||||
{
|
||||
base.OnShown(e);
|
||||
|
||||
CalcSystemBoxPos();
|
||||
SetRadius();
|
||||
isShow = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user