Commit 7473b8e8 authored by rswindell's avatar rswindell
Browse files

Terminology update (GET -> COPY, PUT -> PASTE).

Added Cut and Paste-Insert support to stdio version of UIFC.
parent fa9e35bf
......@@ -206,11 +206,11 @@
/* And ungets the mouse event. */
#define K_PASSWORD (1L<<16) /* Does not display text while editing */
/* Bottom line elements */
/* Bottom line elements */
#define BL_INS (1<<0) /* INS key */
#define BL_DEL (1<<1) /* DEL key */
#define BL_GET (1<<2) /* Get key */
#define BL_PUT (1<<3) /* Put key */
#define BL_COPY (1<<2) /* Copy operation */
#define BL_PASTE (1<<3) /* Paste operation */
#define BL_EDIT (1<<4) /* Edit key */
#define BL_HELP (1<<5) /* Help key */
......
......@@ -695,12 +695,12 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
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_COPY) bline|=BL_COPY;
if(mode&WIN_PASTE) bline|=BL_PASTE;
if(mode&WIN_EDIT) bline|=BL_EDIT;
if (api->bottomline != NULL) {
if ((mode&(WIN_XTR | WIN_PASTEXTR)) == WIN_XTR && (*cur) == opts - 1)
api->bottomline(bline & ~BL_PUT);
api->bottomline(bline & ~BL_PASTE);
else
api->bottomline(bline);
}
......@@ -1593,19 +1593,19 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
break;
case CIO_KEY_F(5): /* F5 - Copy */
case CIO_KEY_CTRL_IC: /* Ctrl-Insert */
if(mode&WIN_GET && !(mode&WIN_XTR && (*cur)==opts-1))
if(mode&WIN_COPY && !(mode&WIN_XTR && (*cur)==opts-1))
return((*cur)|MSK_GET);
break;
case CIO_KEY_SHIFT_DC: /* Shift-Del: Cut */
if(mode&WIN_GET && !(mode&WIN_XTR && (*cur) == opts - 1))
if(mode&WIN_COPY && !(mode&WIN_XTR && (*cur) == opts - 1))
return((*cur) | MSK_CUT);
break;
case CIO_KEY_SHIFT_IC: /* Shift-Insert: Paste-Insert */
if(mode&WIN_PUT)
if(mode&WIN_PASTE)
return((*cur) | MSK_PASTE_INSERT);
break;
case CIO_KEY_F(6): /* F6 - Paste-Over */
if(mode&WIN_PUT && (mode&WIN_PASTEXTR || !(mode&WIN_XTR && (*cur)==opts-1)))
if(mode&WIN_PASTE && (mode&WIN_PASTEXTR || !(mode&WIN_XTR && (*cur)==opts-1)))
return((*cur)|MSK_PASTE_OVER);
break;
case CIO_KEY_IC: /* insert */
......@@ -1825,9 +1825,9 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
}
}
/* Update the status bar to reflect the Put/Paste option applicability */
if (bline&BL_PUT && api->bottomline != NULL) {
if (bline&BL_PASTE && api->bottomline != NULL) {
if ((mode&(WIN_XTR | WIN_PASTEXTR)) == WIN_XTR && (*cur) == opts - 1)
api->bottomline(bline & ~BL_PUT);
api->bottomline(bline & ~BL_PASTE);
else
api->bottomline(bline);
}
......@@ -2428,13 +2428,13 @@ void bottomline(int line)
uprintf(i,api->scrn_len+1,BLACK|(api->cclr<<4),"Edit Item ");
i+=11;
}
if(line&BL_GET) {
if(line&BL_COPY) {
uprintf(i,api->scrn_len+1,api->bclr|(api->cclr<<4),"F5 ");
i+=3;
uprintf(i,api->scrn_len+1,BLACK|(api->cclr<<4),"Copy Item ");
i+=11;
}
if(line&BL_PUT) {
if(line&BL_PASTE) {
uprintf(i,api->scrn_len+1,api->bclr|(api->cclr<<4),"F6 ");
i+=3;
uprintf(i,api->scrn_len+1,BLACK|(api->cclr<<4),"Paste ");
......
......@@ -254,10 +254,10 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
}
}
str[0]=0;
if(mode&WIN_GET)
strcat(str,", Copy");
if(mode&WIN_PUT)
strcat(str,", Paste");
if(mode&WIN_COPY)
strcat(str,", Copy, X-Cut");
if(mode&WIN_PASTE)
strcat(str,", Paste, Insert");
if(mode&WIN_INS)
strcat(str,", Add");
if(mode&WIN_DEL)
......@@ -313,31 +313,50 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if(opts==1)
return(MSK_DEL);
return(which("Delete",opts)|MSK_DEL);
case 'C': /* Copy/Get */
if(!(mode&WIN_GET))
case 'C': /* Copy */
if(!(mode&WIN_COPY))
break;
if(!opts)
break;
if(i>0 && i<=opts)
return((i-1)|MSK_GET);
return((i-1)|MSK_COPY);
if(opts==1)
return(MSK_GET);
return(which("Copy",opts)|MSK_GET);
case 'P': /* Paste/Put */
if(!(mode&WIN_PUT))
return(MSK_COPY);
return(which("Copy",opts)|MSK_COPY);
case 'X': /* Cut */
if(!(mode&WIN_COPY))
break;
if(!opts)
break;
if(i>0 && i<=opts)
return((i-1)|MSK_PUT);
return((i-1)|MSK_CUT);
if(opts==1)
return(MSK_PUT);
return(which("Paste",opts)|MSK_PUT);
return(MSK_CUT);
return(which("Cut",opts)|MSK_CUT);
case 'P': /* Paste-Over */
if(!(mode&WIN_PASTE))
break;
if(!opts)
break;
if(i>0 && i<=opts)
return((i-1)|MSK_PASTE_OVER);
if(opts==1)
return(MSK_PASTE_OVER);
return(which("Paste over",opts)|MSK_PASTE_OVER);
case 'I': /* Paste-Insert */
if(!(mode&WIN_PASTE))
break;
if(!opts)
break;
if(i>0 && i<=opts+1)
return((i-1)|MSK_PASTE_INSERT);
if(opts==1)
return(MSK_PASTE_INSERT);
return(which("Insert pasted item before",opts+1)|MSK_PASTE_INSERT);
}
}
}
/*************************************************************************/
/* This function is a windowed input string input routine. */
/*************************************************************************/
......
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