Exemplo n.º 1
0
 /// <summary>
 /// Renders the background of a panel background
 /// </summary>
 /// <param name="e"></param>
 public virtual void OnRenderPanelPopupBackground(RibbonCanvasEventArgs e)
 {
 }
Exemplo n.º 2
0
 /// <summary>
 /// Renders the background of a dropdown
 /// </summary>
 /// <param name="e"></param>
 public virtual void OnRenderDropDownBackground(RibbonCanvasEventArgs e)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Renders the image separator of a dropdown
 /// </summary>
 /// <param name="item"></param>
 /// <param name="e"></param>
 public virtual void OnRenderDropDownDropDownImageSeparator(RibbonItem item, RibbonCanvasEventArgs e)
 {
 }
        public override void OnRenderDropDownBackground(RibbonCanvasEventArgs e)
        {
            Rectangle outerR = new Rectangle(0, 0, e.Bounds.Width - 1, e.Bounds.Height - 1);
            RibbonDropDown dd = e.Canvas as RibbonDropDown;

            using (SolidBrush b = new SolidBrush(ColorTable.DropDownBg))
            {
                e.Graphics.Clear(Color.Transparent);
                SmoothingMode sbuff = e.Graphics.SmoothingMode;
                e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
                e.Graphics.FillRectangle(b, outerR);
                e.Graphics.SmoothingMode = sbuff;
            }

            using (Pen p = new Pen(ColorTable.DropDownBorder))
            {
                if (dd != null)
                {
                    using (GraphicsPath r = RoundRectangle(new Rectangle(Point.Empty, new Size(dd.Size.Width - 1, dd.Size.Height - 1)), dd.BorderRoundness))
                    {
                        SmoothingMode smb = e.Graphics.SmoothingMode;
                        e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
                        e.Graphics.DrawPath(p, r);
                        e.Graphics.SmoothingMode = smb;
                    }
                }
                else
                {
                    e.Graphics.DrawRectangle(p, outerR);
                }
            }

            if (dd.ShowSizingGrip)
            {
                Rectangle gripArea = Rectangle.FromLTRB(
                     e.Bounds.Left + 1,
                     e.Bounds.Bottom - dd.SizingGripHeight,
                     e.Bounds.Right - 1,
                     e.Bounds.Bottom - 1);
                if (gripArea.Height > 0 && gripArea.Width > 0)
                {
                    using (LinearGradientBrush b = new LinearGradientBrush(
                         gripArea, ColorTable.DropDownGripNorth, ColorTable.DropDownGripSouth, 90))
                    {
                        e.Graphics.FillRectangle(b, gripArea);
                    }

                    using (Pen p = new Pen(ColorTable.DropDownGripBorder))
                    {
                        e.Graphics.DrawLine(p,
                             gripArea.Location,
                             new Point(gripArea.Right - 1, gripArea.Top));
                    }

                    DrawGripDot(e.Graphics, new Point(gripArea.Right - 7, gripArea.Bottom - 3));
                    DrawGripDot(e.Graphics, new Point(gripArea.Right - 3, gripArea.Bottom - 7));
                    DrawGripDot(e.Graphics, new Point(gripArea.Right - 3, gripArea.Bottom - 3));
                }
            }
        }
        public override void OnRenderDropDownDropDownImageSeparator(RibbonItem item, RibbonCanvasEventArgs e)
        {
            RibbonDropDown dd = e.Canvas as RibbonDropDown;

            if (dd != null && dd.DrawIconsBar)
            {
                Rectangle imgsR = new Rectangle(item.Bounds.Left, item.Bounds.Top, 26, item.Bounds.Height);

                using (Pen p = new Pen(ColorTable.DropDownImageBg))
                {
                    using (SolidBrush b = new SolidBrush(ColorTable.DropDownImageBg))
                    {
                            SmoothingMode sm = e.Graphics.SmoothingMode;
                            e.Graphics.SmoothingMode = SmoothingMode.None;
                            e.Graphics.FillRectangle(b, imgsR);
                            e.Graphics.SmoothingMode = sm;
                    }
                }

                using (Pen p = new Pen(ColorTable.DropDownImageSeparator))
                {
                    SmoothingMode sm = e.Graphics.SmoothingMode;
                    e.Graphics.SmoothingMode = SmoothingMode.None;
                    e.Graphics.DrawLine(p,
                         new Point(imgsR.Right, imgsR.Top),
                         new Point(imgsR.Right, imgsR.Bottom - 1));
                    e.Graphics.SmoothingMode = sm;

                }
            }
        }
        public override void OnRenderPanelPopupBackground(RibbonCanvasEventArgs e)
        {
            RibbonPanel pnl = e.RelatedObject as RibbonPanel;

            if (pnl == null) return;

            Rectangle darkBorder = Rectangle.FromLTRB(
                 e.Bounds.Left,
                 e.Bounds.Top,
                 e.Bounds.Right,
                 e.Bounds.Bottom);

            Rectangle lightBorder = Rectangle.FromLTRB(
                 e.Bounds.Left + 1,
                 e.Bounds.Top + 1,
                 e.Bounds.Right - 1,
                 e.Bounds.Bottom - 1);

            Rectangle textArea =
                 Rectangle.FromLTRB(
                 e.Bounds.Left + 1,
                 pnl.ContentBounds.Bottom,
                 e.Bounds.Right - 1,
                 e.Bounds.Bottom - 1);

            GraphicsPath dark = RoundRectangle(darkBorder, 3);
            GraphicsPath light = RoundRectangle(lightBorder, 3);
            GraphicsPath txt = RoundRectangle(textArea, 3, Corners.SouthEast | Corners.SouthWest);

            using (Pen p = new Pen(ColorTable.PanelLightBorder))
            {
                e.Graphics.DrawPath(p, light);
            }

            using (Pen p = new Pen(ColorTable.PanelDarkBorder))
            {
                e.Graphics.DrawPath(p, dark);
            }

            using (SolidBrush b = new SolidBrush(ColorTable.PanelBackgroundSelected))
            {
                e.Graphics.FillPath(b, light);
            }

            if (_ownerRibbon.OrbStyle == RibbonOrbStyle.Office_2007)
            {
                using (SolidBrush b = new SolidBrush(ColorTable.PanelTextBackground))
                {
                    e.Graphics.FillPath(b, txt);
                }
            }

            txt.Dispose();
            dark.Dispose();
            light.Dispose();
        }
 /// <summary>
 /// Renders the background of a panel background
 /// </summary>
 /// <param name="e"></param>
 public virtual void OnRenderPanelPopupBackground(RibbonCanvasEventArgs e)
 {
 }
 /// <summary>
 /// Renders the background of a dropdown
 /// </summary>
 /// <param name="e"></param>
 public virtual void OnRenderDropDownBackground(RibbonCanvasEventArgs e)
 {
 }
        public override void OnRenderDropDownBackground(RibbonCanvasEventArgs e)
        {
            Rectangle outerR = new Rectangle(0, 0, e.Bounds.Width - 1, e.Bounds.Height - 1);
            Rectangle imgsR = new Rectangle(0, 0, 26, e.Bounds.Height);
            RibbonDropDown dd = e.Canvas as RibbonDropDown;

            using (SolidBrush b = new SolidBrush(ColorTable.DropDownBg))
            {
                e.Graphics.FillRectangle(b, outerR);
            }

            using (SolidBrush b = new SolidBrush(ColorTable.DropDownImageBg))
            {
                e.Graphics.FillRectangle(b, imgsR);
            }

            using (Pen p = new Pen(ColorTable.DropDownImageSeparator))
            {
                e.Graphics.DrawLine(p,
                    new Point(imgsR.Right, imgsR.Top),
                    new Point(imgsR.Right, imgsR.Bottom));
            }

            using (Pen p = new Pen(ColorTable.DropDownBorder))
            {
                e.Graphics.DrawRectangle(p, outerR);
            }

            if (dd.ShowSizingGrip)
            {
                Rectangle gripArea = Rectangle.FromLTRB(
                    e.Bounds.Left + 1,
                    e.Bounds.Bottom - dd.SizingGripHeight,
                    e.Bounds.Right - 1,
                    e.Bounds.Bottom - 1);

                using (LinearGradientBrush b = new LinearGradientBrush(
                    gripArea, ColorTable.DropDownGripNorth, ColorTable.DropDownGripSouth, 90))
                {
                    e.Graphics.FillRectangle(b, gripArea);
                }

                using (Pen p = new Pen(ColorTable.DropDownGripBorder))
                {
                    e.Graphics.DrawLine(p,
                        gripArea.Location,
                        new Point(gripArea.Right - 1, gripArea.Top));
                }

                DrawGripDot(e.Graphics, new Point(gripArea.Right - 7, gripArea.Bottom - 3));
                DrawGripDot(e.Graphics, new Point(gripArea.Right - 3, gripArea.Bottom - 7));
                DrawGripDot(e.Graphics, new Point(gripArea.Right - 3, gripArea.Bottom - 3));
            }
        }
 /// <summary>
 /// Renders the image separator of a dropdown
 /// </summary>
 /// <param name="e"></param>
 public virtual void OnRenderDropDownDropDownImageSeparator(RibbonItem item, RibbonCanvasEventArgs e)
 {
 }