commit
d4027d9d02
5
SunnyUI.Demo/Controls/FDataGridView.Designer.cs
generated
5
SunnyUI.Demo/Controls/FDataGridView.Designer.cs
generated
@ -80,7 +80,6 @@
|
|||||||
this.uiDataGridView1.Location = new System.Drawing.Point(0, 0);
|
this.uiDataGridView1.Location = new System.Drawing.Point(0, 0);
|
||||||
this.uiDataGridView1.MultiSelect = false;
|
this.uiDataGridView1.MultiSelect = false;
|
||||||
this.uiDataGridView1.Name = "uiDataGridView1";
|
this.uiDataGridView1.Name = "uiDataGridView1";
|
||||||
this.uiDataGridView1.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
|
|
||||||
this.uiDataGridView1.RowHeadersVisible = false;
|
this.uiDataGridView1.RowHeadersVisible = false;
|
||||||
dataGridViewCellStyle4.BackColor = System.Drawing.Color.White;
|
dataGridViewCellStyle4.BackColor = System.Drawing.Color.White;
|
||||||
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle4;
|
this.uiDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle4;
|
||||||
@ -90,11 +89,10 @@
|
|||||||
this.uiDataGridView1.ShowRect = false;
|
this.uiDataGridView1.ShowRect = false;
|
||||||
this.uiDataGridView1.Size = new System.Drawing.Size(861, 380);
|
this.uiDataGridView1.Size = new System.Drawing.Size(861, 380);
|
||||||
this.uiDataGridView1.TabIndex = 0;
|
this.uiDataGridView1.TabIndex = 0;
|
||||||
this.uiDataGridView1.TagString = null;
|
|
||||||
//
|
//
|
||||||
// uiPagination1
|
// uiPagination1
|
||||||
//
|
//
|
||||||
this.uiPagination1.ActivePage = 500;
|
this.uiPagination1.ActivePage = 50;
|
||||||
this.uiPagination1.CausesValidation = false;
|
this.uiPagination1.CausesValidation = false;
|
||||||
this.uiPagination1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
this.uiPagination1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||||
this.uiPagination1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
this.uiPagination1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||||
@ -102,6 +100,7 @@
|
|||||||
this.uiPagination1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
this.uiPagination1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||||
this.uiPagination1.Name = "uiPagination1";
|
this.uiPagination1.Name = "uiPagination1";
|
||||||
this.uiPagination1.PagerCount = 11;
|
this.uiPagination1.PagerCount = 11;
|
||||||
|
this.uiPagination1.PageSize = 50;
|
||||||
this.uiPagination1.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
|
this.uiPagination1.RectSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.None;
|
||||||
this.uiPagination1.Size = new System.Drawing.Size(861, 35);
|
this.uiPagination1.Size = new System.Drawing.Size(861, 35);
|
||||||
this.uiPagination1.TabIndex = 1;
|
this.uiPagination1.TabIndex = 1;
|
||||||
|
1
SunnyUI.Demo/Controls/FListBox.Designer.cs
generated
1
SunnyUI.Demo/Controls/FListBox.Designer.cs
generated
@ -119,6 +119,7 @@
|
|||||||
this.uiButton1.TabIndex = 23;
|
this.uiButton1.TabIndex = 23;
|
||||||
this.uiButton1.Text = "Add Item";
|
this.uiButton1.Text = "Add Item";
|
||||||
this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click);
|
this.uiButton1.Click += new System.EventHandler(this.uiButton1_Click);
|
||||||
|
this.uiButton1.DoubleClick += new System.EventHandler(this.uiButton1_DoubleClick);
|
||||||
//
|
//
|
||||||
// FListBox
|
// FListBox
|
||||||
//
|
//
|
||||||
|
@ -13,7 +13,7 @@ namespace Sunny.UI.Demo
|
|||||||
public override void Init()
|
public override void Init()
|
||||||
{
|
{
|
||||||
uiListBox1.Items.Clear();
|
uiListBox1.Items.Clear();
|
||||||
for (int i = 0; i < 20; i++)
|
for (int i = 0; i < 50; i++)
|
||||||
{
|
{
|
||||||
uiListBox1.Items.Add(i);
|
uiListBox1.Items.Add(i);
|
||||||
}
|
}
|
||||||
@ -49,5 +49,11 @@ namespace Sunny.UI.Demo
|
|||||||
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num);
|
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_" + num);
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void uiButton1_DoubleClick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
uiListBox1.Items.Add(DateTime.Now.ToString("yyyyMMdd") + "_double_" + num);
|
||||||
|
num++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -55,6 +55,7 @@ namespace Sunny.UI
|
|||||||
fillHoverColor = UIStyles.Blue.ButtonFillHoverColor;
|
fillHoverColor = UIStyles.Blue.ButtonFillHoverColor;
|
||||||
fillPressColor = UIStyles.Blue.ButtonFillPressColor;
|
fillPressColor = UIStyles.Blue.ButtonFillPressColor;
|
||||||
fillSelectedColor = UIStyles.Blue.ButtonFillSelectedColor;
|
fillSelectedColor = UIStyles.Blue.ButtonFillSelectedColor;
|
||||||
|
SetStyle(ControlStyles.StandardDoubleClick, UseDoubleClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool isClick;
|
private bool isClick;
|
||||||
@ -76,6 +77,27 @@ namespace Sunny.UI
|
|||||||
base.OnClick(e);
|
base.OnClick(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool useDoubleClick = false;
|
||||||
|
|
||||||
|
[Description("是否启用双击事件"), Category("SunnyUI")]
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool UseDoubleClick
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return useDoubleClick;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (useDoubleClick != value)
|
||||||
|
{
|
||||||
|
useDoubleClick = value;
|
||||||
|
SetStyle(ControlStyles.StandardDoubleClick, value);
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool showTips = false;
|
private bool showTips = false;
|
||||||
|
|
||||||
[Description("是否显示角标"), Category("SunnyUI")]
|
[Description("是否显示角标"), Category("SunnyUI")]
|
||||||
@ -382,12 +404,22 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
if (Focused && e.KeyCode == Keys.Space)
|
if (Focused && e.KeyCode == Keys.Space)
|
||||||
{
|
{
|
||||||
|
IsPress = true;
|
||||||
|
Invalidate();
|
||||||
PerformClick();
|
PerformClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
base.OnKeyDown(e);
|
base.OnKeyDown(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnKeyUp(KeyEventArgs e)
|
||||||
|
{
|
||||||
|
IsPress = false;
|
||||||
|
Invalidate();
|
||||||
|
|
||||||
|
base.OnKeyUp(e);
|
||||||
|
}
|
||||||
|
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
[Description("显示激活时边框线"), Category("SunnyUI")]
|
[Description("显示激活时边框线"), Category("SunnyUI")]
|
||||||
public bool ShowFocusLine { get; set; }
|
public bool ShowFocusLine { get; set; }
|
||||||
|
@ -321,7 +321,14 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
protected override void OnSizeChanged(EventArgs e)
|
protected override void OnSizeChanged(EventArgs e)
|
||||||
{
|
{
|
||||||
SetScrollInfo();
|
if (Bar != null && Bar.Visible)
|
||||||
|
{
|
||||||
|
if (Bar.Value != 0)
|
||||||
|
{
|
||||||
|
ScrollBarInfo.SetScrollValue(Handle, Bar.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//SetScrollInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetScrollInfo()
|
public void SetScrollInfo()
|
||||||
@ -379,22 +386,19 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
base.OnMouseWheel(e);
|
base.OnMouseWheel(e);
|
||||||
|
|
||||||
if (Bar.Visible)
|
if (Bar != null && Bar.Visible)
|
||||||
{
|
{
|
||||||
var si = ScrollBarInfo.GetInfo(Handle);
|
var si = ScrollBarInfo.GetInfo(Handle);
|
||||||
|
int temp = Math.Abs(e.Delta / 120);
|
||||||
if (e.Delta > 10)
|
if (e.Delta > 10)
|
||||||
{
|
{
|
||||||
if (si.nPos > 0)
|
int nposnum = si.nPos - temp * SystemInformation.MouseWheelScrollLines;
|
||||||
{
|
ScrollBarInfo.SetScrollValue(Handle, nposnum >= si.nMin ? nposnum : 0);
|
||||||
ScrollBarInfo.ScrollUp(Handle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (e.Delta < -10)
|
else if (e.Delta < -10)
|
||||||
{
|
{
|
||||||
if (si.nPos < si.ScrollMax)
|
int nposnum = si.nPos + temp * SystemInformation.MouseWheelScrollLines;
|
||||||
{
|
ScrollBarInfo.SetScrollValue(Handle, nposnum <= si.nMax ? nposnum : si.nMax);
|
||||||
ScrollBarInfo.ScrollDown(Handle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,17 +395,19 @@ namespace Sunny.UI
|
|||||||
if (Bar != null && Bar.Visible)
|
if (Bar != null && Bar.Visible)
|
||||||
{
|
{
|
||||||
var si = ScrollBarInfo.GetInfo(Handle);
|
var si = ScrollBarInfo.GetInfo(Handle);
|
||||||
|
int temp = Math.Abs(e.Delta / 120);
|
||||||
if (e.Delta > 10)
|
if (e.Delta > 10)
|
||||||
{
|
{
|
||||||
ScrollBarInfo.SetScrollValue(Handle, (si.nPos - SystemInformation.MouseWheelScrollLines) >= si.nMin ? si.nPos - SystemInformation.MouseWheelScrollLines : 0);
|
int nposnum = si.nPos - temp * SystemInformation.MouseWheelScrollLines;
|
||||||
|
ScrollBarInfo.SetScrollValue(Handle, nposnum >= si.nMin ? nposnum : 0);
|
||||||
}
|
}
|
||||||
else if (e.Delta < -10)
|
else if (e.Delta < -10)
|
||||||
{
|
{
|
||||||
ScrollBarInfo.SetScrollValue(Handle, (si.nPos + SystemInformation.MouseWheelScrollLines) <= si.nMax ? (si.nPos + SystemInformation.MouseWheelScrollLines) : si.nMax);
|
int nposnum = si.nPos + temp * SystemInformation.MouseWheelScrollLines;
|
||||||
|
ScrollBarInfo.SetScrollValue(Handle, nposnum <= si.ScrollMax ? nposnum : si.ScrollMax);
|
||||||
}
|
}
|
||||||
|
SetScrollInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetScrollInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetStyle(UIStyle style)
|
public void SetStyle(UIStyle style)
|
||||||
|
@ -703,8 +703,24 @@ namespace Sunny.UI
|
|||||||
edtPage.HasMaximum = true;
|
edtPage.HasMaximum = true;
|
||||||
edtPage.Maximum = PageCount;
|
edtPage.Maximum = PageCount;
|
||||||
|
|
||||||
if (activePage > PageCount) activePage = PageCount;
|
if (activePage >= PageCount)
|
||||||
if (activePage < 1) activePage = 1;
|
{
|
||||||
|
activePage = PageCount;
|
||||||
|
b16.Enabled = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b16.Enabled = true;
|
||||||
|
}
|
||||||
|
if (activePage <= 1)
|
||||||
|
{
|
||||||
|
activePage = 1;
|
||||||
|
b0.Enabled = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b0.Enabled = true;
|
||||||
|
}
|
||||||
edtPage.IntValue = activePage;
|
edtPage.IntValue = activePage;
|
||||||
|
|
||||||
if (TotalCount == 0)
|
if (TotalCount == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user