Source/Ribbon/Office2007MdiSystemItemPainter.cs

(开头部分) 4KB

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

using System;
using System.Drawing;
using System.Text;
using DevComponents.DotNetBar.Rendering;

namespace DevComponents.DotNetBar
{
    /// <summary>
    /// Represents Office 2007 style MdiSystemItem painter
    /// </summary>
    internal class Office2007MdiSystemItemPainter : MdiSystemItemPainter, IOffice2007Painter
    {
        #region Private Variables
        #endregion
        #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

        public override void Paint(MdiSystemItemRendererEventArgs e)
        {
            MDISystemItem mdi = e.MdiSystemItem;
            Graphics g = e.Graphics;
            Rectangle r = mdi.DisplayRectangle;

            if (mdi.IsSystemIcon)
            {
                r.Offset((r.Width - 16) / 2, (r.Height - 16) / 2);
                if (mdi.Icon != null)
                    g.DrawIconUnstretched(mdi.Icon, r);
                return;
            }

            
            r = new Rectangle(mdi.DisplayRectangle.Location, mdi.GetButtonSize());
            if (mdi.Orientation == eOrientation.Horizontal)
                r.Offset(0, (mdi.DisplayRectangle.Height - r.Height) / 2);
            else
                r.Offset((mdi.WidthInternal - r.Width) / 2, 0);

            this.PaintButton(g, mdi, SystemButton.Minimize, r, GetColorTable(mdi, SystemButton.Minimize), m_ColorTable.LegacyColors);

            if (mdi.Orientation == eOrientation.Horizontal)
                r.Offset(r.Width, 0);
            else
                r.Offset(0, r.Height);
            this.PaintButton(g, mdi, SystemButton.Restore, r, GetColorTable(mdi, SystemButton.Restore), m_ColorTable.LegacyColors);

            if (mdi.Orientation == eOrientation.Horizontal)
                r.Offset(r.Width + 2, 0);
            else
                r.Offset(0, r.Height + 2);
后面还有 54 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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