예제 #1
0
        public DemoScreen()
        {
            this.mainMenuPanel = new Panel { Size = new Size(30, 30), RelativeLocation = new Coordinate(2, 1) };
            this.Controls.Add(this.mainMenuPanel);

            this.mainMenuTextLabel =
                new Label
                {
                    Size = new Size(30, 7),
                    Text = "This is the main menu. You can select items with the UP and DOWN arrows or the W and S keys (this can be customized). Press enter if you want to see the presentation."
                };
            this.mainMenuPanel.Controls.Add(mainMenuTextLabel);

            this.mainMenu = new Menu<Action> { RelativeLocation = new Coordinate(0, 7), Size = new Size(15, 10) };
            this.mainMenu.Items.Add(new MenuItem<Action>("Label", this.ShowLabelDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("ListView", this.ShowListViewDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("TextBox", this.ShowTextBoxDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("Rectangle", this.ShowRectangleDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("Line", this.ShowLineDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("Ellipse", this.ShowEllipseDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("Exit", this.Exit));

            this.mainMenu.UpKeys.Add(ConsoleKey.W);
            this.mainMenu.DownKeys.Add(ConsoleKey.S);

            this.mainMenu.ItemChosen += mainMenu_ItemChosen;

            this.mainMenuPanel.Controls.Add(this.mainMenu);
        }
예제 #2
0
        public LabelDemoPanel()
        {
            this.label =
                new Label
                    {
                        Size = new Size(14, 10),
                        Text = "This is a label. As you can see, it arranges the words in a rectangle, which has the size of the label, in this case 15 x 10."
                    };

            this.Controls.Add(this.label);
        }
예제 #3
0
        public RectangleDemoPanel()
        {
            this.filledRectangleLabel = new Label { Text = "This is a filled rectangle." };
            this.filledRectangleLabel.Size = new Size(this.filledRectangleLabel.Text.Length, 1);
            this.filledRectangleLabel.RelativeLocation = new Coordinate(17, 0);
            this.Controls.Add(this.filledRectangleLabel);

            this.emptyRectangleLabel = new Label { Text = "This is an empty rectangle." };
            this.emptyRectangleLabel.Size = new Size(this.emptyRectangleLabel.Text.Length, 1);
            this.emptyRectangleLabel.RelativeLocation = new Coordinate(17, 11);
            this.Controls.Add(this.emptyRectangleLabel);
        }
예제 #4
0
        public EllipseDemoPanel()
        {
            this.ellipseLabel = new Label { Text = "This is an ellipse." };
            this.ellipseLabel.Size = new Size(this.ellipseLabel.Text.Length, 1);
            this.ellipseLabel.RelativeLocation = new Coordinate(17, 0);
            this.Controls.Add(this.ellipseLabel);

            this.circleLabel = new Label { Text = "This is a circle." };
            this.circleLabel.Size = new Size(this.circleLabel.Text.Length, 1);
            this.circleLabel.RelativeLocation = new Coordinate(19, 18);
            this.Controls.Add(this.circleLabel);
        }
예제 #5
0
        public LineDemoPanel()
        {
            this.horizontalLineLabel = new Label { Text = "This is a horizontal line." };
            this.horizontalLineLabel.Size = new Size(this.horizontalLineLabel.Text.Length, 1);
            this.Controls.Add(this.horizontalLineLabel);

            this.verticalLineLabel = new Label { Text = "This is a vertical line." };
            this.verticalLineLabel.Size = new Size(this.verticalLineLabel.Text.Length, 1);
            this.verticalLineLabel.RelativeLocation = new Coordinate(0, 4);
            this.Controls.Add(this.verticalLineLabel);

            this.genericLineLabel = new Label { Text = "This is a generic line." };
            this.genericLineLabel.Size = new Size(this.genericLineLabel.Text.Length, 1);
            this.genericLineLabel.RelativeLocation = new Coordinate(0, 17);
            this.Controls.Add(this.genericLineLabel);
        }
예제 #6
0
        public TextBoxDemoPanel()
        {
            this.descriptionLabel =
                new Label
                    {
                        Text = "Enter some text and press enter. The maximum length is set to 5 characters, but it has a width of 8. Of course, this limits can be increased."
                    };
            this.descriptionLabel.Size = new Size(this.descriptionLabel.Text.Length / 3 + 1, 4);
            this.Controls.Add(this.descriptionLabel);

            this.textBox = new TextBox { Size = new Size(8, 1), MaxLength = 5, RelativeLocation = new Coordinate(0, 4) };
            this.textBox.TextSubmitted += textBox_TextSubmitted;
            this.Controls.Add(this.textBox);

            this.textLabel = new Label { RelativeLocation = new Coordinate(0, 6) };
            this.Controls.Add(this.textLabel);
        }