summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Hak <adiamas@rockbox.org>2002-05-03 06:00:54 +0000
committerRobert Hak <adiamas@rockbox.org>2002-05-03 06:00:54 +0000
commit735095751699a8594e2fc0e9fc37cf7d25fe3830 (patch)
tree6ede3322f4d063ef3170f8052fa51c067eec6b51
parent9433a8e7bf5a50cbd3c59262eee8fee3e1a6b5d6 (diff)
Fixed stupid error with cursor positioning on return from an app.
By request, cursor remains at last menu item selected upon return from that sub-menu git-svn-id: svn://svn.rockbox.org/rockbox/trunk@397 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/app.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/uisimulator/app.c b/uisimulator/app.c
index d6d12451b8..40370de375 100644
--- a/uisimulator/app.c
+++ b/uisimulator/app.c
@@ -62,7 +62,6 @@ void menu_init(void)
add_menu_item(ITEM_TETRIS, "Tetris");
lcd_puts(8, 38, "Rockbox!", 2);
- put_cursor(0, 0);
}
/* Move the cursor to a particular id */
@@ -79,6 +78,7 @@ void app_main(void)
int cursor = 0;
menu_init();
+ cursor = put_cursor(menu_top, menu_top);
while(1) {
key = button_get();
@@ -87,15 +87,14 @@ void app_main(void)
sleep(1);
continue;
}
+
switch(key) {
case BUTTON_UP:
if(cursor == menu_top ){
/* wrap around to menu bottom */
- printf("from (%d) to (%d)\n", cursor, menu_bottom);
cursor = put_cursor(cursor, menu_bottom);
} else {
/* move up */
- printf("from (%d) to (%d)\n", cursor, cursor-1);
cursor = put_cursor(cursor, cursor-1);
}
break;
@@ -125,13 +124,24 @@ void app_main(void)
case ITEM_SCREENSAVER:
screensaver();
break;
+ default:
+ continue;
}
/* Return to previous display state */
lcd_clear_display();
menu_init();
+ cursor = put_cursor(cursor, cursor);
+ break;
+ case BUTTON_OFF:
+ return;
+ default:
break;
}
+
lcd_update();
}
}
+
+
+