diff --git a/src/uifc/uifc.h b/src/uifc/uifc.h index b746bd72aca749be8a182a1e65cb3e4fbfeccee6..f8a12b0fffee88c95426dc266f6ee2363e81b61e 100644 --- a/src/uifc/uifc.h +++ b/src/uifc/uifc.h @@ -166,6 +166,7 @@ #define K_MOUSEEXIT (1L<<15) /* Returns when mouse is clicked outside of */ /* Input area (NOT outside of window!) */ /* And ungets the mouse event. */ +#define K_PASSWORD (1L<<16) /* Does not display text while editing */ /* Bottom line elements */ #define BL_INS (1<<0) /* INS key */ diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index 3c8e2d39e3d35931ec4200ea209d3fe5569a397a..a9a02590131994b73b58ca95a8cf9b3e51c2ed42 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -900,7 +900,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar } } else { /* Is a redraw */ - i=(*cur)-(*bar); + i=(*cur)+(top+tbrdrwidth-y); j=2; longopt=0; @@ -973,7 +973,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar && mevnt.starty<=(s_top+top+optheight)-bbrdrwidth-1 && mevnt.event==CIOLIB_BUTTON_1_CLICK) { - (*cur)=((mevnt.starty)-(s_top+top+tbrdrwidth))+(*cur-y+tbrdrwidth); + (*cur)=((mevnt.starty)-(s_top+top+tbrdrwidth))+(*cur+(top+tbrdrwidth-y)); if(bar) (*bar)=(*cur); y=top+tbrdrwidth+((mevnt.starty)-(s_top+top+tbrdrwidth)); @@ -1791,7 +1791,7 @@ void umsg(char *str) /***************************************/ /* Private sub - updates a ugetstr box */ /***************************************/ -void getstrupd(int left, int top, int width, char *outstr, int cursoffset, int *scrnoffset) +void getstrupd(int left, int top, int width, char *outstr, int cursoffset, int *scrnoffset, int mode) { _setcursortype(_NOCURSOR); if(cursoffset<*scrnoffset) @@ -1801,7 +1801,10 @@ void getstrupd(int left, int top, int width, char *outstr, int cursoffset, int * *scrnoffset=cursoffset-width; gotoxy(left,top); - cprintf("%-*.*s",width,width,outstr+*scrnoffset); + if(mode&K_PASSWORD) + cprintf("%-*.*s",width,width,"********************************************************************************"+(80-strlen(outstr+*scrnoffset))); + else + cprintf("%-*.*s",width,width,outstr+*scrnoffset); gotoxy(left+(cursoffset-*scrnoffset),top); _setcursortype(cursor); } @@ -1838,7 +1841,7 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int outstr[max]=0; i=j=strlen(outstr); textattr(api->lbclr); - getstrupd(left, top, width, outstr, i, &soffset); + getstrupd(left, top, width, outstr, i, &soffset, mode); textattr(api->lclr|(api->bclr<<4)); if(strlen(outstr)<(size_t)width) { k=wherex(); @@ -1898,11 +1901,11 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int || f==CTRL_Z || f==0) { - getstrupd(left, top, width, str, i, &soffset); + getstrupd(left, top, width, str, i, &soffset, mode); } else { - getstrupd(left, top, width, str, i, &soffset); + getstrupd(left, top, width, str, i, &soffset, mode); i=j=0; } } @@ -1914,7 +1917,7 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int { if(i>j) j=i; str[j]=0; - getstrupd(left, top, width, str, i, &soffset); + getstrupd(left, top, width, str, i, &soffset, mode); if(f || pb!=NULL || (ch=inkey())!=0) { if(f) {