int flags; /* window flags */
xchar type; /* type of window */
boolean active; /* true if window is active */
- uchar offx, offy; /* offset from topleft of display */
+ short offx, offy; /* offset from topleft of display */
short rows, cols; /* dimensions */
short curx, cury; /* current cursor position */
short maxrow, maxcol; /* the maximum size used -- for MENU wins */
/* descriptor for tty-based displays -- all the per-display data */
struct DisplayDesc {
- uchar rows, cols; /* width and height of tty display */
- uchar curx, cury; /* current cursor position on the screen */
+ short rows, cols; /* width and height of tty display */
+ short curx, cury; /* current cursor position on the screen */
#ifdef TEXTCOLOR
int color; /* current color */
#endif
n = 0;
}
tty_curs(window, 1, n++);
- if (cw->offx) cl_end();
+ cl_end();
if (cw->data[i]) {
attr = cw->data[i][0] - 1;
if (cw->offx) {
}
}
if (i == cw->maxrow) {
+ if(cw->type == NHW_TEXT){
+ tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1);
+ cl_eos();
+ }
tty_curs(BASE_WINDOW, (int)cw->offx + 1,
(cw->type == NHW_TEXT) ? (int) ttyDisplay->rows - 1 : n);
cl_end();
/*FALLTHRU*/
case NHW_MENU:
cw->active = 1;
- /* avoid converting to uchar before calculations are finished */
- cw->offx = (uchar) (int)
- max((int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1));
+ cw->offx = (cw->type==NHW_TEXT)
+ ? 0
+ : min(10, ttyDisplay->cols - cw->maxcol - 1);
if(cw->type == NHW_MENU)
cw->offy = 0;
if(ttyDisplay->toplin == 1)
tty_display_nhwindow(WIN_MESSAGE, TRUE);
- if(cw->offx == 10 || cw->maxrow >= (int) ttyDisplay->rows) {
+ if(cw->maxrow >= (int) ttyDisplay->rows) {
cw->offx = 0;
if(cw->offy) {
tty_curs(window, 1, 0);
}
if (len > (int)ttyDisplay->cols) {
- /* truncate the prompt if its too long for the screen */
+ /* truncate the prompt if it's too long for the screen */
if (cw->npages <= 1) /* only str in single page case */
cw->morestr[ttyDisplay->cols] = 0;
len = ttyDisplay->cols;