Exemplo n.º 1
0
        private void InitializeComponent()
        {
            Width  = 80;
            Height = 20;
            Title  = "Main Window";

            panel1 = new Panel()
            {
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
            };

            statusBar1 = new StatusBar();
            statusBar1.AddHelpButton();

            statusBarLabel = new Label();
            statusBar1.AddContent(statusBarLabel, Dock.Right);

            StatusBar = statusBar1;
            AddContent(panel1);

            mainMenu1 = new MainMenu();
            var controlsMenuItem = new MenuItem("Controls");

            panelMenuItem          = new MenuItem("Panel");
            panelMenuItem.OnClick += ControlMenuItemClick;
            panelMenuItem.Tag      = ScreenType.Panel;
            controlsMenuItem.Items.Add(panelMenuItem);

            gruopMenuItem          = new MenuItem("GroupBox");
            gruopMenuItem.OnClick += ControlMenuItemClick;
            gruopMenuItem.Tag      = ScreenType.GroupBox;
            controlsMenuItem.Items.Add(gruopMenuItem);

            stackMenuItem          = new MenuItem("StackPanel");
            stackMenuItem.OnClick += ControlMenuItemClick;
            stackMenuItem.Tag      = ScreenType.StackPanel;
            controlsMenuItem.Items.Add(stackMenuItem);

            dockMenuItem          = new MenuItem("DockPanel");
            dockMenuItem.OnClick += ControlMenuItemClick;
            dockMenuItem.Tag      = ScreenType.DockPanel;
            controlsMenuItem.Items.Add(dockMenuItem);

            tileMenuItem          = new MenuItem("TilePanel");
            tileMenuItem.OnClick += ControlMenuItemClick;
            tileMenuItem.Tag      = ScreenType.TilePanel;
            controlsMenuItem.Items.Add(tileMenuItem);

            mainMenu1.Items.Add(controlsMenuItem);
            propMenuItem = new MenuItem("Properties");
            mainMenu1.Items.Add(propMenuItem);
        }
Exemplo n.º 2
0
        private void InitializeComponent()
        {
            Width  = 80;
            Height = 20;
            Title  = "Main Window";

            panel1 = new Panel()
            {
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
            };

            statusBar1 = new StatusBar();
            statusBar1.AddHelpButton();
            statusBar1.AddLabel("label docked right", Dock.Right);

            AddContent(panel1);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initialize components of Window as buttons, panels, etc.
        /// </summary>
        private void InitializeComponent()
        {
            Width  = 80;
            Height = 20;
            Title  = "Main Window";

            panel1 = new Panel()
            {
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
            };

            statusBar1 = new StatusBar();
            statusBar1.AddHelpButton();

            statusBarLabel = new Label();
            statusBar1.AddContent(statusBarLabel, Dock.Right);

            StatusBar = statusBar1;
            AddContent(panel1);

            mainMenu1 = new MainMenu();
            var controlsMenuItem = new MenuItem("Controls");

            radioGroupMenuItem          = new MenuItem("RadioGroup");
            radioGroupMenuItem.OnClick += ControlMenuItemClick;
            radioGroupMenuItem.Tag      = ScreenType.RadioGroup;
            controlsMenuItem.Items.Add(radioGroupMenuItem);

            checkBoxGroupMenuItem          = new MenuItem("CheckBoxGroup");
            checkBoxGroupMenuItem.OnClick += ControlMenuItemClick;
            ;
            checkBoxGroupMenuItem.Tag = ScreenType.CheckBoxGroup;
            controlsMenuItem.Items.Add(checkBoxGroupMenuItem);

            mainMenu1.Items.Add(controlsMenuItem);

            propMenuItem = new MenuItem("Properties", null, enabled: false);
            mainMenu1.Items.Add(propMenuItem);
            MainMenu = mainMenu1;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize components of Window as buttons, panels, etc.
        /// </summary>
        private void InitializeComponent()
        {
            Width  = 80;
            Height = 20;
            Title  = "ListView demo app";

            panel1 = new Panel()
            {
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
            };

            mainMenu1        = new MainMenu();
            controlsMenuItem = new MenuItem("Steps");

            var baseMenuItem = new MenuItem("Base properties", null, @checked: true);

            baseMenuItem.Tag      = ScreenType.Base;
            baseMenuItem.OnClick += StepsMenuClick;
            controlsMenuItem.Items.Add(baseMenuItem);

            var headerMenuItem = new MenuItem("ColumnHeaders");

            headerMenuItem.Tag      = ScreenType.Headers;
            headerMenuItem.OnClick += StepsMenuClick;
            controlsMenuItem.Items.Add(headerMenuItem);

            mainMenu1.Items.Add(controlsMenuItem);

            propMenuItem = new MenuItem("Properties");
            mainMenu1.Items.Add(propMenuItem);

            statusBar1 = new StatusBar();
            statusBar1.AddHelpButton();

            statusBarLabel = new Label();
            statusBar1.AddContent(statusBarLabel, Dock.Right);

            StatusBar = statusBar1;
            AddContent(panel1);
        }
Exemplo n.º 5
0
        private void InitializeComponent()
        {
            Width  = 80;
            Height = 20;
            Title  = "Main Window";

            panel1 = new Panel()
            {
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
            };

            statusBar1 = new StatusBar();
            statusBar1.AddHelpButton();

            statusBarLabel = new Label();
            statusBar1.AddContent(statusBarLabel, Dock.Right);

            StatusBar = statusBar1;
            AddContent(panel1);

            mainMenu1        = new MainMenu();
            controlsMenuItem = new MenuItem("Controls");

            foreach (var item in Screens)
            {
                var menuItem = new MenuItem(item.Value);
                menuItem.OnClick += ControlMenuItemClick;
                menuItem.Tag      = item.Key;
                controlsMenuItem.Items.Add(menuItem);
            }

            mainMenu1.Items.Add(controlsMenuItem);

            propMenuItem         = new MenuItem("Properties");
            propMenuItem.Visible = false;
            mainMenu1.Items.Add(propMenuItem);

            MainMenu = mainMenu1;
        }
Exemplo n.º 6
0
        private void InitializeComponent()
        {
            Width  = 80;
            Height = 20;
            Title  = "Main Window";

            panel1 = new Panel()
            {
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
            };

            mainMenu1 = new MainMenu();
            var controlsMenuItem = new MenuItem("Controls");

            listMenuItem          = new MenuItem("Simple listbox");
            listMenuItem.OnClick += ControlMenuItemClick;
            listMenuItem.Tag      = ScreenType.ListBox;
            controlsMenuItem.Items.Add(listMenuItem);

            twoListMenuItem          = new MenuItem("Two listboxes");
            twoListMenuItem.OnClick += ControlMenuItemClick;
            twoListMenuItem.Tag      = ScreenType.TwoListBoxes;
            controlsMenuItem.Items.Add(twoListMenuItem);

            mainMenu1.Items.Add(controlsMenuItem);

            propMenuItem = new MenuItem("Properties");
            mainMenu1.Items.Add(propMenuItem);

            statusBar1 = new StatusBar();
            statusBar1.AddHelpButton();

            statusBarLabel = new Label();
            statusBar1.AddContent(statusBarLabel, Dock.Right);
            StatusBar = statusBar1;

            AddContent(panel1);
        }
Exemplo n.º 7
0
        private void InitializeComponent()
        {
            WindowState = ControlState.Maximized;
            Background  = Color.Black;

            mainMenu1            = new MainMenu();
            fileMenuItem         = new MenuItem("File");
            newMenuItem          = new MenuItem("&New");
            newMenuItem.OnClick += NewMenuItemClick;
            fileMenuItem.Items.Add(newMenuItem);

            openMenuItem          = new MenuItem("&Open…");
            openMenuItem.OnClick += OpenMenuItemClick;
            fileMenuItem.Items.Add(openMenuItem);

            fileMenuItem.Items.Add(new SeparatorMenuItem());

            saveMenuItem          = new MenuItem("&Save", null, enabled: false);
            saveMenuItem.OnClick += SaveMenuItemClick;
            fileMenuItem.Items.Add(saveMenuItem);

            saveAsMenuItem          = new MenuItem("Save &as…", null, enabled: false);
            saveAsMenuItem.OnClick += SaveAsMenuItemClick;
            fileMenuItem.Items.Add(saveAsMenuItem);

            fileMenuItem.Items.Add(new SeparatorMenuItem());

            exitMenuItem          = new MenuItem("E&xit");
            exitMenuItem.OnClick += ExitMenuItemClick;
            fileMenuItem.Items.Add(exitMenuItem);

            mainMenu1.Items.Add(fileMenuItem);

            editMenuItem          = new MenuItem("Edit");
            wallMenuItem          = new MenuItem("Wall", new Shortcut(ConsoleKey.D1), enabled: false);
            wallMenuItem.OnClick += MazeItemClick;
            wallMenuItem.Tag      = MapItem.Wall;
            editMenuItem.Items.Add(wallMenuItem);

            startMenuItem          = new MenuItem("Start point", new Shortcut(ConsoleKey.D2), enabled: false);
            startMenuItem.OnClick += MazeItemClick;
            startMenuItem.Tag      = MapItem.StartPoint;
            editMenuItem.Items.Add(startMenuItem);

            endMenuItem          = new MenuItem("End point", new Shortcut(ConsoleKey.D3), enabled: false);
            endMenuItem.OnClick += MazeItemClick;
            endMenuItem.Tag      = MapItem.EndPoint;
            editMenuItem.Items.Add(endMenuItem);

            doorMenuItem          = new MenuItem("Door", new Shortcut(ConsoleKey.D4), enabled: false);
            doorMenuItem.OnClick += MazeItemClick;
            doorMenuItem.Tag      = MapItem.Door;
            editMenuItem.Items.Add(doorMenuItem);

            keyMenuItem          = new MenuItem("Key", new Shortcut(ConsoleKey.D5), enabled: false);
            keyMenuItem.OnClick += MazeItemClick;
            keyMenuItem.Tag      = MapItem.Key;
            editMenuItem.Items.Add(keyMenuItem);

            tenCoinsMenuItem          = new MenuItem("10 coins", new Shortcut(ConsoleKey.D6), enabled: false);
            tenCoinsMenuItem.OnClick += MazeItemClick;
            tenCoinsMenuItem.Tag      = MapItem.TenCoins;
            editMenuItem.Items.Add(tenCoinsMenuItem);

            twentyCoinsMenuItem          = new MenuItem("20 coins", new Shortcut(ConsoleKey.D7), enabled: false);
            twentyCoinsMenuItem.OnClick += MazeItemClick;
            twentyCoinsMenuItem.Tag      = MapItem.TwentyCoins;
            editMenuItem.Items.Add(twentyCoinsMenuItem);

            editMenuItem.Items.Add(new SeparatorMenuItem());
            generateMenuItem          = new MenuItem("Generate", new Shortcut(ConsoleKey.G, false, true, false), enabled: false);
            generateMenuItem.OnClick += GenerateClick;
            editMenuItem.Items.Add(generateMenuItem);

            editMenuItem.Items.Add(new SeparatorMenuItem());
            clearMazeMenuItem          = new MenuItem("Clear maze", null, enabled: false);
            clearMazeMenuItem.OnClick += ClearMazeClick;
            editMenuItem.Items.Add(clearMazeMenuItem);

            editMenuItem.Items.Add(new SeparatorMenuItem());
            checkPathMenuItem          = new MenuItem("Check path", new Shortcut(ConsoleKey.P, false, true, false), enabled: false);
            checkPathMenuItem.OnClick += CheckPathClick;
            editMenuItem.Items.Add(checkPathMenuItem);

            mainMenu1.Items.Add(editMenuItem);
            MainMenu = mainMenu1;

            statusBar1 = new StatusBar();
            statusBar1.AddHelpButton();
            StatusBar = statusBar1;

            panel1 = new Panel()
            {
                VerticalContentAlignment   = VerticalAlignment.Center,
                HorizontalContentAlignment = HorizontalAlignment.Center,
            };

            label1 = new Label(
                "Welcome to the maze map editor. Use main menu (Alt+F1) for create new (Alt-N) maze map or open (Alt-O) exist file of map")
            {
                Foreground    = Color.DarkGray,
                Width         = Math.Min(65, Application.Environment.WindowWidth - 4),
                WordWrap      = true,
                TextAlignment = TextAlignment.Center,
            };
            panel1.AddContent(label1);

            statusPositionLabel  = new Label();
            statusDimensionLabel = new Label();
            statusMazeItemLabel  = new Label();
            statusSaveLabel      = new Label("●");
            AddContent(panel1);
        }