Working navigation on main screen for higlights

This commit is contained in:
Mike C 2013-04-06 20:52:37 -04:00
parent 06c9588b35
commit 171bf68d36
2 changed files with 14 additions and 8 deletions

View file

@ -30,11 +30,17 @@ UILCD::UILCD() {
} }
void UILCD::startUI() { void UILCD::startUI() {
splashScreen(); drawSplashScreen();
mainScreen(); drawMainScreen();
} }
void UILCD::handleJoystickEvent(joyDirection direction) { void UILCD::handleJoystickEvent(joyDirection direction) {
if (DEBUG) {
Serial.println("begin UILCD::handleJoystickEvent");
Serial.print("Current Screen: ");
Serial.println(currentScreen);
}
switch (currentScreen) { switch (currentScreen) {
case 1: // enum screen -> mainScreen case 1: // enum screen -> mainScreen
mainScreenHilight(direction); mainScreenHilight(direction);
@ -44,8 +50,7 @@ void UILCD::handleJoystickEvent(joyDirection direction) {
void UILCD::unHilightLine(int line) { void UILCD::unHilightLine(int line) {
tft->setCursor(0, line * FONT_HEIGHT); tft->setCursor(0, line * FONT_HEIGHT);
tft->setTextColor(HILIGHT); tft->fillRect(0, line * FONT_HEIGHT, FONT_WIDTH, FONT_HEIGHT, BACKGROUND);
tft->print(" ");
} }
void UILCD::hilightLine(int line) { void UILCD::hilightLine(int line) {
@ -90,7 +95,8 @@ void UILCD::mainScreenHilight(joyDirection direction) {
} }
} }
void UILCD::mainScreen() { void UILCD::drawMainScreen() {
currentScreen = mainScreen;
previousLine = 0; previousLine = 0;
tft->fillScreen(BACKGROUND); tft->fillScreen(BACKGROUND);
@ -114,7 +120,7 @@ void UILCD::mainScreen() {
hilightLine(0); hilightLine(0);
} }
void UILCD::splashScreen() { void UILCD::drawSplashScreen() {
tft->fillScreen(SPLASH_BACKGROUND); tft->fillScreen(SPLASH_BACKGROUND);
bmpDraw("splash.bmp", 13, 0); bmpDraw("splash.bmp", 13, 0);
delay(1250); delay(1250);

View file

@ -38,8 +38,8 @@ private:
uint32_t read32(File f); uint32_t read32(File f);
uint16_t read16(File f); uint16_t read16(File f);
void splashScreen(); void drawSplashScreen();
void mainScreen(); void drawMainScreen();
void hilightLine(int line); void hilightLine(int line);
void unHilightLine(int line); void unHilightLine(int line);
void mainScreenHilight(joyDirection direction); void mainScreenHilight(joyDirection direction);