void WayParam::print() const { m_lcd->setCursor(0, 0); if (m_goLeft) { printArrow("<<<"); } else { printArrow(">>>"); } }
//update the little arrow (cursor) as the user pushes the thumbstick void menuDisplay::updateCursor(){ byte lastRow; if (nMenuRows>_lcdRows){ lastRow=_lcdRows; } else { lastRow=nMenuRows; } //clear arrow position row for (byte ii=0; ii<_lcdRows; ii++){ lcd->setCursor(0,ii); lcd->print(" "); } //If arrow is within bounds we print it if (_arrowPos>=0 && _arrowPos<lastRow){ printArrow(); return; } //If arrow has moved beyond the lowest menu row but this isn't the lowest //lcd row, then don't allow arrow beyond this point. if (_arrowPos>=lastRow && lastRow<_lcdRows){ _arrowPos=lastRow-1; printArrow(); return; } //If arrow has gone beyond the top row, we keep it at top row if (_arrowPos < 0){ _arrowPos=0; printArrow(); if (_currentTopRow>0){ //If scroll upwards if required _currentTopRow--; refreshScreen(); } return; } //If arrow has gone beyond the bottom lcd row, we keep it at bottom row if (_arrowPos>=_lcdRows){ _arrowPos=_lcdRows-1; printArrow(); if (nMenuRows-_lcdRows-_currentTopRow > 0){ //If there are more rows to go we scroll down _currentTopRow++; refreshScreen(); } return; } } //void updateCursor
void InboundRadioNodeMenu::Init() { AbstractState::Init(); if (!initialized) { numberOfNodes = Settings::GetInboundRadioNodes(nodes); initialized = true; } printArrow(); printMenu(); }
AbstractState* SettingsMenu::Up() { resetTime(); if (cursorIndex > 0) { cursorIndex--; if (cursorIndex < firstRowIndex) { firstRowIndex--; printMenu(); } printArrow(); } return NULL; }
AbstractState* InboundRadioNodeMenu::Down() { resetTime(); if (cursorIndex < numberOfNodes+1) { if (cursorIndex > firstRowIndex) { firstRowIndex++; } cursorIndex++; printArrow(); printMenu(); } return NULL; }
AbstractState* InboundRadioNodeMenu::Up() { resetTime(); if (cursorIndex > 0) { cursorIndex--; if (cursorIndex < firstRowIndex) { firstRowIndex--; } printArrow(); printMenu(); } return NULL; }
AbstractState* SettingsMenu::Down() { resetTime(); #ifdef IS_RELAY_MODULE #define NUMBER_OF_MENUITEMS 10 #endif #ifdef IS_STATION_MODULE #define NUMBER_OF_MENUITEMS 7 #endif if (cursorIndex < NUMBER_OF_MENUITEMS-1) { if (cursorIndex > firstRowIndex) { firstRowIndex++; printMenu(); } cursorIndex++; printArrow(); } return NULL; }
void SettingsMenu::Init() { AbstractState::Init(); printMenu(); printArrow(); }