### 2020-12-29 dev更新
------ #### ryControls V2.1.2012.2901 - *.[新增]IconViewEx控件支持角标设置。
This commit is contained in:
parent
6bc527a8a2
commit
7a89ce0821
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -393,7 +393,7 @@
|
|||
</member>
|
||||
<member name="T:ryControls.Controls.LableX">
|
||||
<summary>
|
||||
|
||||
增强版Label(禁用了双击Label会自动复制文本到剪切板的功能)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ryControls.Controls.LableX.WndProc(System.Windows.Forms.Message@)">
|
||||
|
@ -978,6 +978,11 @@
|
|||
是否显示网格线
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ryControls.IconViewEx.BadgeListImage">
|
||||
<summary>
|
||||
角标图标合集
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ryControls.IconViewEx.OnDrawItem(System.Windows.Forms.DrawListViewItemEventArgs)">
|
||||
<summary>
|
||||
画项
|
||||
|
@ -1009,7 +1014,7 @@
|
|||
重绘选中时背景
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ryControls.IconViewEx.DrawIcon(System.Drawing.Graphics,System.Drawing.Rectangle,System.Drawing.Image,System.Drawing.Color)">
|
||||
<member name="M:ryControls.IconViewEx.DrawIcon(System.Drawing.Graphics,System.Drawing.Rectangle,System.Drawing.Image,System.Drawing.Color,System.Int32)">
|
||||
<summary>
|
||||
重绘图标
|
||||
</summary>
|
||||
|
@ -1055,6 +1060,11 @@
|
|||
图标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ryControls.Interface.IItemInfo.BadgeImageIndex">
|
||||
<summary>
|
||||
角标图片序号,为-1表示无角标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:ryControls.MsgLink">
|
||||
<summary>
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -393,7 +393,7 @@
|
|||
</member>
|
||||
<member name="T:ryControls.Controls.LableX">
|
||||
<summary>
|
||||
|
||||
增强版Label(禁用了双击Label会自动复制文本到剪切板的功能)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ryControls.Controls.LableX.WndProc(System.Windows.Forms.Message@)">
|
||||
|
@ -978,6 +978,11 @@
|
|||
是否显示网格线
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ryControls.IconViewEx.BadgeListImage">
|
||||
<summary>
|
||||
角标图标合集
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ryControls.IconViewEx.OnDrawItem(System.Windows.Forms.DrawListViewItemEventArgs)">
|
||||
<summary>
|
||||
画项
|
||||
|
@ -1009,7 +1014,7 @@
|
|||
重绘选中时背景
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ryControls.IconViewEx.DrawIcon(System.Drawing.Graphics,System.Drawing.Rectangle,System.Drawing.Image,System.Drawing.Color)">
|
||||
<member name="M:ryControls.IconViewEx.DrawIcon(System.Drawing.Graphics,System.Drawing.Rectangle,System.Drawing.Image,System.Drawing.Color,System.Int32)">
|
||||
<summary>
|
||||
重绘图标
|
||||
</summary>
|
||||
|
@ -1055,6 +1060,11 @@
|
|||
图标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ryControls.Interface.IItemInfo.BadgeImageIndex">
|
||||
<summary>
|
||||
角标图片序号,为-1表示无角标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:ryControls.MsgLink">
|
||||
<summary>
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,4 +1,9 @@
|
|||
### 2020-12-27 dev更新
|
||||
### 2020-12-29 dev更新
|
||||
------
|
||||
#### ryControls V2.1.2012.2901
|
||||
- *.[新增]IconViewEx控件支持角标设置。
|
||||
|
||||
### 2020-12-27 dev更新
|
||||
------
|
||||
#### ryControls V2.1.2012.2701
|
||||
- *.[改进]IconViewEx控件选中背景颜色支持渐变。
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -10,8 +10,9 @@ using System.Windows.Forms;
|
|||
namespace ryControls.Controls
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// 增强版Label(禁用了双击Label会自动复制文本到剪切板的功能)
|
||||
/// </summary>
|
||||
[Description("增强版Label(禁用了双击Label会自动复制文本到剪切板的功能)")]
|
||||
public partial class LableX : Label
|
||||
{
|
||||
private const int WM_LBUTTONDBLCLK = 0x203;
|
||||
|
|
|
@ -15,5 +15,9 @@ namespace ryControls.Interface
|
|||
/// 图标
|
||||
/// </summary>
|
||||
Image Image { get; set; }
|
||||
/// <summary>
|
||||
/// 角标图片序号,为-1表示无角标
|
||||
/// </summary>
|
||||
int BadgeImageIndex { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
@ -76,6 +77,10 @@ namespace ryControls
|
|||
[Description("是否显示网格线")]
|
||||
public bool IsDrawGridLines { get; set; }
|
||||
/// <summary>
|
||||
/// 角标图标合集
|
||||
/// </summary>
|
||||
public List<Image> BadgeListImage { get; set; } = new List<Image>();
|
||||
/// <summary>
|
||||
/// 画项
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
|
@ -91,10 +96,10 @@ namespace ryControls
|
|||
{
|
||||
var soft = (Interface.IItemInfo)e.Item.Tag;
|
||||
if (soft == null || soft.Image == null)
|
||||
{ paddingHeight = this.DrawIcon(g, r, this.Icon, e.Item.BackColor).Height; }
|
||||
{ paddingHeight = this.DrawIcon(g, r, this.Icon, e.Item.BackColor,-1).Height; }
|
||||
else
|
||||
{
|
||||
paddingHeight = this.DrawIcon(g, r, soft.Image, e.Item.BackColor).Height;
|
||||
paddingHeight = this.DrawIcon(g, r, soft.Image, e.Item.BackColor, soft.BadgeImageIndex).Height;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -215,7 +220,7 @@ namespace ryControls
|
|||
/// <param name="image"></param>
|
||||
/// <param name="backColor"></param>
|
||||
/// <returns></returns>
|
||||
private Size DrawIcon(Graphics g, Rectangle r, Image image, Color backColor)
|
||||
private Size DrawIcon(Graphics g, Rectangle r, Image image, Color backColor,int BadgeImageIndex)
|
||||
{
|
||||
var x = r.X + ((r.Width - iconsize) / 2);
|
||||
var y = r.Y + ((r.Height - textheight - iconsize) / 2);
|
||||
|
@ -236,8 +241,18 @@ namespace ryControls
|
|||
//使图标不会紧贴着每一列的左上角
|
||||
//imageBounds.X += 1;
|
||||
//imageBounds.Y += 1;
|
||||
|
||||
//如果有角标,则显示角标
|
||||
g.DrawImage(image, imageBounds);
|
||||
if (BadgeImageIndex >= 0 && BadgeImageIndex < BadgeListImage.Count)
|
||||
{
|
||||
var badge = BadgeListImage[BadgeImageIndex];
|
||||
if (badge != null)
|
||||
{
|
||||
var size = imageBounds.Width / 5;
|
||||
var badge_rect = new Rectangle(imageBounds.Left + size * 4, imageBounds.Top, size, size);
|
||||
g.DrawImage(badge, badge_rect);
|
||||
}
|
||||
}
|
||||
return imageBounds.Size;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.1.2012.2701")]
|
||||
[assembly: AssemblyFileVersion("2.1.2012.2701")]
|
||||
[assembly: AssemblyVersion("2.1.2012.2901")]
|
||||
[assembly: AssemblyFileVersion("2.1.2012.2901")]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user