From 703a777878cb84a59e1eb98926e81e0e223b1d0b Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 5 Mar 2007 22:06:07 -0800 Subject: [PATCH] menu system: make the help message end row a configurable. --- README.menu | 6 +++++- com32/modules/menumain.c | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.menu b/README.menu index 9852629..18e93c6 100644 --- a/README.menu +++ b/README.menu @@ -259,14 +259,18 @@ MENU PASSWORDMARGIN 3 MENU ROWS 12 MENU TABMSGROW 18 MENU CMDLINEROW 18 -MENU ENDROW 24 +MENU ENDROW -1 MENU PASSWORDROW 11 MENU TIMEOUTROW 20 MENU HELPMSGROW 22 +MENU HELPMSGENDROW -1 These options control the layout of the menu on the screen. The values above are the defaults. + A negative value is relative to the calculated length of the + screen (25 for text mode, 28 for VESA graphics mode.) + The menu system honours the TIMEOUT command; if TIMEOUT is specified it will execute the ONTIMEOUT command if one exists, otherwise it will diff --git a/com32/modules/menumain.c b/com32/modules/menumain.c index e44207d..342e587 100644 --- a/com32/modules/menumain.c +++ b/com32/modules/menumain.c @@ -92,6 +92,7 @@ struct menu_parameter mparm[] = { { "passwordrow", 11 }, { "timeoutrow", 20 }, { "helpmsgrow", 22 }, + { "helpmsgendrow", -1 }, { NULL, 0 } }; @@ -105,6 +106,7 @@ struct menu_parameter mparm[] = { #define PASSWD_ROW mparm[7].value #define TIMEOUT_ROW mparm[8].value #define HELPMSG_ROW mparm[9].value +#define HELPMSGEND_ROW mparm[10].value static void install_default_color_table(void) @@ -422,7 +424,7 @@ display_help(const char *text) printf("\1#16\033[%d;1H", HELPMSG_ROW); } - for (p = text, row = HELPMSG_ROW; *p && row < END_ROW; p++) { + for (p = text, row = HELPMSG_ROW; *p && row <= HELPMSGEND_ROW; p++) { switch (*p) { case '\r': case '\f': @@ -439,7 +441,7 @@ display_help(const char *text) fputs("\033[K", stdout); - while (row < END_ROW) { + while (row <= HELPMSGEND_ROW) { printf("\033[K\033[%d;1H", ++row); } } -- 2.7.4