/// <summary> /// Creates the path of the tab and its contents /// </summary> /// <returns></returns> public GraphicsPath CreateTabPath(RibbonTab t) { var path = new GraphicsPath(); const int corner = 6; const int rightOffset = 1; path.AddLine( t.TabBounds.Left, t.TabBounds.Bottom, t.TabBounds.Left, t.TabBounds.Top + corner); path.AddArc( new Rectangle( t.TabBounds.Left, t.TabBounds.Top, corner, corner), 180, 90); path.AddLine( t.TabBounds.Left + corner, t.TabBounds.Top, t.TabBounds.Right - corner - rightOffset, t.TabBounds.Top); path.AddArc( new Rectangle( t.TabBounds.Right - corner - rightOffset, t.TabBounds.Top, corner, corner), -90, 90); path.AddLine( t.TabBounds.Right - rightOffset, t.TabBounds.Top + corner, t.TabBounds.Right - rightOffset, t.TabBounds.Bottom); return path; }
public RibbonTabRenderEventArgs(Controls.Ribbon.Ribbon owner, Graphics g, Rectangle clip, RibbonTab tab) : base(owner, g, clip) { Tab = tab; }
/// <summary> /// Creates the path of the tab and its contents /// </summary> /// <returns></returns> public GraphicsPath CreateCompleteTabPath(RibbonTab t) { var path = new GraphicsPath(); const int corner = 6; path.AddLine(t.TabBounds.Left + corner, t.TabBounds.Top, t.TabBounds.Right - corner, t.TabBounds.Top); path.AddArc( Rectangle.FromLTRB(t.TabBounds.Right - corner, t.TabBounds.Top, t.TabBounds.Right, t.TabBounds.Top + corner), -90, 90); path.AddLine(t.TabBounds.Right, t.TabBounds.Top + corner, t.TabBounds.Right, t.TabBounds.Bottom - corner); path.AddArc(Rectangle.FromLTRB( t.TabBounds.Right, t.TabBounds.Bottom - corner, t.TabBounds.Right + corner, t.TabBounds.Bottom), -180, -90); path.AddLine(t.TabBounds.Right + corner, t.TabBounds.Bottom, t.TabContentBounds.Right - corner, t.TabBounds.Bottom); path.AddArc(Rectangle.FromLTRB( t.TabContentBounds.Right - corner, t.TabBounds.Bottom, t.TabContentBounds.Right, t.TabBounds.Bottom + corner), -90, 90); path.AddLine(t.TabContentBounds.Right, t.TabContentBounds.Top + corner, t.TabContentBounds.Right, t.TabContentBounds.Bottom - corner); path.AddArc(Rectangle.FromLTRB( t.TabContentBounds.Right - corner, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Right, t.TabContentBounds.Bottom), 0, 90); path.AddLine(t.TabContentBounds.Right - corner, t.TabContentBounds.Bottom, t.TabContentBounds.Left + corner, t.TabContentBounds.Bottom); path.AddArc(Rectangle.FromLTRB( t.TabContentBounds.Left, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Left + corner, t.TabContentBounds.Bottom), 90, 90); path.AddLine(t.TabContentBounds.Left, t.TabContentBounds.Bottom - corner, t.TabContentBounds.Left, t.TabBounds.Bottom + corner); path.AddArc(Rectangle.FromLTRB( t.TabContentBounds.Left, t.TabBounds.Bottom, t.TabContentBounds.Left + corner, t.TabBounds.Bottom + corner), 180, 90); path.AddLine(t.TabContentBounds.Left + corner, t.TabContentBounds.Top, t.TabBounds.Left - corner, t.TabBounds.Bottom); path.AddArc(Rectangle.FromLTRB( t.TabBounds.Left - corner, t.TabBounds.Bottom - corner, t.TabBounds.Left, t.TabBounds.Bottom), 90, -90); path.AddLine(t.TabBounds.Left, t.TabBounds.Bottom - corner, t.TabBounds.Left, t.TabBounds.Top + corner); path.AddArc(Rectangle.FromLTRB( t.TabBounds.Left, t.TabBounds.Top, t.TabBounds.Left + corner, t.TabBounds.Top + corner), 180, 90); path.CloseFigure(); return path; }
/// <param name="ownerTab">RibbonTab where this item is located</param> internal override void SetOwnerTab(RibbonTab ownerTab) { base.SetOwnerTab(ownerTab); Items.SetOwnerTab(ownerTab); }