tangxu
2024-10-14 6cd995b71dfc74d4d96347d0bc535fddf36fa9df
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
using System.Drawing;
using System.Windows.Forms.Design.Behavior;
 
namespace System.Windows.Forms
{
    public class RibbonOrbAdornerGlyph
        : Glyph
    {
        #region Fields
 
        private readonly BehaviorService _behaviorService;
        private readonly Ribbon _ribbon;
        private RibbonDesigner _componentDesigner;
        #endregion
 
        #region Ctor
 
        public RibbonOrbAdornerGlyph(BehaviorService behaviorService, RibbonDesigner designer, Ribbon ribbon)
            : base(new RibbonOrbAdornerGlyphBehavior())
        {
            _behaviorService = behaviorService;
            _componentDesigner = designer;
            _ribbon = ribbon;
        }
 
        #endregion
 
        #region Props
 
        /// <summary>
        /// Gets or sets if the orb menu is visible on the desginer
        /// </summary>
        public bool MenuVisible { get; set; }
 
        #endregion
 
        #region Methods
 
        public override Rectangle Bounds
        {
            get
            {
                Point edge = _behaviorService.ControlToAdornerWindow(_ribbon);
                return new Rectangle(
                    edge.X + _ribbon.OrbBounds.Left,
                    edge.Y + _ribbon.OrbBounds.Top,
                    _ribbon.OrbBounds.Height,
                    _ribbon.OrbBounds.Height);
            }
        }
 
        public override Cursor GetHitTest(Point p)
        {
            if (Bounds.Contains(p))
            {
                return Cursors.Hand;
            }
 
            return null;
        }
 
 
        public override void Paint(PaintEventArgs pe)
        {
            //SmoothingMode smbuff = pe.Graphics.SmoothingMode;
            //pe.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
            //using (SolidBrush b = new SolidBrush(Color.FromArgb(50, Color.Blue)))
            //{
            //    pe.Graphics.FillEllipse(b, Bounds);
            //}
 
        }
        #endregion
    }
 
    public class RibbonOrbAdornerGlyphBehavior
        : Behavior
    {
 
    }
}