public override void OnLayout(IGUIContext ctx, RectangleF bounds)
        {
            base.OnLayout(ctx, bounds);

            if (!Panel1Collapsed && !Panel2Collapsed)
            {
                Splitter1.OnLayout(ctx, this.Bounds);
            }
            if (!Panel3Collapsed && !Panel2Collapsed)
            {
                Splitter2.OnLayout(ctx, this.Bounds);
            }


            /***
             * if (Panel1Collapsed && Panel2Collapsed && !Panel3Collapsed)
             *      Panel3.OnLayout (ctx, bounds);
             *
             * if (Panel1Collapsed && !Panel2Collapsed && Panel3Collapsed)
             *      Panel2.OnLayout (ctx, bounds);
             *
             * if (!Panel1Collapsed && Panel2Collapsed && Panel3Collapsed)
             *      Panel1.OnLayout (ctx, bounds);
             *
             * if (!Panel1Collapsed && !Panel3Collapsed)
             *      Panel2.OnLayout (ctx, bounds);
             ***/


            if (Panel1.IsVisibleEnabled)
            {
                Panel1.OnLayout(ctx, new RectangleF(Left, Top, Splitter1.Left - Left, Height));
            }
            if (Panel2.IsVisibleEnabled)
            {
                Panel2.OnLayout(ctx, new RectangleF(Splitter1.Right, Top, Splitter2.Left - Splitter1.Right, Height));
            }
            if (Panel3.IsVisibleEnabled)
            {
                Panel3.OnLayout(ctx, new RectangleF(Splitter2.Right, Top, Right - Splitter2.Right, Height));
            }
        }
Exemple #2
0
        public override void OnLayout(IGUIContext ctx, RectangleF bounds)
        {
            base.OnLayout(ctx, bounds);

            bool visible1 = Panel1.Visible && Panel2.Visible && !Panel1Collapsed && !Panel2Collapsed;
            bool visible2 = Panel2.Visible && Panel3.Visible && !Panel2Collapsed && !Panel3Collapsed;

            if (!visible1 && !visible2)
            {
                visible1 = true;
            }

            Splitter1.Visible = visible1;
            Splitter2.Visible = visible2;

            if (Splitter1.Visible)
            {
                Splitter1.OnLayout(ctx, bounds);
            }
            if (Splitter2.Visible)
            {
                Splitter2.OnLayout(ctx, bounds);
            }

            if (Orientation == SplitOrientation.Vertical)
            {
                if (Panel1.Visible)
                {
                    if (Panel2.Visible)
                    {
                        Panel1.OnLayout(ctx, new RectangleF(Left, Top, Splitter1.Left - Left, Height));
                    }
                    else if (Panel3.Visible)
                    {
                        Panel1.OnLayout(ctx, new RectangleF(Left, Top, Splitter1.Left - Left, Height));
                    }
                    else
                    {
                        Panel1.OnLayout(ctx, new RectangleF(Left, Top, Width, Height));
                    }
                }
                if (Panel2.Visible)
                {
                    if (Panel1.Visible)
                    {
                        if (Panel3.Visible)
                        {
                            Panel2.OnLayout(ctx, new RectangleF(Splitter1.Right, Top, Splitter2.Left - Splitter1.Right, Height));
                        }
                        else
                        {
                            Panel2.OnLayout(ctx, new RectangleF(Splitter1.Right, Top, Right - Splitter1.Right, Height));
                        }
                    }
                    else if (Panel3.Visible)
                    {
                        Panel2.OnLayout(ctx, new RectangleF(Splitter1.Right, Top, Splitter2.Left - Left, Height));
                    }
                    else
                    {
                        Panel2.OnLayout(ctx, new RectangleF(Left, Top, Width, Height));
                    }
                }
                if (Panel3.Visible)
                {
                    if (Panel1.Visible)
                    {
                        Panel3.OnLayout(ctx, new RectangleF(Left, Top, Right - Splitter1.Right, Height));
                    }
                    else if (Panel2.Visible)
                    {
                        Panel3.OnLayout(ctx, new RectangleF(Left, Top, Right - Splitter2.Right, Height));
                    }
                    else
                    {
                        Panel3.OnLayout(ctx, new RectangleF(Left, Top, Width, Height));
                    }
                }
            }
            else                        // *** Orientation = Horizontal
            {
                if (Panel1.Visible)
                {
                    if (Panel2.Visible)
                    {
                        Panel1.OnLayout(ctx, new RectangleF(Left, Top, Width, Splitter1.Top - Top));
                    }
                    else if (Panel3.Visible)
                    {
                        Panel1.OnLayout(ctx, new RectangleF(Left, Top, Width, Splitter1.Top - Top));
                    }
                    else
                    {
                        Panel1.OnLayout(ctx, new RectangleF(Left, Top, Width, Height));
                    }
                }
                if (Panel2.Visible)
                {
                    if (Panel1.Visible)
                    {
                        if (Panel3.Visible)
                        {
                            Panel2.OnLayout(ctx, new RectangleF(Splitter1.Right, Top, Width, Splitter2.Top - Splitter1.Bottom));
                        }
                        else
                        {
                            Panel2.OnLayout(ctx, new RectangleF(Splitter1.Right, Top, Width, Bottom - Splitter1.Bottom));
                        }
                    }
                    else if (Panel3.Visible)
                    {
                        Panel2.OnLayout(ctx, new RectangleF(Left, Top, Width, Splitter2.Top - Top));
                    }
                    else
                    {
                        Panel2.OnLayout(ctx, new RectangleF(Left, Top, Width, Height));
                    }
                }
                if (Panel3.Visible)
                {
                    if (Panel2.Visible)
                    {
                        Panel3.OnLayout(ctx, new RectangleF(Left, Splitter2.Bottom, Width, Bottom - Splitter2.Bottom));
                    }
                    else if (Panel1.Visible)
                    {
                        Panel3.OnLayout(ctx, new RectangleF(Left, Splitter1.Bottom, Width, Bottom - Splitter1.Bottom));
                    }
                    else
                    {
                        Panel3.OnLayout(ctx, new RectangleF(Left, Top, Width, Height));
                    }
                }
            }
        }