public override void DoLayout(LayoutVariables vars)
        {
            int[] minimum   = new int[_panels.Count];
            int[] preferred = new int[_panels.Count];

            for (int i = 0; i < _panels.Count; i++)
            {
                minimum[i]   = ((InterfaceNode)_panels[i]).MinimumSize.Height;
                preferred[i] = ((InterfaceNode)_panels[i]).PreferredSize.Height;
            }

            int[] heights = LayoutAlgorithms.AllocateSizeValues(_bounds.Height, minimum, preferred, vars.RowPadding);

            int height = 0;

            for (int i = 0; i < _panels.Count; i++)
            {
                InterfaceNode node = (InterfaceNode)_panels[i];

                node.SetLocation(_bounds.X, _bounds.Y + height);
                node.SetSize(_bounds.Width, heights[i]);
                height += heights[i];

                if ((i == (_panels.Count - 1)) &&
                    (height < _bounds.Height))
                {
                    node.SetSize(_bounds.Width, heights[i] + (_bounds.Height - height));
                }

                node.DoLayout(vars);
            }
        }
Example #2
0
        public override void DoLayout(LayoutVariables vars)
        {
            _lineCIO.GetControl().Size     = new System.Drawing.Size(1, _bounds.Height);
            _lineCIO.GetControl().Location = new System.Drawing.Point(_lineLoc, 0);

            int[] minimum   = new int[_panels.Count];
            int[] preferred = new int[_panels.Count];

            for (int i = 0; i < _panels.Count; i++)
            {
                minimum[i]   = ((InterfaceNode)_panels[i]).MinimumSize.Width;
                preferred[i] = ((InterfaceNode)_panels[i]).PreferredSize.Width;
            }

            int[] widths = LayoutAlgorithms.AllocateSizeValues(_bounds.Width, minimum, preferred, vars.RowPadding);

            int width = 0;

            for (int i = 0; i < _panels.Count; i++)
            {
                InterfaceNode node = (InterfaceNode)_panels[i];

                node.SetLocation(_bounds.X + width, _bounds.Y);
                node.SetSize(widths[i], _bounds.Height);
                width += widths[i];

                if ((i == (_panels.Count - 1)) &&
                    (width < _bounds.Width))
                {
                    node.SetSize(widths[i] + (_bounds.Width - width), _bounds.Height);
                }

                node.DoLayout(vars);
            }
        }
Example #3
0
        public override void DoLayout(LayoutVariables vars)
        {
            InterfaceNode node = (InterfaceNode)_panels[0];

            // set bounds to the control bounds, which are automattically set by
            // the TabControl
            Control c = _panel.GetControl();

            node.SetSize(c.Bounds.Width, c.Bounds.Height);
            node.SetLocation(0, 0);

            ((InterfaceNode)_panels[0]).DoLayout(vars);
        }
Example #4
0
        public override void DoLayout(LayoutVariables vars)
        {
            IEnumerator e = _panels.GetEnumerator();

            while (e.MoveNext())
            {
                InterfaceNode node = (InterfaceNode)e.Current;

                node.SetSize(_bounds.Width, _bounds.Height);
                node.SetLocation(_bounds.X, _bounds.Y);

                node.DoLayout(vars);
            }
        }
        public override void DoLayout(LayoutVariables vars)
        {
            IEnumerator e = _panels.GetEnumerator();

            Size      minSize        = GetTabbedCIO().GetMinimumSize();
            Rectangle tabPanelBounds = new Rectangle(0, 0, _bounds.Width - minSize.Width, _bounds.Height - minSize.Height);

            while (e.MoveNext())
            {
                InterfaceNode node = (InterfaceNode)e.Current;

                node.SetSize(tabPanelBounds.Width, tabPanelBounds.Height);
                node.SetLocation(tabPanelBounds.X, tabPanelBounds.Y);

                node.DoLayout(vars);
            }
        }