From bd6267e616cc4966fadf971019fe15db2469e97d Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 25 Dec 2010 02:52:55 +0200 Subject: menu: add most options --- frontend/common/menu.c | 7 +++++-- frontend/common/menu.h | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'frontend/common') diff --git a/frontend/common/menu.c b/frontend/common/menu.c index a571ddd..d9717d4 100644 --- a/frontend/common/menu.c +++ b/frontend/common/menu.c @@ -461,8 +461,11 @@ static void me_draw(const menu_entry *entries, int sel, void (*draw_more)(void)) h = g_menuscreen_h; } - x = g_menuscreen_w / 2 - w / 2; + x = g_menuscreen_w / 2 - w / 2; y = g_menuscreen_h / 2 - h / 2; +#ifdef MENU_ALIGN_LEFT + if (x > 12) x = 12; +#endif /* draw */ menu_draw_begin(1); @@ -511,7 +514,7 @@ static void me_draw(const menu_entry *entries, int sel, void (*draw_more)(void)) len = strlen(names[i]); if (len > 10) offs = 10 - len - 2; - if (i == *(int *)ent->var) { + if (i == *(unsigned char *)ent->var) { text_out16(x + col2_offs + offs * me_mfont_w, y, "%s", names[i]); break; } diff --git a/frontend/common/menu.h b/frontend/common/menu.h index 21c589e..8260e51 100644 --- a/frontend/common/menu.h +++ b/frontend/common/menu.h @@ -29,12 +29,18 @@ typedef struct const char *help; } menu_entry; +#define mee_handler_id_h(name, id, handler, help) \ + { name, MB_NONE, id, NULL, 0, 0, 0, 1, 0, 1, handler, NULL, NULL, help } + #define mee_handler_id(name, id, handler) \ - { name, MB_NONE, id, NULL, 0, 0, 0, 1, 0, 1, handler, NULL, NULL, NULL } + mee_handler_id_h(name, id, handler, NULL) #define mee_handler(name, handler) \ mee_handler_id(name, MA_NONE, handler) +#define mee_handler_h(name, handler, help) \ + mee_handler_id_h(name, MA_NONE, handler, help) + #define mee_label(name) \ { name, MB_NONE, MA_NONE, NULL, 0, 0, 0, 1, 0, 0, NULL, NULL, NULL, NULL } -- cgit v1.2.3