예제 #1
0
        protected override bool ProcessKeyPressed(AsciiKey key)
        {
            switch (key.Key)
            {
            case Keys.B:
                BrowseEditor?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.Escape:
                Exit?.Invoke(this, EventArgs.Empty);
                return(true);
            }

            return(base.ProcessKeyPressed(key));
        }
예제 #2
0
        private void InitializeControls()
        {
            browseForLauncherButton = new StandardButton(20)
            {
                Position = new Point(2, 6),
                Text     = "[B] Browse"
            };
            browseForLauncherButton.Click += (sender, args) => BrowseEditor?.Invoke(this, EventArgs.Empty);
            Add(browseForLauncherButton);

            closeButton = new StandardButton(20)
            {
                Position = new Point(2, Height - 4),
                Text     = "[ESC] Close"
            };
            closeButton.Click += (sender, args) => Exit?.Invoke(this, EventArgs.Empty);
            Add(closeButton);

            prevFontSizeButton = new Button(1)
            {
                Position = new Point(13, 10),
                Text     = "<",
                CanFocus = false,
            };
            prevFontSizeButton.Click += (sender, args) => DecreaseFontSize?.Invoke(this, EventArgs.Empty);
            Add(prevFontSizeButton);

            nextFontSizeButton = new Button(1)
            {
                Position = new Point(21, 10),
                Text     = ">",
                CanFocus = false
            };
            nextFontSizeButton.Click += (sender, args) => IncreaseFontSize?.Invoke(this, EventArgs.Empty);
            Add(nextFontSizeButton);
        }