internal RibbonButtonCollection(RibbonButtonList list) { _ownerList = list; }
public void DrawButtonListButtonDropDown(Graphics g, RibbonButtonList list) { }
public void DrawButtonListButtonUp(Graphics g, RibbonButtonList list) { }
public void DrawButtonList(Graphics g, RibbonButtonList list) { Rectangle outerR = Rectangle.FromLTRB( list.Bounds.Left, list.Bounds.Top, list.Bounds.Right - 1, list.Bounds.Bottom); using (GraphicsPath path = RoundRectangle(outerR, 3, Corners.East)) { Color bgcolor = list.Selected ? ColorTable.ButtonListBgSelected : ColorTable.ButtonListBg; if (list.Canvas is RibbonDropDown) bgcolor = ColorTable.DropDownBg; using (SolidBrush b = new SolidBrush(bgcolor)) { g.FillPath(b, path); } using (Pen p = new Pen(ColorTable.ButtonListBorder)) { g.DrawPath(p, path); } } #region Control Buttons if (!list.ButtonDownEnabled) { DrawButtonDisabled(g, list.ButtonDownBounds, list.ButtonDropDownPresent ? Corners.None : Corners.SouthEast); } else if (list.ButtonDownPressed) { DrawButtonPressed(g, list.ButtonDownBounds, list.ButtonDropDownPresent ? Corners.None : Corners.SouthEast); } else if (list.ButtonDownSelected) { DrawButtonSelected(g, list.ButtonDownBounds, list.ButtonDropDownPresent ? Corners.None : Corners.SouthEast); } else { DrawButton(g, list.ButtonDownBounds, Corners.None); } if (!list.ButtonUpEnabled) { DrawButtonDisabled(g, list.ButtonUpBounds, Corners.NorthEast); } else if (list.ButtonUpPressed) { DrawButtonPressed(g, list.ButtonUpBounds, Corners.NorthEast); } else if (list.ButtonUpSelected) { DrawButtonSelected(g, list.ButtonUpBounds, Corners.NorthEast); } else { DrawButton(g, list.ButtonUpBounds, Corners.NorthEast); } if (list.ButtonDropDownPresent) { if (list.ButtonDropDownPressed) { DrawButtonPressed(g, list.ButtonDropDownBounds, Corners.SouthEast); } else if (list.ButtonDropDownSelected) { DrawButtonSelected(g, list.ButtonDropDownBounds, Corners.SouthEast); } else { DrawButton(g, list.ButtonDropDownBounds, Corners.SouthEast); } } Color dk = ColorTable.Arrow; Color lt = ColorTable.ArrowLight; Color ds = ColorTable.ArrowDisabled; Rectangle arrUp = CenterOn(list.ButtonUpBounds, new Rectangle(Point.Empty, arrowSize)); arrUp.Offset(0, 1); Rectangle arrD = CenterOn(list.ButtonDownBounds, new Rectangle(Point.Empty, arrowSize)); arrD.Offset(0, 1); Rectangle arrdd = CenterOn(list.ButtonDropDownBounds, new Rectangle(Point.Empty, arrowSize)); arrdd.Offset(0, 3); DrawArrow(g, arrUp, list.ButtonUpEnabled ? lt : Color.Transparent, Direction.Up); arrUp.Offset(0, -1); DrawArrow(g, arrUp, list.ButtonUpEnabled ? dk : ds, Direction.Up); DrawArrow(g, arrD, list.ButtonDownEnabled ? lt : Color.Transparent, Direction.Down); arrD.Offset(0, -1); DrawArrow(g, arrD, list.ButtonDownEnabled ? dk : ds, Direction.Down); if (list.ButtonDropDownPresent) { using (SolidBrush b = new SolidBrush(ColorTable.Arrow)) { SmoothingMode sm = g.SmoothingMode; g.SmoothingMode = SmoothingMode.None; g.FillRectangle(b, new Rectangle(new Point(arrdd.Left - 1, arrdd.Top - 4), new Size(arrowSize.Width + 2, 1))); g.SmoothingMode = sm; } DrawArrow(g, arrdd, lt, Direction.Down); arrdd.Offset(0, -1); DrawArrow(g, arrdd, dk, Direction.Down); } #endregion }