Example #1
0
        public bool onKeyPress(ConsoleKeyInfo PressedKey)
        {
            if (PressedKey.Modifiers == ConsoleModifiers.Control && PressedKey.Key == ConsoleKey.W)
            {
                Close(); return(false);
            }
            switch (HighlightedElement.OnKeyPress(PressedKey))
            {
            case KeyPressReturn.NOTHING:
                break;

            case KeyPressReturn.NEXT_ELEMENT:
                if (HighlightedElement.GetNextElement() != null)
                {
                    HighlightedElement.setHighlighted(false);
                    HighlightedElement = HighlightedElement.GetNextElement();
                    HighlightedElement.setHighlighted(true);
                }
                break;

            case KeyPressReturn.PREV_ELEMENT:
                if (HighlightedElement.GetPrevElement() != null)
                {
                    HighlightedElement.setHighlighted(false);
                    HighlightedElement = HighlightedElement.GetPrevElement();
                    HighlightedElement.setHighlighted(true);
                }
                break;

            case KeyPressReturn.CLOSE:
                Close(); return(false);

            default:
                break;
            }
            return(true);
        }
Example #2
0
 public void SetPrevElement(WindowElement PrevElement)
 {
     this.PreviousElement = PrevElement;
 }
Example #3
0
 public void SetNextElement(WindowElement NextElement)
 {
     this.NextElement = NextElement;
 }