예제 #1
0
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = System.Windows.Forms.VisualStyles.VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true
            };

            Background = new BackgroundControl {
                ShrinkToContents    = !RendersEntireSpace,
                VerticalAlignment   = System.Windows.Forms.VisualStyles.VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Padding             = new Padding(3)
            };

            Controls.Add(flow);
            flow.Controls.Add(Background);

            foreach (var config in StatsControls)
            {
                Background.Controls.Add(config);
            }

            SetUpEntityForInfoControls(Entity);
        }
예제 #2
0
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true
            };

            Background = new BackgroundControl {
                Position = Position, ShrinkToContents = !RendersEntireSpace, Padding = new Padding(4)
            };

            var innerflow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight, VerticalAlignment = VerticalAlignment.Center, ShrinkToContents = true
            };

            Background.Controls.Add(innerflow);

            if (_displayEntity != null)
            {
                var entityControl = new MenuEntityControl {
                    Entity = _displayEntity, VerticalAlignment = VerticalAlignment.Center
                };
                innerflow.Controls.Add(entityControl);
            }

            innerflow.Controls.Add(new TextControl {
                Parameters = Text, VerticalAlignment = VerticalAlignment.Center, Margin = new Padding(2)
            });

            Controls.Add(flow);
            flow.Controls.Add(Background);
        }
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true,
                Padding             = new Padding(10)
            };

            var backgroundControl = new BackgroundControl
            {
                Position            = Position,
                Padding             = new Padding(3),
                ShrinkToContents    = true,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center
            };

            var downFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.TopDown, VerticalAlignment = VerticalAlignment.Top, ShrinkToContents = true
            };
            var sideFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true
            };
            var textControl = new TextControl {
                Parameters = _caption, Margin = new Padding(1)
            };
            var buttonControl = new ButtonControl {
                Text = "Cancel"
            };

            HoveredCellName = new TextControl {
                Parameters = HoveredCellText
            };

            buttonControl.OnClick += buttonControl_OnClick;

            Controls.Add(flow);
            flow.Controls.Add(backgroundControl);

            backgroundControl.Controls.Add(downFlow);

            downFlow.Controls.Add(textControl);
            downFlow.Controls.Add(sideFlow);
            downFlow.Controls.Add(HoveredCellName);
            downFlow.Controls.Add(buttonControl);

            foreach (var cell in Entities)
            {
                sideFlow.Controls.Add(new MenuEntityControl {
                    Entity = cell, Margin = new Padding(1)
                });
            }
        }
예제 #4
0
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true,
                Padding             = new Padding(10)
            };


            var background = new BackgroundControl {
                ShrinkToContents = true, Padding = new Padding(2)
            };
            var text = new TextControl {
                Position = new Rectangle(), Parameters = _text, Margin = new Padding(1)
            };

            OkButton = new ButtonControl {
                Position = new Rectangle(), Text = "OK", Margin = new Padding(1)
            };
            CancelButton = new ButtonControl {
                Position = new Rectangle(), Text = "Cancel", Margin = new Padding(1)
            };

            var verticalFlow = new FlowContainerControl()
            {
                ShrinkToContents = true
            };
            var horizontalFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true
            };

            OkButton.IsFocused     = OkSelected;
            OkButton.OnClick      += OkButton_OnClick;
            CancelButton.IsFocused = !OkSelected;
            CancelButton.OnClick  += CancelButton_OnClick;

            Controls.Add(flow);
            flow.Controls.Add(background);
            background.Controls.Add(verticalFlow);
            verticalFlow.Controls.Add(text);
            verticalFlow.Controls.Add(horizontalFlow);
            horizontalFlow.Controls.Add(OkButton);
            horizontalFlow.Controls.Add(CancelButton);
        }
예제 #5
0
        public override void InitialiseControls()
        {
            var label = new TextControl {
                Parameters = Text
            };
            var textBox = new TextBoxControl {
                Value = InputText
            };
            var background = new BackgroundControl {
                Position = Position
            };
            var topFlow = new FlowContainerControl();

            topFlow.Controls.Add(label);
            topFlow.Controls.Add(textBox);

            Controls.Add(background);
            Controls.Add(topFlow);
        }
예제 #6
0
        public override void InitialiseControls()
        {
            var horizontalAlignment = Menu.Centred ? HorizontalAlignment.Center : HorizontalAlignment.Left;
            var verticalAlignment   = Menu.Centred ? VerticalAlignment.Center : VerticalAlignment.Top;

            var background = new BackgroundControl {
                Position = Position, Padding = Padding, HorizontalAlignment = horizontalAlignment, VerticalAlignment = verticalAlignment
            };

            Controls.Add(background);

            MenuActions = new MenuActionsControl {
                AvailableActions = Menu.AvailableActions, SelectedAction = Menu.SelectedAction, SelectedColor = Color.Blue, VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Right
            };
            background.Controls.Add(MenuActions);

            var topFlow = new FlowContainerControl {
                HorizontalAlignment = horizontalAlignment, VerticalAlignment = verticalAlignment, ShrinkToContents = true
            };

            var titleText = new LargeTextControl {
                Parameters = Menu.MenuName
            };

            topFlow.Controls.Add(titleText);

            var lineControl = new LineControl();

            topFlow.Controls.Add(lineControl);

            background.Controls.Add(topFlow);

            PagedMenuControl = new PagedMenuControl {
                MenuItems = Menu.MenuItems, SelectedItem = Menu.SelectedItem, ShrinkToContents = true, Margin = new Padding(4, 1, 1, 1), HorizontalAlignment = horizontalAlignment, VerticalAlignment = verticalAlignment
            };

            topFlow.Controls.Add(PagedMenuControl);
        }
예제 #7
0
        public override void InitialiseControls()
        {
            backgroundControl = new BackgroundControl {
                Position = Position, Padding = new Padding(3)
            };

            var topFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.BottomUp, VerticalAlignment = VerticalAlignment.Bottom
            };
            var downFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.TopDown, VerticalAlignment = VerticalAlignment.Top
            };

            ShopItemsFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight
            };

            titleControl = new LargeTextControl {
                Parameters = this.shop.DescriptionName
            };
            exitButton = new ButtonControl {
                Position = new Rectangle(), Text = "Exit"
            };
            exitButton.OnClick += ExitButton_OnClick;

            Controls.Add(backgroundControl);
            backgroundControl.Controls.Add(topFlow);

            topFlow.Controls.Add(exitButton);
            topFlow.Controls.Add(downFlow);

            downFlow.Controls.Add(titleControl);
            downFlow.Controls.Add(new Spacer());
            downFlow.Controls.Add(ShopItemsFlow);

            RefreshShopItemControls();
        }
예제 #8
0
        public override void InitialiseControls()
        {
            var backgroundControl = new BackgroundControl {
                Position = Position, Padding = Padding
            };

            var topFlow = new FlowContainerControl {
                Position = Position, ShrinkToContents = true
            };

            var titleText = new LargeTextControl {
                Parameters = Form.Title
            };

            topFlow.Controls.Add(titleText);
            var lineControl = new LineControl();

            topFlow.Controls.Add(lineControl);

            var buttonFlowContainer = new FlowContainerControl {
                Position = Position, FlowDirection = FlowDirection.BottomUp, VerticalAlignment = VerticalAlignment.Bottom, ShrinkToContents = true
            };
            var buttonFlow = new FlowContainerControl {
                Position = Position, FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true, VerticalAlignment = VerticalAlignment.Bottom
            };

            buttonFlowContainer.Controls.Add(buttonFlow);

            Buttons = new List <ButtonControl>();
            foreach (var button in Form.Buttons.GetFlags())
            {
                var buttonControl = new ButtonControl {
                    Text = button.ToString(), Margin = new Padding(2)
                };
                buttonControl.OnClick += FormButtonControl_OnClick;
                buttonFlow.Controls.Add(buttonControl);
                Buttons.Add(buttonControl);
            }

            FormControls = new List <FormData>();
            foreach (var formField in Form.Fields)
            {
                var nameText = new TextControl {
                    Parameters = formField.Key + ": "
                };
                var formFieldControl = formField.Value;

                formFieldControl.OnClick += FormFieldControl_OnClick;
                FormControls.Add(formFieldControl);

                var subFlow = new FlowContainerControl {
                    FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true, Margin = new Padding {
                        Top = 1
                    }
                };
                subFlow.Controls.Add(nameText);
                subFlow.Controls.Add(formFieldControl);
                topFlow.Controls.Add(subFlow);
            }

            Controls.Add(backgroundControl);
            backgroundControl.Controls.Add(topFlow);
            backgroundControl.Controls.Add(buttonFlow);
        }