menu system: make the help message end row a configurable. syslinux-3.40-pre11
authorH. Peter Anvin <hpa@zytor.com>
Tue, 6 Mar 2007 06:06:07 +0000 (22:06 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 6 Mar 2007 06:06:07 +0000 (22:06 -0800)
README.menu
com32/modules/menumain.c

index 9852629..18e93c6 100644 (file)
@@ -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
index e44207d..342e587 100644 (file)
@@ -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);
   }
 }