silently restrict all boxes to LINES, COLS
This commit is contained in:
parent
053efb2d12
commit
852ffa1977
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user