重构
This commit is contained in:
parent
45d2eed8b9
commit
b68740f828
@ -477,6 +477,8 @@ namespace Sunny.UI
|
||||
return;
|
||||
}
|
||||
|
||||
VBar.ThreadSafeCall(() =>
|
||||
{
|
||||
if (RowCount > DisplayedRowCount(false))
|
||||
{
|
||||
VBar.Maximum = RowCount - DisplayedRowCount(false);
|
||||
@ -487,7 +489,10 @@ namespace Sunny.UI
|
||||
{
|
||||
VBar.Visible = false;
|
||||
}
|
||||
});
|
||||
|
||||
HBar.ThreadSafeCall(() =>
|
||||
{
|
||||
if (HorizontalScrollBar.Visible)
|
||||
{
|
||||
HBar.Maximum = HorizontalScrollBar.Maximum;
|
||||
@ -500,6 +505,7 @@ namespace Sunny.UI
|
||||
{
|
||||
HBar.Visible = false;
|
||||
}
|
||||
});
|
||||
|
||||
SetBarPosition();
|
||||
}
|
||||
@ -606,32 +612,44 @@ namespace Sunny.UI
|
||||
int barHeight = Math.Max(ScrollBarInfo.HorizontalScrollBarHeight(), ScrollBarHeight);
|
||||
|
||||
if (BorderStyle == BorderStyle.FixedSingle)
|
||||
{
|
||||
VBar.ThreadSafeCall(() =>
|
||||
{
|
||||
VBar.Left = Width - barWidth - 2;
|
||||
VBar.Top = 1;
|
||||
VBar.Width = barWidth + 1;
|
||||
VBar.Height = Height - 2;
|
||||
VBar.BringToFront();
|
||||
});
|
||||
|
||||
HBar.ThreadSafeCall(() =>
|
||||
{
|
||||
HBar.Left = 1;
|
||||
HBar.Height = barHeight + 1;
|
||||
HBar.Width = Width - (VBar.Visible ? VBar.Width : 0) - 2;
|
||||
HBar.Top = Height - HBar.Height - 1;
|
||||
HBar.BringToFront();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
VBar.ThreadSafeCall(() =>
|
||||
{
|
||||
VBar.Left = Width - barWidth - 1;
|
||||
VBar.Top = 0;
|
||||
VBar.Width = barWidth + 1;
|
||||
VBar.Height = Height;
|
||||
VBar.BringToFront();
|
||||
});
|
||||
|
||||
HBar.ThreadSafeCall(() =>
|
||||
{
|
||||
HBar.Left = 0;
|
||||
HBar.Height = barHeight + 1;
|
||||
HBar.Width = Width - (VBar.Visible ? VBar.Width : 0);
|
||||
HBar.Top = Height - HBar.Height;
|
||||
HBar.BringToFront();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,10 +61,17 @@ namespace Sunny.UI
|
||||
{
|
||||
waterMarkContainer = new PanelEx();
|
||||
waterMarkContainer.Paint += new PaintEventHandler(waterMarkContainer_Paint);
|
||||
waterMarkContainer.Invalidate();
|
||||
waterMarkContainer.Click += new EventHandler(waterMarkContainer_Click);
|
||||
waterMarkContainer.DoubleClick += WaterMarkContainer_DoubleClick;
|
||||
this.ThreadSafeCall(() =>
|
||||
{
|
||||
this.Controls.Add(waterMarkContainer);
|
||||
});
|
||||
|
||||
waterMarkContainer.ThreadSafeCall(() =>
|
||||
{
|
||||
waterMarkContainer.Invalidate();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,8 +99,12 @@ namespace Sunny.UI
|
||||
private void RemoveWaterMark()
|
||||
{
|
||||
if (waterMarkContainer != null)
|
||||
{
|
||||
this.ThreadSafeCall(() =>
|
||||
{
|
||||
Controls.Remove(waterMarkContainer);
|
||||
});
|
||||
|
||||
waterMarkContainer = null;
|
||||
}
|
||||
}
|
||||
|
@ -685,7 +685,7 @@ namespace Sunny.UI
|
||||
{
|
||||
if (IsDisposed) return;
|
||||
TextChanged?.Invoke(this, e);
|
||||
SetScrollInfo();
|
||||
if (Multiline) SetScrollInfo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -722,6 +722,8 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
var si = ScrollBarInfo.GetInfo(edit.Handle);
|
||||
bar.ThreadSafeCall(() =>
|
||||
{
|
||||
if (si.ScrollMax > 0)
|
||||
{
|
||||
bar.Maximum = si.ScrollMax;
|
||||
@ -731,6 +733,7 @@ namespace Sunny.UI
|
||||
{
|
||||
bar.Maximum = si.ScrollMax;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnRadiusChanged(int value)
|
||||
|
Loading…
x
Reference in New Issue
Block a user