Widget CreateContentPane(IUIStyle style)
        {
            var g = new Grid(style);

            g.ColumnConstraints.Add(LengthConstraint.Percentage(100));
            g.RowConstraints.Add(LengthConstraint.Auto);
            g.RowConstraints.Add(LengthConstraint.Relative(1));

            g.Add(CreateStyleSelector(style), new Point(0, 0));
            g.Add(WidgetDemo.CreateRootPanel(style), new Point(0, 1));
            return(g);
        }
Exemple #2
0
            public void Auto_Relative_Mixed()
            {
                var g = new Grid(LayoutTestStyle.Create());

                g.ColumnConstraints.Add(LengthConstraint.Auto);
                g.ColumnConstraints.Add(LengthConstraint.Relative(1));
                g.ColumnConstraints.Add(LengthConstraint.Relative(1));

                g.AddChildAt(LayoutTestWidget.FixedSize(100, 10), 0, 0);
                g.AddChildAt(LayoutTestWidget.FixedSize(200, 10), 1, 0);
                g.AddChildAt(LayoutTestWidget.FixedSize(10, 10), 2, 0);

                g.Arrange(new Rectangle(10, 20, 400, 20));
                g.DesiredSize.Should().Be(new Size(400, 10));
                g.LayoutRect.Should().Be(new Rectangle(10, 20, 400, 10));
                g[0].LayoutRect.Should().Be(new Rectangle(10, 20, 100, 10));
                g[1].LayoutRect.Should().Be(new Rectangle(110, 20, 150, 10));
                g[2].LayoutRect.Should().Be(new Rectangle(260, 20, 150, 10));
            }
        public BasicDemoPane(IUIStyle style) : base(style)
        {
            model = new BasicDemoModel();

            Content = new Grid(UIStyle)
            {
                Spacing = 5,
                Columns = new[]
                {
                    LengthConstraint.Auto,
                    LengthConstraint.Relative(1),
                    LengthConstraint.Relative(1)
                },
                Children = new[]
                {
                    new[]
                    {
                        new Label(UIStyle, "PasswordBox"),
                        CreatePasswordBox()
                    },
                    new[]
                    {
                        new Label(UIStyle, "Text-Box"),
                        CreateTextBox()
                    },
                    new[]
                    {
                        new Label(UIStyle, "DropDown-Box"),
                        CreateDropBox()
                    },
                    new[]
                    {
                        new Label(UIStyle, "RadioButtonSet"),
                        CreateRadioButtonSet()
                    },
                    new[]
                    {
                        new Label(UIStyle, "Slider"),
                        CreateSlider()
                    },
                    new[]
                    {
                        new Label(UIStyle, "Button"),
                        CreateButton()
                    },
                    new[]
                    {
                        new Label(UIStyle, "Checkbox"),
                        CreateCheckBox()
                    },
                    new[]
                    {
                        new Label(UIStyle, "Keybox"),
                        CreateKeyBox()
                    },
                    new[]
                    {
                        new Label(UIStyle, "Spinner"),
                        CreateSpinner()
                    },
                    new[]
                    {
                        new Label(UIStyle, "Progressbar"),
                        CreateProgressBar()
                    },
                    new[]
                    {
                        new Label(UIStyle, "ListBox"),
                        CreateListView()
                    }
                }
            };
        }