Beispiel #1
0
        Popup CreatePopup()
        {
            Popup confirmationPopup = new Popup();

            View footer = new View();

            footer.Name = ("Footer");
            footer.WidthResizePolicy  = ResizePolicyType.FillToParent;
            footer.HeightResizePolicy = ResizePolicyType.Fixed;
            footer.Size2D             = new Size2D(0, 80);
            footer.PivotPoint         = PivotPoint.Center;

            PushButton okButton = CreateOKButton();

            okButton.PivotPoint         = PivotPoint.Center;
            okButton.WidthResizePolicy  = ResizePolicyType.SizeFixedOffsetFromParent;
            okButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
            okButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));

            PushButton cancelButton = CreateCancelButton();

            cancelButton.PivotPoint         = PivotPoint.Center;
            cancelButton.WidthResizePolicy  = ResizePolicyType.SizeFixedOffsetFromParent;
            cancelButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
            cancelButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));

            TableView controlLayout = new TableView(1, 2);

            controlLayout.PivotPoint         = PivotPoint.Center;
            controlLayout.WidthResizePolicy  = ResizePolicyType.FillToParent;
            controlLayout.HeightResizePolicy = ResizePolicyType.FillToParent;
            controlLayout.SetCellPadding(new Size2D(10, 10));
            controlLayout.SetRelativeWidth(0, 0.5f);
            controlLayout.SetRelativeWidth(1, 0.5f);
            controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);
            controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);
            controlLayout.AddChild(okButton, new TableView.CellPosition(0, 0));
            controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1));

            footer.Add(controlLayout);

            confirmationPopup.SetFooter(footer);
            return(confirmationPopup);
        }