From 0c0732fb4461c9688c99ae300c550dddcfe5c496 Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Thu, 10 Mar 2022 23:56:21 -0800 Subject: [PATCH] Use the new UIFC WIN_LEFTKEY/RIGHTKEY mode flags to enable indicators A visual clue that there was a new navigation method available on some menus (where left/right arrow keys cycle through configured item) was needed. This seems to work nicely. --- src/sbbs3/scfg/scfgmsg.c | 7 ++++++- src/sbbs3/scfg/scfgsub.c | 14 ++++++++++---- src/sbbs3/scfg/scfgxfr2.c | 21 ++++++++++++++++----- src/sbbs3/scfg/scfgxtrn.c | 20 ++++++++++++++++---- 4 files changed, 48 insertions(+), 14 deletions(-) diff --git a/src/sbbs3/scfg/scfgmsg.c b/src/sbbs3/scfg/scfgmsg.c index a771b102be..91ad3cbca0 100644 --- a/src/sbbs3/scfg/scfgmsg.c +++ b/src/sbbs3/scfg/scfgmsg.c @@ -674,7 +674,12 @@ void msgs_cfg() "The left and right arrow keys may be used to cycle through message\n" "groups.\n" ; - switch(uifc.list(WIN_ACT|WIN_T2B|WIN_EXTKEYS,6,0,60,&dflt,0,str,opt)) { + uifc_winmode_t wmode = WIN_ACT|WIN_T2B|WIN_EXTKEYS; + if(grpnum > 0) + wmode |= WIN_LEFTKEY; + if(grpnum + 1 < cfg.total_grps) + wmode |= WIN_RIGHTKEY; + switch(uifc.list(wmode,6,0,60,&dflt,0,str,opt)) { case -1: done=1; break; diff --git a/src/sbbs3/scfg/scfgsub.c b/src/sbbs3/scfg/scfgsub.c index bc2a19758a..ea3ce5adff 100644 --- a/src/sbbs3/scfg/scfgsub.c +++ b/src/sbbs3/scfg/scfgsub.c @@ -402,16 +402,22 @@ void sub_cfg(uint grpnum) "\n" "The left and right arrow keys may be used to cycle through sub-boards.\n" ; - switch(uifc.list(WIN_ACT|WIN_SAV|WIN_BOT|WIN_L2R|WIN_EXTKEYS - ,0,0,72,&opt_dflt,0,str,opt)) { + uifc_winmode_t wmode = WIN_ACT|WIN_SAV|WIN_BOT|WIN_L2R|WIN_EXTKEYS; + int prev = prev_subnum(cfg.sub[i]); + int next = next_subnum(cfg.sub[i]); + if(prev != i) + wmode |= WIN_LEFTKEY; + if(next != i) + wmode |= WIN_RIGHTKEY; + switch(uifc.list(wmode,0,0,72,&opt_dflt,0,str,opt)) { case -1: done=1; break; case -CIO_KEY_LEFT-2: - i = prev_subnum(cfg.sub[i]); + i = prev; break; case -CIO_KEY_RIGHT-2: - i = next_subnum(cfg.sub[i]); + i = next; break; case 0: uifc.helpbuf=sub_long_name_help; diff --git a/src/sbbs3/scfg/scfgxfr2.c b/src/sbbs3/scfg/scfgxfr2.c index fc5f5a3a2e..20c413d383 100644 --- a/src/sbbs3/scfg/scfgxfr2.c +++ b/src/sbbs3/scfg/scfgxfr2.c @@ -439,7 +439,12 @@ void xfer_cfg() "The left and right arrow keys may be used to cycle through file\n" "libraries.\n" ; - switch(uifc.list(WIN_ACT|WIN_EXTKEYS,6,4,60,&dflt,0,str,opt)) { + uifc_winmode_t wmode = WIN_ACT|WIN_EXTKEYS; + if(libnum > 0) + wmode |= WIN_LEFTKEY; + if(libnum + 1 < cfg.total_libs) + wmode |= WIN_RIGHTKEY; + switch(uifc.list(wmode,6,4,60,&dflt,0,str,opt)) { case -1: done=1; break; @@ -1275,16 +1280,22 @@ void dir_cfg(uint libnum) "The left and right arrow keys may be used to cycle through file\n" "directories.\n" ; - switch(uifc.list(WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT|WIN_EXTKEYS - ,0,0,72,&opt_dflt,0,str,opt)) { + uifc_winmode_t wmode = WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT|WIN_EXTKEYS; + int prev = prev_dirnum(cfg.dir[i]); + int next = next_dirnum(cfg.dir[i]); + if(prev != i) + wmode |= WIN_LEFTKEY; + if(next != i) + wmode |= WIN_RIGHTKEY; + switch(uifc.list(wmode,0,0,72,&opt_dflt,0,str,opt)) { case -1: done=1; break; case -CIO_KEY_LEFT-2: - i = prev_dirnum(cfg.dir[i]); + i = prev; break; case -CIO_KEY_RIGHT-2: - i = next_dirnum(cfg.dir[i]); + i = next; break; case 0: uifc.helpbuf=dir_long_name_help; diff --git a/src/sbbs3/scfg/scfgxtrn.c b/src/sbbs3/scfg/scfgxtrn.c index 9e96ef94dc..0ee5fee42b 100644 --- a/src/sbbs3/scfg/scfgxtrn.c +++ b/src/sbbs3/scfg/scfgxtrn.c @@ -1224,16 +1224,23 @@ void xtrn_cfg(uint section) "\n" "The left and right arrow keys may be used to cycle through programs.\n" ; - switch(uifc.list(WIN_SAV|WIN_ACT|WIN_MID|WIN_EXTKEYS,0,0,60,&opt_dflt,&sub_bar,cfg.xtrn[i]->name + uifc_winmode_t wmode = WIN_SAV|WIN_ACT|WIN_MID|WIN_EXTKEYS; + int prev = prev_program(i); + int next = next_program(i); + if(prev != i) + wmode |= WIN_LEFTKEY; + if(next != i) + wmode |= WIN_RIGHTKEY; + switch(uifc.list(wmode,0,0,60,&opt_dflt,&sub_bar,cfg.xtrn[i]->name ,opt)) { case -1: done=1; break; case -CIO_KEY_LEFT-2: - i = prev_program(i); + i = prev; break; case -CIO_KEY_RIGHT-2: - i = next_program(i); + i = next; break; case 0: uifc.helpbuf= @@ -2421,7 +2428,12 @@ void xtrnsec_cfg() "The left and right arrow keys may be used to cycle through program\n" "sections.\n" ; - switch(uifc.list(WIN_SAV|WIN_ACT|WIN_MID|WIN_EXTKEYS,0,0,60,&xtrnsec_opt,0,str + uifc_winmode_t wmode = WIN_SAV|WIN_ACT|WIN_MID|WIN_EXTKEYS; + if(i > 0) + wmode |= WIN_LEFTKEY; + if(i + 1 < cfg.total_xtrnsecs) + wmode |= WIN_RIGHTKEY; + switch(uifc.list(wmode,0,0,60,&xtrnsec_opt,0,str ,opt)) { case -1: done=1; -- GitLab