* UIComboDataGridView: 修改拼写错误,FilterColomnName改为FilterColumnName

This commit is contained in:
Sunny 2022-03-22 15:01:48 +08:00
parent db276173e5
commit cbdf2f1db3
8 changed files with 49 additions and 38 deletions

Binary file not shown.

Binary file not shown.

View File

@ -755,7 +755,6 @@ namespace Sunny.UI.Demo
this.uiButton13.RectSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); this.uiButton13.RectSelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
this.uiButton13.Size = new System.Drawing.Size(100, 35); this.uiButton13.Size = new System.Drawing.Size(100, 35);
this.uiButton13.Style = Sunny.UI.UIStyle.Red; this.uiButton13.Style = Sunny.UI.UIStyle.Red;
this.uiButton13.StyleCustomMode = true;
this.uiButton13.TabIndex = 76; this.uiButton13.TabIndex = 76;
this.uiButton13.Text = "Red"; this.uiButton13.Text = "Red";
this.uiButton13.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiButton13.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@ -878,7 +877,6 @@ namespace Sunny.UI.Demo
this.uiButton4.ShowFocusLine = true; this.uiButton4.ShowFocusLine = true;
this.uiButton4.Size = new System.Drawing.Size(100, 35); this.uiButton4.Size = new System.Drawing.Size(100, 35);
this.uiButton4.Style = Sunny.UI.UIStyle.Red; this.uiButton4.Style = Sunny.UI.UIStyle.Red;
this.uiButton4.StyleCustomMode = true;
this.uiButton4.TabIndex = 64; this.uiButton4.TabIndex = 64;
this.uiButton4.Text = "Red"; this.uiButton4.Text = "Red";
this.uiButton4.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiButton4.TipsFont = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));

View File

@ -510,7 +510,7 @@ namespace Sunny.UI.Demo
this.uiComboDataGridView1.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList; this.uiComboDataGridView1.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList;
this.uiComboDataGridView1.FillColor = System.Drawing.Color.White; this.uiComboDataGridView1.FillColor = System.Drawing.Color.White;
this.uiComboDataGridView1.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); this.uiComboDataGridView1.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
this.uiComboDataGridView1.FilterColomnName = null; this.uiComboDataGridView1.FilterColumnName = null;
this.uiComboDataGridView1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiComboDataGridView1.Font = new System.Drawing.Font("微软雅黑", 12F);
this.uiComboDataGridView1.Location = new System.Drawing.Point(386, 292); this.uiComboDataGridView1.Location = new System.Drawing.Point(386, 292);
this.uiComboDataGridView1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiComboDataGridView1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);

View File

@ -45,7 +45,7 @@ namespace Sunny.UI.Demo
uiComboDataGridView1.ShowFilter = true; uiComboDataGridView1.ShowFilter = true;
uiComboDataGridView1.DataGridView.DataSource = dt; uiComboDataGridView1.DataGridView.DataSource = dt;
uiComboDataGridView1.FilterColomnName = "Column1"; //不设置则全部列过滤 uiComboDataGridView1.FilterColumnName = "Column1"; //不设置则全部列过滤
} }
private void UiComboDataGridView1_SelectIndexChange(object sender, int index) private void UiComboDataGridView1_SelectIndexChange(object sender, int index)

View File

@ -47,7 +47,7 @@ namespace Sunny.UI
set => panel.Visible = value; set => panel.Visible = value;
} }
public string FilterColomnName { get; set; } public string FilterColumnName { get; set; }
public UIDataGridView DataGridView => dataGridView; public UIDataGridView DataGridView => dataGridView;
@ -299,9 +299,9 @@ namespace Sunny.UI
} }
else else
{ {
if (FilterColomnName.IsValid()) if (FilterColumnName.IsValid())
{ {
string str = FilterColomnName + " like '%" + edtFilter.Text + "%'"; string str = FilterColumnName + " like '%" + edtFilter.Text + "%'";
filter = str; filter = str;
} }
else else

View File

@ -49,7 +49,7 @@ namespace Sunny.UI
private void UIComboDataGridView_ButtonClick(object sender, EventArgs e) private void UIComboDataGridView_ButtonClick(object sender, EventArgs e)
{ {
item.FilterColomnName = FilterColomnName; item.FilterColumnName = FilterColumnName;
item.ShowFilter = ShowFilter; item.ShowFilter = ShowFilter;
ItemForm.Size = ItemSize; ItemForm.Size = ItemSize;
item.ShowButtons = true; item.ShowButtons = true;
@ -104,6 +104,6 @@ namespace Sunny.UI
} }
[DefaultValue(null)] [DefaultValue(null)]
public string FilterColomnName { get; set; } public string FilterColumnName { get; set; }
} }
} }

View File

@ -92,16 +92,6 @@ namespace Sunny.UI
get; set; get; set;
} }
/// <summary>
/// 自定义主题风格
/// </summary>
[DefaultValue(false)]
[Description("获取或设置可以自定义主题风格"), Category("SunnyUI")]
public bool StyleCustomMode
{
get; set;
}
/// <summary> /// <summary>
/// 是否在设计期 /// 是否在设计期
/// </summary> /// </summary>
@ -249,13 +239,31 @@ namespace Sunny.UI
get; get;
} }
protected UIStyle _style = UIStyle.Blue;
/// <summary>
/// 主题样式
/// </summary>
[DefaultValue(UIStyle.Blue), Description("主题样式"), Category("SunnyUI")]
public UIStyle Style
{
get => _style;
set => SetStyle(value);
}
protected void SetStyleCustom(bool needRefresh = true)
{
_styleCustomMode = true;
if (needRefresh) Invalidate();
}
/// <summary> /// <summary>
/// 设置主题样式 /// 设置主题样式
/// </summary> /// </summary>
/// <param name="style">主题样式</param> /// <param name="style">主题样式</param>
public void SetStyle(UIStyle style) public void SetStyle(UIStyle style)
{ {
if (!style.IsCustom()) if (!StyleCustomMode && !_style.IsCustom())
{ {
SetStyleColor(style.Colors()); SetStyleColor(style.Colors());
Invalidate(); Invalidate();
@ -264,6 +272,29 @@ namespace Sunny.UI
_style = style; _style = style;
} }
private bool _styleCustomMode;
/// <summary>
/// 自定义主题风格
/// </summary>
[DefaultValue(false)]
[Description("获取或设置可以自定义主题风格"), Category("SunnyUI")]
public bool StyleCustomMode
{
get => _styleCustomMode;
set
{
if (_styleCustomMode != value)
{
_styleCustomMode = value;
if (!_styleCustomMode)
{
SetStyle(_style);
}
}
}
}
/// <summary> /// <summary>
/// 设置主题样式颜色 /// 设置主题样式颜色
/// </summary> /// </summary>
@ -296,18 +327,6 @@ namespace Sunny.UI
rectSelectedColor = rectColor; rectSelectedColor = rectColor;
} }
protected UIStyle _style = UIStyle.Blue;
/// <summary>
/// 主题样式
/// </summary>
[DefaultValue(UIStyle.Blue), Description("主题样式"), Category("SunnyUI")]
public UIStyle Style
{
get => _style;
set => SetStyle(value);
}
/// <summary> /// <summary>
/// 是否鼠标移上 /// 是否鼠标移上
/// </summary> /// </summary>
@ -942,12 +961,6 @@ namespace Sunny.UI
} }
} }
protected void SetStyleCustom(bool needRefresh = true)
{
_style = UIStyle.Custom;
if (needRefresh) Invalidate();
}
/// <summary>引发 <see cref="E:System.Windows.Forms.Control.GotFocus" /> 事件。</summary> /// <summary>引发 <see cref="E:System.Windows.Forms.Control.GotFocus" /> 事件。</summary>
/// <param name="e">包含事件数据的 <see cref="T:System.EventArgs" />。</param> /// <param name="e">包含事件数据的 <see cref="T:System.EventArgs" />。</param>
protected override void OnGotFocus(EventArgs e) protected override void OnGotFocus(EventArgs e)