Commit 44b7ae54 authored by rswindell's avatar rswindell
Browse files

Remove the F6 Paste option from the bottom-line (status bar) when not

applicable.
parent 04870576
......@@ -678,23 +678,32 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
tbrdrwidth=0;
bbrdrwidth=0;
}
/* Count the options */
while (option != NULL && opts < MAX_OPTS) {
if (option[opts] == NULL || option[opts][0] == 0)
break;
else opts++;
}
if (mode&WIN_XTR && opts<MAX_OPTS)
opts++;
/* Sanity-check the savnum */
if(mode&WIN_SAV && api->savnum>=MAX_BUFS-1)
putch(7);
/* Create the status bar/bottom-line */
if(api->helpbuf!=NULL || api->helpixbfile[0]!=0) bline|=BL_HELP;
if(mode&WIN_INS) bline|=BL_INS;
if(mode&WIN_DEL) bline|=BL_DEL;
if(mode&WIN_GET) bline|=BL_GET;
if(mode&WIN_PUT) bline|=BL_PUT;
if(mode&WIN_EDIT) bline|=BL_EDIT;
if(api->bottomline != NULL)
api->bottomline(bline);
while(option!=NULL && opts<MAX_OPTS)
if(option[opts]==NULL || option[opts][0]==0)
break;
else opts++;
if(mode&WIN_XTR && opts<MAX_OPTS)
opts++;
if (api->bottomline != NULL) {
if ((mode&(WIN_XTR | WIN_PASTEXTR)) == WIN_XTR && (*cur) == opts - 1)
api->bottomline(bline & ~BL_PUT);
else
api->bottomline(bline);
}
optheight=opts+vbrdrsize;
height=optheight;
if(mode&WIN_FIXEDHEIGHT) {
......@@ -714,7 +723,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
}
}
}
/* Determine minimum widths here to accomodate mouse "icons" in border */
/* Determine minimum widths here to accommodate mouse "icons" in border */
if(!(mode&WIN_NOBRDR) && api->mode&UIFC_MOUSE) {
if(bline&BL_HELP && width<8)
width=8;
......@@ -1596,7 +1605,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
return((*cur) | MSK_PASTE_INSERT);
break;
case CIO_KEY_F(6): /* F6 - Paste-Over */
if(mode&WIN_PUT && (mode&WIN_PASTEXTR || !(mode&WIN_PASTEXTR && (*cur)==opts-1)))
if(mode&WIN_PUT && (mode&WIN_PASTEXTR || !(mode&WIN_XTR && (*cur)==opts-1)))
return((*cur)|MSK_PASTE_OVER);
break;
case CIO_KEY_IC: /* insert */
......@@ -1815,6 +1824,13 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
return(-2-gotkey);
}
}
/* Update the status bar to reflect the Put/Paste option applicability */
if (bline&BL_PUT && api->bottomline != NULL) {
if ((mode&(WIN_XTR | WIN_PASTEXTR)) == WIN_XTR && (*cur) == opts - 1)
api->bottomline(bline & ~BL_PUT);
else
api->bottomline(bline);
}
}
else
mswait(1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment