示例#1
0
        public PanelManager(IGUIContext ctx)
            : base(ctx)
        {
            MenuPanel = new Panel("menupanel", Docking.Top);
            AddChild(MenuPanel);

            StatusPanel = new Panel("statuspanel", Docking.Bottom);
            AddChild(StatusPanel);

            MainMenu = new GuiMenu("mainmenu");
            MenuBar  = new MenuBar("mainmenubar", MainMenu);
            ToolBar  = new ToolBar("maintoolbar", MainMenu);

            MenuPanel.AddChild(MenuBar);
            MenuPanel.AddChild(ToolBar);

            StatusBar = new StatusBar("mainstatusbar");
            StatusPanel.AddChild(StatusBar);

            LeftSideBar = new ScrollableContainer("leftsidebar", Docking.Left);
            AddChild(LeftSideBar);

            MainSplitter = new SplitContainer("mainsplitter", SplitOrientation.Vertical, -0.25f);
            AddChild(MainSplitter);

            TabMain = new TabContainer("maintabs");
            MainSplitter.Panel1.AddChild(TabMain);

            RightSideBarVisible = false;
        }
示例#2
0
        protected void InitText(string message, ColorContexts colorContext)
        {
            Message = message;

            TW = new MultiLineTextWidget("message", message,
                                         new WidgetStyle(Color.Empty,
                                                         Theme.GetContextForeColor(colorContext),
                                                         Color.Empty));

            TW.Padding = new Padding(16);
            TW.VAlign  = Alignment.Center;
            TW.HAlign  = Alignment.Center;
            this.OnLayout(CTX, CTX.Bounds);

            // Layout the text
            RectangleF bounds = ContentPanel.ClientRectangle;
            SizeF      sz     = TW.PreferredSize(CTX, bounds.Size);

            if (sz.Height > bounds.Height)
            {
                ScrollableContainer container = ContentPanel.AddChild(new ScrollableContainer("scroller"));
                container.ScrollBars = ScrollBars.Vertical;
                container.AutoScroll = true;
                TW.Dock = Docking.Top;
                container.AddChild(TW);
            }
            else
            {
                ContentPanel.AddChild(TW);
            }
        }
        protected void InitText(string message)
        {
            Message = message;

            MultiLineTextWidget text = new MultiLineTextWidget("message", message);

            text.Padding = new Padding(16);
            text.VAlign  = Alignment.Center;
            text.HAlign  = Alignment.Center;

            Controls.OnLayout(this, this.ClientRectangle);

            // Layout the text

            RectangleF bounds = Controls.ClientRectangle;
            SizeF      sz     = text.PreferredSize(this, bounds.Size);

            if (sz.Height > bounds.Height)
            {
                ScrollableContainer container = this.Controls.AddChild(new ScrollableContainer("scroller"));
                container.ScrollBars = ScrollBars.Vertical;
                container.AutoScroll = true;
                text.Dock            = Docking.Top;
                container.AddChild(text);
            }
            else
            {
                this.Controls.AddChild(text);
            }
        }
        public ComplexSplitContainer(string name, Docking dock, IWidgetStyle style)
            : base(name, dock, style)
        {
            /***
             * PanelLeft = new ScrollableContainer ("panelleft", Docking.Fill, new SplitContainerPanelStyle ());
             * PanelCenter = new ScrollableContainer ("panelcenter", Docking.Fill, new SplitContainerPanelStyle ());
             * PanelBottom = new ScrollableContainer ("panelbottom", Docking.Fill, new SplitContainerPanelStyle ());
             * PanelRight = new ScrollableContainer ("panelright", Docking.Fill, new SplitContainerPanelStyle ());
             ***/

            PanelLeft   = new ScrollableContainer("panelleft", Docking.Fill, new SplitContainerPanelStyle());
            PanelCenter = new ScrollableContainer("panelcenter", Docking.Fill, new EmptyWidgetStyle());
            PanelBottom = new ScrollableContainer("panelbottom", Docking.Fill, new EmptyWidgetStyle());
            PanelRight  = new ScrollableContainer("panelright", Docking.Fill, new EmptyWidgetStyle());

            SplitterLeft   = new VerticalSplitter("leftsplitter", new SplitContainerTransparentSplitterStyle());
            SplitterBottom = new HorizontalSplitter("bottomsplitter", new SplitContainerTransparentSplitterStyle());
            SplitterRight  = new VerticalSplitter("rightsplitter", new SplitContainerTransparentSplitterStyle());

            PanelCenter.Dock = Docking.Fill;

            Children.Add(SplitterLeft);
            Children.Add(SplitterBottom);
            Children.Add(SplitterRight);

            Children.Add(PanelLeft);
            Children.Add(PanelCenter);
            Children.Add(PanelBottom);
            Children.Add(PanelRight);

            SplitterLeft.Distance   = 0.25f;
            SplitterBottom.Distance = -0.25f;
            SplitterRight.Distance  = -0.25f;
        }
示例#5
0
        protected override void OnParentChanged()
        {
            base.OnParentChanged();

            ScrollableContainer sc = Parent as ScrollableContainer;

            if (!IsOverlay && sc != null)
            {
                sc.ScrollBars = ScrollBars.Vertical;
                sc.AutoScroll = true;
                sc.BackColor  = Theme.Colors.Base0;
            }
        }
        public QuatSplitter(string name, Docking dock, IWidgetStyle style)
            : base(name, dock, style)
        {
            Panel1 = new ScrollableContainer("panel1", Docking.Fill, new SplitContainerPanelStyle());
            Panel2 = new ScrollableContainer("panel2", Docking.Fill, new SplitContainerPanelStyle());
            Panel3 = new ScrollableContainer("panel3", Docking.Fill, new SplitContainerPanelStyle());
            Panel4 = new ScrollableContainer("panel4", Docking.Fill, new SplitContainerPanelStyle());

            Splitter1 = new HorizontalSplitter();
            Splitter2 = new VerticalSplitter();

            Children.Add(Splitter1);
            Children.Add(Splitter2);
            Children.Add(Panel1);
            Children.Add(Panel2);
            Children.Add(Panel3);
            Children.Add(Panel4);
        }
示例#7
0
        public TripleSplitContainer(string name, SplitOrientation orientation, Docking dock, IWidgetStyle style)
            : base(name, dock, style)
        {
            Orientation = orientation;

            /***
             * Panel1 = new ScrollableContainer ("panel1", Docking.Fill, new SplitContainerPanelStyle ());
             * Panel2 = new ScrollableContainer ("panel2", Docking.Fill, new SplitContainerPanelStyle ());
             * Panel3 = new ScrollableContainer ("panel3", Docking.Fill, new SplitContainerPanelStyle ());
             ***/

            Panel1 = new ScrollableContainer("panel1", Docking.Fill, new EmptyWidgetStyle());
            Panel2 = new ScrollableContainer("panel2", Docking.Fill, new EmptyWidgetStyle());
            Panel3 = new ScrollableContainer("panel3", Docking.Fill, new EmptyWidgetStyle());


            if (orientation == SplitOrientation.Horizontal)
            {
                Splitter1 = new HorizontalSplitter("splitter1", new SplitContainerTransparentSplitterStyle());
                Splitter2 = new HorizontalSplitter("splitter2", new SplitContainerTransparentSplitterStyle());
            }
            else
            {
                Splitter1 = new VerticalSplitter("splitter1", new SplitContainerTransparentSplitterStyle());
                Splitter2 = new VerticalSplitter("splitter2", new SplitContainerTransparentSplitterStyle());
            }

            Children.Add(Panel1);
            Children.Add(Splitter1);
            Children.Add(Panel2);
            Children.Add(Splitter2);
            Children.Add(Panel3);

            //if (distance != 0)
            Splitter1.Distance = 0.334f;
            Splitter2.Distance = 0.334f;
        }
        public SplitContainer(string name, SplitOrientation orientation, float distance)
            : base(name, Docking.Fill, new SplitContainerStyle())
        {
            /***
             * Panel1 = new ScrollableContainer ("panel1", Docking.Fill, new SplitContainerPanelStyle ());
             * Panel2 = new ScrollableContainer ("panel2", Docking.Fill, new SplitContainerPanelStyle ());
             ***/

            Panel1 = new ScrollableContainer("panel1", Docking.Fill, new EmptyWidgetStyle());
            Panel2 = new ScrollableContainer("panel2", Docking.Fill, new EmptyWidgetStyle());

            if (orientation == SplitOrientation.Horizontal)
            {
                Splitter = new HorizontalSplitter("splitter", new SplitContainerTransparentSplitterStyle());
            }
            else
            {
                Splitter = new VerticalSplitter("splitter", new SplitContainerTransparentSplitterStyle());
            }

            //Panel1.MinSize = new SizeF (Splitter.MinDistanceNear, Splitter.MinDistanceNear);
            //Panel2.MinSize = new SizeF (Splitter.MinDistanceFar, Splitter.MinDistanceFar);

            Children.Add(Panel1);
            Children.Add(Splitter);
            Children.Add(Panel2);

            //this.BackColor = Color.Yellow;
            //Panel2.BackColor = Color.Red;
            //Splitter.BackColor = Color.FromArgb(128, Color.LimeGreen);
            //Splitter.SplitterWidth = 12;

            if (distance != 0)
            {
                Splitter.Distance = distance;
            }
        }