Commit 9cf536fa authored by rswindell's avatar rswindell
Browse files

Treat Shift-Insert as "Paste Insert" (new item inserted above selected item)

different from Ctrl-V or F6 which is "Paste Over" (overwriting selected item)
parent e5ee5a63
......@@ -110,11 +110,11 @@ while(1) {
sprintf(str,"%s Sub-boards",cfg.grp[grpnum]->sname);
i=WIN_SAV|WIN_ACT;
if(j)
i|=WIN_DEL|WIN_GET|WIN_DELACT;
i|=WIN_DEL|WIN_COPY|WIN_DELACT;
if(j<MAX_OPTS)
i|=WIN_INS|WIN_XTR|WIN_PUTXTR|WIN_INSACT;
i|=WIN_INS|WIN_XTR|WIN_PASTEXTR|WIN_INSACT;
if(savsub.sname[0])
i|=WIN_PUT;
i|=WIN_PASTE;
uifc.helpbuf=
"`Message Sub-boards:`\n"
"\n"
......@@ -244,16 +244,20 @@ while(1) {
uifc.changes=1;
continue;
}
if((i&MSK_ON)==MSK_GET) {
if((i&MSK_ON)==MSK_COPY) {
i&=MSK_OFF;
savsub=*cfg.sub[subnum[i]];
continue;
}
if((i&MSK_ON)==MSK_PUT) {
if((i&MSK_ON)==MSK_PASTE_OVER || (i&MSK_ON) == MSK_PASTE_INSERT) {
int msk = i&MSK_ON;
i&=MSK_OFF;
if (opt[i][0] == 0) { /* Paste-over extra/blank item */
if (msk == MSK_PASTE_INSERT) {
if (!new_sub(subnum[i], grpnum))
continue;
} else if (opt[i][0] == 0) { /* Paste-over extra/blank item */
if (!new_sub(cfg.total_subs, grpnum))
continue;
}
ptridx=cfg.sub[subnum[i]]->ptridx;
*cfg.sub[subnum[i]]=savsub;
......
......@@ -96,19 +96,20 @@
#endif
#endif
#define MAX_OPTS 10000
#define MSK_ON 0xf0000000
#define MSK_OFF 0x0fffffff
#define MSK_INS 0x10000000
#define MSK_DEL 0x20000000
#define MSK_COPY 0x30000000
#define MSK_CUT 0x40000000
#define MSK_PASTE 0x50000000
#define MSK_EDIT 0x60000000
#define MAX_OPTS 10000
#define MSK_ON 0xf0000000
#define MSK_OFF 0x0fffffff
#define MSK_INS 0x10000000
#define MSK_DEL 0x20000000
#define MSK_COPY 0x30000000
#define MSK_CUT 0x40000000
#define MSK_PASTE_OVER 0x50000000 /* Overwrite selected item with previously copied item */
#define MSK_PASTE_INSERT 0x60000000 /* Insert new item (above) current item with previously copied item */
#define MSK_EDIT 0x70000000
/* Legacy terms (get/put instead of copy/paste) */
#define MSK_GET MSK_COPY
#define MSK_PUT MSK_PASTE
#define MSK_PUT MSK_PASTE_OVER
/* Don't forget, negative return values are used for extended keys (if WIN_EXTKEYS used)! */
#define MAX_OPLN 75 /* Maximum length of each option per menu call */
......@@ -149,8 +150,8 @@
#define WIN_ESC (1<<9) /* Screen is active when escape is hit */
#define WIN_RHT (1<<10) /* Place window against right side of screen */
#define WIN_BOT (1<<11) /* Place window against bottom of screen */
#define WIN_GET (1<<12) /* Allows F5 to Get (copy) a menu item */
#define WIN_PUT (1<<13) /* Allows F6 to Put (paste) a menu item */
#define WIN_COPY (1<<12) /* Allows F5 to Get (copy) a menu item */
#define WIN_PASTE (1<<13) /* Allows F6 to Put (paste) a menu item */
#define WIN_CHE (1<<14) /* Stay active after escape if changes */
#define WIN_XTR (1<<15) /* Add extra line at end for inserting at end */
#define WIN_DYN (1<<16) /* Dynamic window - return at least every second */
......@@ -166,15 +167,17 @@
#define WIN_FIXEDHEIGHT (1<<25) /* Use list_height from uifc struct */
#define WIN_UNGETMOUSE (1<<26) /* If the mouse is clicked outside the window, */
/* Put the mouse event back into the event queue */
#define WIN_EDIT (1<<27) /* Allow F2 to edit a menu item */
#define WIN_PUTXTR (1<<28) /* Allow paste into extra (blank) item */
#define WIN_INACT (1<<29) /* Draw window inactive... intended for use with WIN_IMM */
#define WIN_POP (1<<30) /* Exit the list. Act as though ESC was pressed. */
/* Intended for use after a WIN_EXTKEYS or WIN_DYN */
#define WIN_SEL (1<<31) /* Exit the list. Act as though ENTER was pressed. */
/* Intended for use after a WIN_EXTKEYS or WIN_DYN */
#define WIN_EDIT (1<<27) /* Allow F2 to edit a menu item */
#define WIN_PASTEXTR (1<<28) /* Allow paste into extra (blank) item */
#define WIN_INACT (1<<29) /* Draw window inactive... intended for use with WIN_IMM */
#define WIN_POP (1<<30) /* Exit the list. Act as though ESC was pressed. */
/* Intended for use after a WIN_EXTKEYS or WIN_DYN */
#define WIN_SEL (1<<31) /* Exit the list. Act as though ENTER was pressed. */
/* Intended for use after a WIN_EXTKEYS or WIN_DYN */
#define WIN_MID WIN_L2R|WIN_T2B /* Place window in middle of screen */
#define WIN_GET WIN_COPY
#define WIN_PUT WIN_PASTE
#define SCRN_TOP 3
#define SCRN_LEFT 5
......
......@@ -1591,10 +1591,13 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if(mode&WIN_GET && !(mode&WIN_XTR && (*cur) == opts - 1))
return((*cur) | MSK_CUT);
break;
case CIO_KEY_F(6): /* F6 - Paste */
case CIO_KEY_SHIFT_IC: /* Shift-Insert */
if(mode&WIN_PUT && (mode&WIN_PUTXTR || !(mode&WIN_XTR && (*cur)==opts-1)))
return((*cur)|MSK_PUT);
case CIO_KEY_SHIFT_IC: /* Shift-Insert: Paste-Insert */
if(mode&WIN_PUT)
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)))
return((*cur)|MSK_PASTE_OVER);
break;
case CIO_KEY_IC: /* insert */
if(mode&WIN_INS) {
......
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