private void Init(ITextDisplay display, IRotaryEncoder encoder, IButton buttonNext, IButton buttonPrevious, IButton buttonSelect, MenuPage menuTree)
        {
            if (encoder != null)
            {
                _encoder = encoder;
            }
            else if (buttonNext != null && buttonPrevious != null)
            {
                _buttonPrevious = buttonPrevious;
                _buttonNext     = buttonNext;
            }
            else
            {
                throw new ArgumentNullException("Must have either a Rotary Encoder or Next/Previous buttons");
            }

            _display      = display;
            _buttonSelect = buttonSelect;
            _rootMenuPage = menuTree;
            _menuLevel    = new Stack();

            // Save our custom characters
            _display.SaveCustomCharacter(TextCharacters.RightArrow.CharMap, TextCharacters.RightArrow.MemorySlot);
            _display.SaveCustomCharacter(TextCharacters.RightArrowSelected.CharMap, TextCharacters.RightArrow.MemorySlot);
            _display.SaveCustomCharacter(TextCharacters.BoxSelected.CharMap, TextCharacters.BoxSelected.MemorySlot);
        }
Exemple #2
0
        private void Init(ITextDisplay display, MenuPage menuTree)
        {
            this.display = display;

            rootMenuPage = menuTree;
            menuLevel    = new Stack();

            // Save our custom characters
            // ToDo
            display.SaveCustomCharacter(TextCharacters.RightArrow.CharMap, TextCharacters.RightArrow.MemorySlot);
            display.SaveCustomCharacter(TextCharacters.RightArrowSelected.CharMap, TextCharacters.RightArrow.MemorySlot);
            display.SaveCustomCharacter(TextCharacters.BoxSelected.CharMap, TextCharacters.BoxSelected.MemorySlot);
        }
Exemple #3
0
        private void Init(ITextDisplay display, MenuPage menuPage)
        {
            //good here
            this.display = display;

            rootMenuPage = menuPage;

            pageStack = new Stack <IPage>();

            // Save our custom characters
            // ToDo
            display.SaveCustomCharacter(TextCharacters.RightArrow.CharMap, TextCharacters.RightArrow.MemorySlot);
            display.SaveCustomCharacter(TextCharacters.RightArrowSelected.CharMap, TextCharacters.RightArrow.MemorySlot);
            display.SaveCustomCharacter(TextCharacters.BoxSelected.CharMap, TextCharacters.BoxSelected.MemorySlot);
        }
Exemple #4
0
        private void Init(ITextDisplay display, RotaryEncoderWithButton encoder, MenuPage menuTree)
        {
            _display = display;
            _encoder = encoder;

            _rootMenuPage = menuTree;
            UpdatedCurrentMenuPage();
            RenderCurrentMenuPage();
            _menuLevel = new Stack();

            _encoder.Rotated += HandlEncoderRotation;
            _encoder.Clicked += HandleEncoderClick;

            // Save our custom characters
            _display.SaveCustomCharacter(TextCharacters.RightArrow.CharMap, TextCharacters.RightArrow.MemorySlot);
            _display.SaveCustomCharacter(TextCharacters.RightArrowSelected.CharMap, TextCharacters.RightArrow.MemorySlot);
            _display.SaveCustomCharacter(TextCharacters.BoxSelected.CharMap, TextCharacters.BoxSelected.MemorySlot);
        }