diff --git a/src/uifc/uifc.h b/src/uifc/uifc.h index 4e048f1f0e1dd465d7f0f55305bb307b2b04cd40..e95139c0537d7c753c98ad2dad0cd4d62fe44cda 100644 --- a/src/uifc/uifc.h +++ b/src/uifc/uifc.h @@ -351,6 +351,10 @@ typedef struct { /****************************************************************************/ BOOL insert_mode; /****************************************************************************/ +/* Set to TRUE to reverse the insert/overwrite cursor choice */ +/****************************************************************************/ + BOOL reverse_cursor; +/****************************************************************************/ /* The overlapped-window save buffer number. */ /****************************************************************************/ uint savnum; diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index 459b0d3e689b7ad36278baeb7cfbfa9c62b4941e..782f27fa3de7c4e2a1b0e2f5858852fda6e9844c 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -2144,6 +2144,14 @@ void getstrupd(int left, int top, int width, char *outstr, int cursoffset, int * _setcursortype(cursor); } +static void set_cursor_type(uifcapi_t* api) +{ + BOOL block_cursor = api->insert_mode; + if(api->reverse_cursor) + block_cursor = !block_cursor; + _setcursortype(cursor = (block_cursor ? _SOLIDCURSOR : _NORMALCURSOR)); +} + /****************************************************************************/ /* Gets a string of characters from the user. Turns cursor on. Allows */ /* Different modes - K_* macros. ESC aborts input. */ @@ -2166,7 +2174,7 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int return(-1); } gotoxy(left,top); - _setcursortype(cursor = api->insert_mode ? _SOLIDCURSOR : _NORMALCURSOR); + set_cursor_type(api); str[0]=0; if(mode&K_EDIT && outstr[0]) { /*** @@ -2380,7 +2388,7 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int continue; case CIO_KEY_IC: /* insert */ api->insert_mode = !api->insert_mode; - _setcursortype(cursor = api->insert_mode ? _SOLIDCURSOR : _NORMALCURSOR); + set_cursor_type(api); continue; case BS: if(i) @@ -2908,7 +2916,7 @@ void showbuf(uifc_winmode_t mode, int left, int top, int width, int height, cons lines=0; k=0; for(j=0;j<len;j++) { - if(mode&WIN_HLP && (hbuf[j]==2 || hbuf[j]=='~' || hbuf[j]==1 || hbuf[j]=='`')) + if((mode&WIN_HLP) && (hbuf[j]==2 || hbuf[j]=='~' || hbuf[j]==1 || hbuf[j]=='`')) continue; if(hbuf[j]==CR) continue; @@ -2947,11 +2955,11 @@ void showbuf(uifc_winmode_t mode, int left, int top, int width, int height, cons ++i; } } - else if(mode&WIN_HLP && (hbuf[j]==2 || hbuf[j]=='~')) { /* Ctrl-b toggles inverse */ + else if((mode&WIN_HLP) && (hbuf[j]==2 || hbuf[j]=='~')) { inverse=!inverse; i--; } - else if(mode&WIN_HLP && (hbuf[j]==1 || hbuf[j]=='`')) { /* Ctrl-a toggles high intensity */ + else if((mode&WIN_HLP) && (hbuf[j]==1 || hbuf[j]=='`')) { high=!high; i--; }