yangyin
2025-01-13 36616eb44dc36a4e6e3e7a7540310cb850218ea9
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
#region Imports
 
using System.Drawing;
 
#endregion
 
namespace DPumpHydr.WinFrmUI.RLT.Docking.Crown
{
    #region CrownDockTabDocking
 
    internal class CrownDockTab
    {
        #region Property Region
 
        public CrownDockContent DockContent { get; set; }
 
        public Rectangle ClientRectangle { get; set; }
 
        public Rectangle CloseButtonRectangle { get; set; }
 
        public bool Hot { get; set; }
 
        public bool CloseButtonHot { get; set; }
 
        public bool ShowSeparator { get; set; }
 
        #endregion
 
        #region Constructor Region
 
        public CrownDockTab(CrownDockContent content)
        {
            DockContent = content;
        }
 
        #endregion
 
        #region Method Region
 
        public int CalculateWidth(Graphics g, Font font)
        {
            int width = (int)g.MeasureString(DockContent.DockText, font).Width;
            width += 10;
 
            return width;
        }
 
        #endregion
    }
 
    #endregion
}