Skip to content
Snippets Groups Projects
Commit 242d361f authored by rswindell's avatar rswindell
Browse files

Deuce's update.

parent cfa8d916
No related branches found
No related tags found
No related merge requests found
...@@ -173,6 +173,7 @@ int uifcinic(uifcapi_t* uifcapi) ...@@ -173,6 +173,7 @@ int uifcinic(uifcapi_t* uifcapi)
// intrflush(stdscr, FALSE); // intrflush(stdscr, FALSE);
keypad(stdscr, TRUE); keypad(stdscr, TRUE);
scrollok(stdscr,FALSE); scrollok(stdscr,FALSE);
raw();
// Set up color pairs // Set up color pairs
for(bg=0;bg<8;bg++) { for(bg=0;bg<8;bg++) {
...@@ -180,7 +181,6 @@ int uifcinic(uifcapi_t* uifcapi) ...@@ -180,7 +181,6 @@ int uifcinic(uifcapi_t* uifcapi)
init_pair(++pair,curses_color(fg),curses_color(bg)); init_pair(++pair,curses_color(fg),curses_color(bg));
} }
} }
// resizeterm(25,80); /* set mode to 80x25 if possible */
clear(); clear();
refresh(); refresh();
getmaxyx(stdscr,height,width); getmaxyx(stdscr,height,width);
...@@ -296,6 +296,7 @@ void uifcbail(void) ...@@ -296,6 +296,7 @@ void uifcbail(void)
clear(); clear();
nl(); nl();
nocbreak(); nocbreak();
noraw();
refresh(); refresh();
endwin(); endwin();
} }
...@@ -573,13 +574,13 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -573,13 +574,13 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
|| (bar && ((*cur)-(*bar))+(height-4)<opts))) { || (bar && ((*cur)-(*bar))+(height-4)<opts))) {
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2);
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(ACS_DARROW); /* put down arrow */ putch(31); /* put down arrow */
textattr(hclr|(bclr<<4)); } textattr(hclr|(bclr<<4)); }
if(bar && (*bar)!=(*cur)) { if(bar && (*bar)!=(*cur)) {
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3);
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(ACS_UARROW); /* put the up arrow */ putch(30); /* put the up arrow */
textattr(hclr|(bclr<<4)); } textattr(hclr|(bclr<<4)); }
if(bclr==BLUE) { if(bclr==BLUE) {
...@@ -625,7 +626,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -625,7 +626,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(' '); /* Delete the up arrow */ putch(' '); /* Delete the up arrow */
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2);
putch(ACS_DARROW); /* put the down arrow */ putch(31); /* put the down arrow */
uprintf(SCRN_LEFT+left+3,SCRN_TOP+top+3 uprintf(SCRN_LEFT+left+3,SCRN_TOP+top+3
,bclr|(LIGHTGRAY<<4) ,bclr|(LIGHTGRAY<<4)
,"%-*.*s",width-4,width-4,option[0]); ,"%-*.*s",width-4,width-4,option[0]);
...@@ -665,7 +666,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -665,7 +666,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
hidemouse(); hidemouse();
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3); /* like end */ gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3); /* like end */
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(ACS_UARROW); /* put the up arrow */ putch(30); /* put the up arrow */
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2);
putch(' '); /* delete the down arrow */ putch(' '); /* delete the down arrow */
for(i=(opts+4)-height,j=0;i<opts;i++,j++) for(i=(opts+4)-height,j=0;i<opts;i++,j++)
...@@ -706,7 +707,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -706,7 +707,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if((*cur)+height-4==opts-1) { if((*cur)+height-4==opts-1) {
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2);
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(ACS_DARROW); } /* put the dn arrow */ putch(31); } /* put the dn arrow */
y++; y++;
scroll_text(SCRN_LEFT+left+2,SCRN_TOP+top+3 scroll_text(SCRN_LEFT+left+2,SCRN_TOP+top+3
,SCRN_LEFT+left+width-3,SCRN_TOP+top+height-2,1); ,SCRN_LEFT+left+width-3,SCRN_TOP+top+height-2,1);
...@@ -764,7 +765,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -764,7 +765,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
hidemouse(); hidemouse();
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3);
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(ACS_UARROW); /* put the up arrow */ putch(30); /* put the up arrow */
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2);
putch(' '); /* delete the down arrow */ putch(' '); /* delete the down arrow */
for(i=(opts+4)-height,j=0;i<opts;i++,j++) for(i=(opts+4)-height,j=0;i<opts;i++,j++)
...@@ -806,7 +807,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -806,7 +807,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(' '); /* Delete the up arrow */ putch(' '); /* Delete the up arrow */
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2);
putch(ACS_DARROW); /* put the down arrow */ putch(31); /* put the down arrow */
uprintf(SCRN_LEFT+left+3,SCRN_TOP+top+3 uprintf(SCRN_LEFT+left+3,SCRN_TOP+top+3
,bclr|(LIGHTGRAY<<4) ,bclr|(LIGHTGRAY<<4)
,"%-*.*s",width-4,width-4,option[0]); ,"%-*.*s",width-4,width-4,option[0]);
...@@ -849,7 +850,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -849,7 +850,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if((*cur)+4==height) { if((*cur)+4==height) {
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3);
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(ACS_UARROW); } /* put the up arrow */ putch(30); } /* put the up arrow */
y--; y--;
/* gotoxy(1,1); cprintf("\rdebug: %4d ",__LINE__); */ /* gotoxy(1,1); cprintf("\rdebug: %4d ",__LINE__); */
scroll_text(SCRN_LEFT+left+2,SCRN_TOP+top+3 scroll_text(SCRN_LEFT+left+2,SCRN_TOP+top+3
...@@ -945,7 +946,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -945,7 +946,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
(*cur)=j; (*cur)=j;
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+3);
textattr(lclr|(bclr<<4)); textattr(lclr|(bclr<<4));
putch(ACS_UARROW); /* put the up arrow */ putch(30); /* put the up arrow */
if((*cur)==opts-1) { if((*cur)==opts-1) {
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2);
putch(' '); } /* delete the down arrow */ putch(' '); } /* delete the down arrow */
...@@ -965,7 +966,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -965,7 +966,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
if(!(*cur)) if(!(*cur))
putch(' '); /* Delete the up arrow */ putch(' '); /* Delete the up arrow */
gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2); gotoxy(SCRN_LEFT+left+1,SCRN_TOP+top+height-2);
putch(ACS_DARROW); /* put the down arrow */ putch(31); /* put the down arrow */
uprintf(SCRN_LEFT+left+3,SCRN_TOP+top+3 uprintf(SCRN_LEFT+left+3,SCRN_TOP+top+3
,bclr|(LIGHTGRAY<<4) ,bclr|(LIGHTGRAY<<4)
,"%-*.*s",width-4,width-4,option[(*cur)]); ,"%-*.*s",width-4,width-4,option[(*cur)]);
...@@ -1032,6 +1033,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar ...@@ -1032,6 +1033,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
FREE(sav[api->savnum].buf); FREE(sav[api->savnum].buf);
api->savdepth--; } api->savdepth--; }
return(*cur); return(*cur);
case 03:
case ESC: case ESC:
if((mode&WIN_ESC || (mode&WIN_CHE && api->changes)) if((mode&WIN_ESC || (mode&WIN_CHE && api->changes))
&& !(mode&WIN_SAV)) { && !(mode&WIN_SAV)) {
...@@ -1348,7 +1350,7 @@ static int ugetstr(char *outstr, int max, long mode) ...@@ -1348,7 +1350,7 @@ static int ugetstr(char *outstr, int max, long mode)
continue; continue;
if(mode&K_ALPHA && !isalpha(ch)) if(mode&K_ALPHA && !isalpha(ch))
continue; continue;
if((ch>=SP || (ch==1 && mode&K_MSG)) && i<max && (!ins || j<max)) if((ch>=SP || (ch==1 && mode&K_MSG)) && i<max && (!ins || j<max) && isprint(ch))
{ {
if(mode&K_UPPER) if(mode&K_UPPER)
ch=toupper(ch); ch=toupper(ch);
...@@ -1437,8 +1439,8 @@ void bottomline(int line) ...@@ -1437,8 +1439,8 @@ void bottomline(int line)
i+=4; i+=4;
uprintf(i,api->scrn_len+1,BLACK|(cclr<<4),"Delete Item "); uprintf(i,api->scrn_len+1,BLACK|(cclr<<4),"Delete Item ");
i+=13; } i+=13; }
uprintf(i,api->scrn_len+1,bclr|(cclr<<4),"ESC "); uprintf(i,api->scrn_len+1,bclr|(cclr<<4),"ESC/^C ");
i+=4; i+=7;
uprintf(i,api->scrn_len+1,BLACK|(cclr<<4),"Exit"); uprintf(i,api->scrn_len+1,BLACK|(cclr<<4),"Exit");
i+=4; i+=4;
gotoxy(i,api->scrn_len+1); gotoxy(i,api->scrn_len+1);
...@@ -1592,11 +1594,12 @@ void help() ...@@ -1592,11 +1594,12 @@ void help()
unsigned short line; unsigned short line;
long l; long l;
FILE *fp; FILE *fp;
int old_curs;
#ifndef __FLAT__ #ifndef __FLAT__
union REGS r; union REGS r;
#endif #endif
curs_set(0); old_curs=curs_set(0);
if((savscrn=(char *)MALLOC(scrn_width*25*2))==NULL) { if((savscrn=(char *)MALLOC(scrn_width*25*2))==NULL) {
cprintf("UIFC line %d: error allocating %u bytes\r\n" cprintf("UIFC line %d: error allocating %u bytes\r\n"
...@@ -1740,7 +1743,8 @@ void help() ...@@ -1740,7 +1743,8 @@ void help()
showmouse(); showmouse();
FREE(savscrn); FREE(savscrn);
FREE(buf); FREE(buf);
curs_set(1); if(old_curs != ERR)
curs_set(old_curs);
} }
static int puttext(int sx, int sy, int ex, int ey, unsigned char *fill) static int puttext(int sx, int sy, int ex, int ey, unsigned char *fill)
...@@ -1846,9 +1850,17 @@ static int gettext(int sx, int sy, int ex, int ey, unsigned char *fill) ...@@ -1846,9 +1850,17 @@ static int gettext(int sx, int sy, int ex, int ey, unsigned char *fill)
else if (ext_char == ACS_BLOCK) else if (ext_char == ACS_BLOCK)
{ {
thischar=219; thischar=219;
/* unlikely */
} }
else if (ext_char == ACS_UARROW)
{
thischar=30;
}
else if (ext_char == ACS_DARROW)
{
thischar=31;
}
/* unlikely (Not in ncurses) */
else if (ext_char == ACS_SBSD) else if (ext_char == ACS_SBSD)
{ {
thischar=181; thischar=181;
...@@ -2052,6 +2064,12 @@ static void _putch(unsigned char ch, BOOL refresh_now) ...@@ -2052,6 +2064,12 @@ static void _putch(unsigned char ch, BOOL refresh_now)
switch(ch) switch(ch)
{ {
case 30:
cha=ACS_UARROW;
break;
case 31:
cha=ACS_DARROW;
break;
case 176: case 176:
cha=ACS_CKBOARD; cha=ACS_CKBOARD;
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment