ComponentFactory.Krypton.Ribbon.ViewLayoutRibbonTitle.Layout C# (CSharp) Method

Layout() public method

Perform a layout of the elements.
public Layout ( ViewLayoutContext context ) : void
context ComponentFactory.Krypton.Toolkit.ViewLayoutContext Layout context.
return void
        public override void Layout(ViewLayoutContext context)
        {
            // Let base class perform simple layout
            base.Layout(context);

            // We adjust the vertical layout position of the bottom docked items
            Rectangle tempRect = context.DisplayRectangle;
            foreach(ViewBase view in this)
            {
                if (GetDock(view) == ViewDockStyle.Bottom)
                {
                    // Ask the element to layout again but offset
                    Rectangle layoutRect = view.ClientRectangle;
                    layoutRect.Y += VertOffset;
                    context.DisplayRectangle = layoutRect;

                    view.Layout(context);
                }
            }

            // Must restore the original value
            context.DisplayRectangle = tempRect;
        }