Source/Rendering/Office2007QatCustomizeItemPainter.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace DevComponents.DotNetBar.Rendering
{
    /// <summary>
    /// Defines painter for the Office 2007 style QAT Customize Item.
    /// </summary>
    internal class Office2007QatCustomizeItemPainter : QatCustomizeItemPainter, IOffice2007Painter
    {
        #region IOffice2007Painter
        private Office2007ColorTable m_ColorTable = null; //new Office2007ColorTable();

        /// <summary>
        /// Gets or sets color table used by renderer.
        /// </summary>
        public Office2007ColorTable ColorTable
        {
            get { return m_ColorTable; }
            set { m_ColorTable = value; }
        }
        #endregion

        #region Internal Implementation
        public override void Paint(QatCustomizeItemRendererEventArgs e)
        {
            Graphics g = e.Graphics;
            QatCustomizeItem item = e.CustomizeItem;
            Rectangle r = item.DisplayRectangle;
            Region oldClip = null;
            if (g.Clip != null) oldClip = g.Clip.Clone() as Region;
            g.SetClip(item.DisplayRectangle, CombineMode.Intersect);


            Office2007ButtonItemColorTable buttonColorTable = GetColorTable();
            Office2007ButtonItemStateColorTable state = buttonColorTable.Default;

            if (item.Expanded)
                state = buttonColorTable.Expanded;
            else if (item.IsMouseOver)
                state = buttonColorTable.MouseOver;

            Office2007ButtonItemPainter.PaintBackground(g, state, r, RoundRectangleShapeDescriptor.RoundCorner2);

            SmoothingMode sm = g.SmoothingMode;
            g.SmoothingMode = SmoothingMode.Default;
            
            Color color = state.ExpandBackground;
            Color colorLight = state.ExpandLight;

            Presentation.Shape shape = new Presentation.Shape();
            Presentation.ShapeBorder bl = new Presentation.ShapeBorder(colorLight, 1);
            Presentation.ShapeBorder b = new Presentation.ShapeBorder(color, 1);
            shape.Children.Add(new Presentation.Line(new Presentation.Location(0, 0), new Presentation.Location(4, 0), b));
            shape.Children.Add(new Presentation.Line(new Presentation.Location(0, 1), new Presentation.Location(4, 1), bl));

            shape.Children.Add(new Presentation.Line(new Presentation.Location(0, 3), new Presentation.Location(4, 3), b));
            shape.Children.Add(new Presentation.Line(new Presentation.Location(4, 3), new Presentation.Location(2, 5), b));
后面还有 33 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。