Beispiel #1
0
        static void Main()
        {
            ShapesDemo();

            RenderUtils.Echo("Stand by...\n\n");
            SpecialChars.TestChars();

            RenderUtils.ResizeConsole(100, 50);
            RenderUtils.ResizeConsole(50, 25);
            RenderUtils.ResizeConsole(Console.LargestWindowWidth, Console.LargestWindowHeight);
            RenderUtils.ResizeConsole(30, 15);
            RenderUtils.ResizeConsole(80, 25);


            //Draw the splash
            BasicRenderSplash();
            //RenderUtils.Sleep(2000);
            RenderUtils.Pause();

            Window      WelcomeSplash    = new Window(false, true, "Welcome", 47, 10);
            CloseButton SplashWelcomeBTN = new CloseButton(WelcomeSplash, "[   OK   ]", ConsoleColor.DarkGray, ConsoleColor.White, ConsoleColor.DarkBlue, 19, 8);

            WindowElement[] SplashElements =
            {
                new BasicFontLabel(WelcomeSplash, "WELCOME", BasicFont.DefaultFont, ConsoleColor.Black, 3, 1),
                SplashWelcomeBTN
            };

            WelcomeSplash.AddElements(SplashElements);

            WelcomeSplash.HighlightedElement = SplashWelcomeBTN;
            SplashWelcomeBTN.Highlighted     = true;
            WelcomeSplash.Execute();

            //5x6

            //Clear the screen, set up for the "window Environment"
            RenderUtils.Color(ConsoleColor.DarkCyan, ConsoleColor.White);
            Console.Clear();

            //Time to test the tickable timer window and a new label.
            TickableWindow LoadWindow = new TickableWindow(true, true, "Please Wait", 42, 7);

            WindowElement[] Elements =
            {
                new Icon(LoadWindow,    Icon.IconType.INFORMATION,                                      1,                 2),
                new Label(LoadWindow,   "Please Wait, BasicRender is loading", ConsoleColor.Gray,          ConsoleColor.Black,  5, 2),
                new Spinner(LoadWindow, ConsoleColor.Gray,                     ConsoleColor.Black,                          5, 4),
                new Timer(LoadWindow,                                       5, new Progressbar(LoadWindow,                 33,  7, 4))
                {
                    BackToFront = true
                }
            };

            LoadWindow.AddElements(Elements);

            //Test Tickable Window
            LoadWindow.Execute();

            //Test DialogBox
            DialogBox.ShowDialogBox(Icon.IconType.INFORMATION, DialogBox.DialogBoxButtons.OK, "Test I hope this works.");

            //More Extensively test Dialogbox
            Quiz();

            //Test HelloWorld
            //new HelloWorldWindow().Execute(); //We no longer really need to test HelloWorld. Windows are just windows now

            //Show the welcome window
            new WelcomeWindow().Execute();

            //
            DialogBox.ShowDialogBox(Icon.IconType.INFORMATION, DialogBox.DialogBoxButtons.OK, "The system will now attempt to divide by 0 to showcase error screens.");
            try { GenerateStackedError(7); } catch (Exception E) {
                ErrorWindow.ShowErrorWindow(E.Message);
                DialogBox.ShowExceptionError(E);
                GuruMeditationErrorScreen.Show(E, true);
            }
        }