corrected the curson not being drawn for the recorder

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@814 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Hak 2002-05-30 08:06:42 +00:00
parent 00c6f5136f
commit c501ac7be2
2 changed files with 18 additions and 7 deletions

View file

@ -55,6 +55,10 @@ static void menu_draw(int m)
i++) { i++) {
lcd_puts(1, i-menus[m].top, menus[m].items[i].desc); lcd_puts(1, i-menus[m].top, menus[m].items[i].desc);
} }
/* place the cursor */
lcd_puts(0, menus[m].cursor - menus[m].top, "-");
lcd_update(); lcd_update();
} }
@ -64,18 +68,27 @@ static void menu_draw(int m)
*/ */
static void put_cursor(int m, int target) static void put_cursor(int m, int target)
{ {
bool do_update = true;
lcd_puts(0, menus[m].cursor - menus[m].top, " "); lcd_puts(0, menus[m].cursor - menus[m].top, " ");
menus[m].cursor = target;
if ( target < menus[m].top ) { if ( target < menus[m].top ) {
menus[m].top--; menus[m].top--;
menu_draw(m); menu_draw(m);
do_update = false;
} }
else if ( target-menus[m].top > MENU_LINES-1 ) { else if ( target-menus[m].top > MENU_LINES-1 ) {
menus[m].top++; menus[m].top++;
menu_draw(m); menu_draw(m);
do_update = false;
} }
menus[m].cursor = target;
if (do_update) {
lcd_puts(0, menus[m].cursor - menus[m].top, "-"); lcd_puts(0, menus[m].cursor - menus[m].top, "-");
lcd_update();
}
} }
int menu_init(struct menu_items* mitems, int count) int menu_init(struct menu_items* mitems, int count)
@ -108,7 +121,6 @@ void menu_exit(int m)
void menu_run(int m) void menu_run(int m)
{ {
menu_draw(m); menu_draw(m);
lcd_puts(0, menus[m].cursor - menus[m].top, "-");
while(1) { while(1) {
switch( button_get(true) ) { switch( button_get(true) ) {
@ -145,7 +157,6 @@ void menu_run(int m)
/* Return to previous display state */ /* Return to previous display state */
menu_draw(m); menu_draw(m);
lcd_puts(0, menus[m].cursor - menus[m].top, "-");
break; break;
#ifdef HAVE_RECORDER_KEYPAD #ifdef HAVE_RECORDER_KEYPAD