コード例 #1
0
        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);
            }
        }
コード例 #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);
            }
        }
コード例 #3
0
ファイル: OverlappingPanelsNode.cs プロジェクト: jwnichls/puc
        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);
            }
        }
コード例 #4
0
        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);
            }
        }