FlatSubstring.cs
2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Asa.Theme
{
/// <summary>
/// 字符串截取
/// </summary>
public partial class FlatSubstring : FlatBase
{
private int _borderWidth;
private Rectangle _borderRect = new Rectangle();
private RectangleF _textRect = new RectangleF();
/// <summary>
/// 字符串截取
/// </summary>
public FlatSubstring()
{
InitializeComponent();
_borderWidth = 0;
}
/// <summary>
/// 显示的文本
/// </summary>
[Browsable(true), Category(""), Description("显示的文本"), DefaultValue("")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public override string Text
{
get => base.Text;
set
{
base.Text = value;
CalcSize();
Refresh();
}
}
/// <summary>
/// 项目字体
/// </summary>
[Browsable(true), Category(""), Description("项目字体")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public override Font Font
{
get => base.Font;
set
{
base.Font = value;
CalcSize();
Refresh();
}
}
/// <summary>
/// 边框宽度
/// </summary>
[Browsable(true), Category(""), Description("边框宽度"), DefaultValue(2)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public int BorderWidth
{
get => _borderWidth;
set
{
_borderWidth = value;
if (_borderWidth < 0) _borderWidth = 0;
CalcSize();
Refresh();
}
}
/// <summary>
/// 计算大小
/// </summary>
protected override void CalcSize()
{
}
private void FlatSubstring_Paint(object sender, PaintEventArgs e)
{
}
private void FlatSubstring_MouseDown(object sender, MouseEventArgs e)
{
}
private void FlatSubstring_MouseMove(object sender, MouseEventArgs e)
{
}
private void FlatSubstring_MouseEnter(object sender, EventArgs e)
{
}
private void FlatSubstring_MouseLeave(object sender, EventArgs e)
{
}
private void FlatSubstring_MouseUp(object sender, MouseEventArgs e)
{
}
private void FlatSubstring_Resize(object sender, EventArgs e)
{
}
}
}