bugfix: ignore hidden menus also when a menuitem is

selected from a menu via key Enter
This commit is contained in:
boercher
2005-06-01 22:45:43 +00:00
parent 902088872f
commit 3a6244a9d0
2 changed files with 11 additions and 9 deletions
+8 -1
View File
@@ -64,7 +64,6 @@ menu_get_subitem(Menu * menu, int index)
return NULL; return NULL;
} }
static int static int
menu_visible_item_count(Menu * menu) menu_visible_item_count(Menu * menu)
{ {
@@ -178,6 +177,13 @@ menu_destroy_all_items (Menu *menu)
} }
} }
MenuItem *menu_get_current_item (Menu *menu)
{
return (MenuItem*) ((menu != NULL)
? menu_get_subitem(menu, menu->data.menu.selector_pos)
: NULL);
}
MenuItem *menu_find_item (Menu *menu, char *id, bool recursive) MenuItem *menu_find_item (Menu *menu, char *id, bool recursive)
{ {
MenuItem * item; MenuItem * item;
@@ -420,6 +426,7 @@ void menu_update_screen (MenuItem *menu, Screen *s)
else { else {
/* Limit string length and add ringstring */ /* Limit string length and add ringstring */
p = LL_GetByIndex (subitem->data.ring.strings, subitem->data.ring.value); p = LL_GetByIndex (subitem->data.ring.strings, subitem->data.ring.value);
assert(p != NULL);
if (strlen(p) > display_props->width - 3) { if (strlen(p) > display_props->width - 3) {
short a = display_props->width - 3; short a = display_props->width - 3;
/* We need to limit the ring string and DON'T /* We need to limit the ring string and DON'T
+3 -8
View File
@@ -78,14 +78,9 @@ static inline MenuItem *menu_getnext_item (Menu *menu)
: NULL); : NULL);
} }
/** Retrieves the current item from the list of items in the menu. */ /** Retrieves the current (non-hidden) item from the list of items in the
static inline MenuItem *menu_get_current_item (Menu *menu) * menu. */
{ MenuItem *menu_get_current_item (Menu *menu);
return (MenuItem*) ((menu != NULL)
? LL_GetByIndex(menu->data.menu.contents,
menu->data.menu.selector_pos)
: NULL);
}
/** Finds an item in the menu by the given id. */ /** Finds an item in the menu by the given id. */
MenuItem *menu_find_item (Menu *menu, char *id, bool recursive); MenuItem *menu_find_item (Menu *menu, char *id, bool recursive);