silently restrict all boxes to LINES, COLS

This commit is contained in:
Andrey A. Chernov 1994-11-18 22:49:09 +00:00
parent 053efb2d12
commit 852ffa1977
8 changed files with 32 additions and 0 deletions

View File

@ -70,6 +70,10 @@ int dialog_checklist(unsigned char *title, unsigned char *prompt, int height, in
width = MAX(width,check_x+4)+4;
}
if (width > COLS)
width = COLS;
if (height > LINES)
height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;

View File

@ -41,6 +41,10 @@ int dialog_inputbox(unsigned char *title, unsigned char *prompt, int height, int
width = MAX(i,j) + 4;
}
if (width > COLS)
width = COLS;
if (height > LINES)
height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;

View File

@ -60,6 +60,10 @@ int dialog_menu(unsigned char *title, unsigned char *prompt, int height, int wid
width = MAX(width,tag_x+4)+4;
}
if (width > COLS)
width = COLS;
if (height > LINES)
height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;

View File

@ -40,6 +40,10 @@ int dialog_msgbox(unsigned char *title, unsigned char *prompt, int height, int w
width = MAX(i,j)+4;
}
if (width > COLS)
width = COLS;
if (height > LINES)
height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;

View File

@ -39,6 +39,10 @@ int dialog_prgbox(unsigned char *title, const unsigned char *line, int height, i
fprintf(stderr, "\nAutosizing is impossible in dialog_prgbox().\n");
exit(-1);
}
if (width > COLS)
width = COLS;
if (height > LINES)
height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;

View File

@ -78,6 +78,10 @@ int dialog_radiolist(unsigned char *title, unsigned char *prompt, int height, in
width = MAX(width,check_x+4)+4;
}
if (width > COLS)
width = COLS;
if (height > LINES)
height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;

View File

@ -89,6 +89,10 @@ int dialog_textbox(unsigned char *title, unsigned char *file, int height, int wi
buf[bytes_read] = '\0'; /* mark end of valid data */
page = buf; /* page is pointer to start of page to be displayed */
if (width > COLS)
width = COLS;
if (height > LINES)
height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;

View File

@ -39,6 +39,10 @@ int dialog_yesno(unsigned char *title, unsigned char * prompt, int height, int w
width = MAX(i,j)+4;
}
if (width > COLS)
width = COLS;
if (height > LINES)
height = LINES;
/* center dialog box on screen */
x = (COLS - width)/2;
y = (LINES - height)/2;