Skip to content
Snippets Groups Projects
Commit 83149041 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Support left/right arrow key cycling through more multi-item menus

parent ce475f79
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3165 passed
......@@ -932,11 +932,24 @@ void txt_cfg()
sprintf(opt[k++],"%-27.27s%s","Access Requirements"
,cfg.txtsec[i]->arstr);
opt[k][0]=0;
switch(uifc.list(WIN_ACT|WIN_MID,0,0,60,&j,0,cfg.txtsec[i]->name
uifc_winmode_t wmode = WIN_ACT|WIN_MID|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_txtsecs)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,60,&j,0,cfg.txtsec[i]->name
,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_txtsecs)
i++;
break;
case 0:
uifc.helpbuf=
"`Text Section Name:`\n"
......@@ -1120,11 +1133,24 @@ void shell_cfg()
"Synchronet to interpret. See the example `.src` files in the `exec`\n"
"directory and the documentation for the Baja compiler for more details.\n"
;
switch(uifc.list(WIN_ACT|WIN_MID,0,0,60,&j,&bar,cfg.shell[i]->name
uifc_winmode_t wmode = WIN_ACT|WIN_MID|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_shells)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,60,&j,&bar,cfg.shell[i]->name
,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_shells)
i++;
break;
case 0:
uifc.helpbuf=
"`Command Shell Name:`\n"
......
......@@ -18,6 +18,7 @@
****************************************************************************/
#include "scfg.h"
#include "ciolib.h" // CIO_KEY_*
void page_cfg()
{
......@@ -121,10 +122,23 @@ void page_cfg()
,cfg.page[i]->misc&XTRN_SH ? "Yes" : "No");
opt[k][0]=0;
sprintf(str,"Sysop Chat Pager #%d",i+1);
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&j,0,str,opt)) {
uifc_winmode_t wmode = WIN_ACT|WIN_MID|WIN_SAV|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_pages)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,60,&j,0,str,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_pages)
i++;
break;
case 0:
uifc.helpbuf=
"`External Chat Pager Command Line:`\n"
......@@ -190,7 +204,7 @@ void page_cfg()
void chan_cfg()
{
static int chan_dflt,chan_bar,opt_dflt;
static int chan_dflt,chan_bar,opt_dflt,guru_dflt;
char str[128],code[128],done=0;
int j,k;
uint i,u;
......@@ -318,10 +332,23 @@ void chan_cfg()
"This menu is for configuring the selected chat channel.\n"
;
sprintf(str,"%s Chat Channel",cfg.chan[i]->name);
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,str,opt)) {
uifc_winmode_t wmode = WIN_ACT|WIN_MID|WIN_SAV|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_chans)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,60,&opt_dflt,0,str,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_chans)
i++;
break;
case 0:
uifc.helpbuf=
"`Chat Channel Name:`\n"
......@@ -421,7 +448,7 @@ void chan_cfg()
for(j=0;j<cfg.total_gurus && j<MAX_OPTS;j++)
sprintf(opt[j],"%-25s",cfg.guru[j]->name);
opt[j][0]=0;
k=uifc.list(WIN_SAV|WIN_RHT,0,0,25,&j,0
k=uifc.list(WIN_SAV|WIN_RHT,0,0,25,&guru_dflt,0
,"Available Chat Gurus",opt);
if(k==-1)
break;
......@@ -699,11 +726,24 @@ void guru_cfg()
"\n"
"This menu is for configuring the selected Guru.\n"
;
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,cfg.guru[i]->name
uifc_winmode_t wmode = WIN_ACT|WIN_MID|WIN_SAV|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_gurus)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,60,&opt_dflt,0,cfg.guru[i]->name
,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_gurus)
i++;
break;
case 0:
uifc.helpbuf=
"`Guru Name:`\n"
......@@ -843,11 +883,24 @@ void actsets_cfg()
"This menu is for configuring the selected chat action set.\n"
;
sprintf(str,"%s Chat Action Set",cfg.actset[i]->name);
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,60,&opt_dflt,0,str
uifc_winmode_t wmode = WIN_ACT|WIN_MID|WIN_SAV|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_actsets)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,60,&opt_dflt,0,str
,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_actsets)
i++;
break;
case 0:
uifc.helpbuf=
"`Chat Action Set Name:`\n"
......
......@@ -18,6 +18,7 @@
****************************************************************************/
#include "scfg.h"
#include "ciolib.h" // CIO_KEY_*
void qhub_edit(int num);
char *daystr(char days);
......@@ -914,11 +915,23 @@ void qhub_edit(int num)
"`Networked Sub-boards...` allows you to manually add, remove, or modify\n"
"local sub-board associations with conferences on this QWK network hub.\n"
;
switch(uifc.list(WIN_ACT|WIN_MID|WIN_SAV,0,0,0,&qhub_dflt,0
,str,opt)) {
uifc_winmode_t wmode = WIN_ACT|WIN_MID|WIN_SAV|WIN_EXTKEYS;
if(num > 0)
wmode |= WIN_LEFTKEY;
if(num + 1 < cfg.total_qhubs)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,0,&qhub_dflt,0,str,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(num > 0)
num--;
break;
case -CIO_KEY_RIGHT-2:
if(num + 1 < cfg.total_qhubs)
num++;
break;
case __COUNTER__:
uifc.helpbuf=
"`QWK Network Hub System ID:`\n"
......@@ -1248,11 +1261,26 @@ void qhub_sub_edit(uint num)
"You are configuring the options for this sub-board for this QWK network\n"
"hub.\n"
;
l=uifc.list(WIN_MID|WIN_SAV|WIN_ACT,0,0,
uifc_winmode_t wmode = WIN_MID|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(j > 0)
wmode |= WIN_LEFTKEY;
if(j + 1 < cfg.qhub[num]->subs)
wmode |= WIN_RIGHTKEY;
l=uifc.list(wmode,0,0,
22+LEN_GSNAME+LEN_SSNAME,&l,0
,"Networked Sub-board",opt);
if(l==-1)
break;
if(l == -CIO_KEY_LEFT-2) {
if(j > 0)
j--;
continue;
}
if(l == -CIO_KEY_RIGHT-2) {
if(j + 1 < cfg.qhub[num]->subs)
j++;
continue;
}
if(!l) {
m=getsub();
if(m!=-1) {
......
......@@ -19,6 +19,7 @@
#include "scfg.h"
#include "ssl.h"
#include "ciolib.h" // CIO_KEY_*
static void configure_dst(void)
{
......@@ -1943,11 +1944,24 @@ void sys_cfg(void)
,cfg.level_misc[i]&(LEVEL_EXPTOVAL|LEVEL_EXPTOLVL) ?
cfg.level_expireto[i] : cfg.expired_level);
opt[j][0]=0;
j=uifc.list(WIN_RHT|WIN_SAV|WIN_ACT,2,1,0,&k,0
uifc_winmode_t wmode = WIN_RHT|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < 100)
wmode |= WIN_RIGHTKEY;
j=uifc.list(wmode,2,1,0,&k,0
,str,opt);
if(j==-1)
break;
switch(j) {
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < 100)
i++;
break;
case 0:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Total Time Allowed Per Day (in minutes)"
......@@ -2189,7 +2203,6 @@ void sys_cfg(void)
,"Quick-Validation Values",opt);
if(i==-1)
break;
sprintf(str,"Quick-Validation Set %d",i);
while(1) {
j=0;
sprintf(opt[j++],"%-22.22s%u","Level",cfg.val_level[i]);
......@@ -2210,11 +2223,25 @@ void sys_cfg(void)
sprintf(opt[j++],"%-22.22s%u","Additional Credits"
,cfg.val_cdt[i]);
opt[j][0]=0;
j=uifc.list(WIN_RHT|WIN_SAV|WIN_ACT,2,1,0,&k,0
,str,opt);
uifc_winmode_t wmode = WIN_RHT|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < 10)
wmode |= WIN_RIGHTKEY;
SAFEPRINTF(str,"Quick-Validation Set %d",i);
j=uifc.list(wmode,2,1,0,&k,0,str,opt);
if(j==-1)
break;
switch(j) {
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < 10)
i++;
break;
case 0:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Level"
......
......@@ -18,6 +18,7 @@
****************************************************************************/
#include "scfg.h"
#include "ciolib.h" // CIO_KEY_*
char* testable_files_help =
"`Testable File Types:`\n"
......@@ -423,11 +424,24 @@ void xfer_opts()
sprintf(opt[j++],"%-22.22s%s","Access Requirements"
,cfg.fview[i]->arstr);
opt[j][0]=0;
switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&fview_opt,0
uifc_winmode_t wmode = WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_fviews)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,0,&fview_opt,0
,"Viewable File Type",opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_fviews)
i++;
break;
case 0:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Viewable File Type Extension"
......@@ -540,11 +554,24 @@ void xfer_opts()
,cfg.ftest[i]->arstr);
opt[j][0]=0;
uifc.helpbuf = testable_files_help;
switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&ftest_opt,0
uifc_winmode_t wmode = WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_ftests)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,0,&ftest_opt,0
,"Testable File Type",opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_ftests)
i++;
break;
case 0:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Testable File Type Extension"
......@@ -675,11 +702,24 @@ void xfer_opts()
sprintf(opt[j++],"%-22.22s%s","Access Requirements"
,cfg.dlevent[i]->arstr);
opt[j][0]=0;
switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&dlevent_opt,0
uifc_winmode_t wmode = WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_dlevents)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,0,&dlevent_opt,0
,"Download Event",opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_dlevents)
i++;
break;
case 0:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Download Event Extension"
......@@ -801,11 +841,24 @@ void xfer_opts()
sprintf(opt[j++],"%-22.22s%s","Access Requirements"
,cfg.fextr[i]->arstr);
opt[j][0]=0;
switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&fextr_opt,0
uifc_winmode_t wmode = WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_fextrs)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,0,&fextr_opt,0
,"Extractable File Type",opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_fextrs)
i++;
break;
case 0:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Extractable File Type Extension"
......@@ -921,11 +974,24 @@ void xfer_opts()
sprintf(opt[j++],"%-22.22s%s","Access Requirements"
,cfg.fcomp[i]->arstr);
opt[j][0]=0;
switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&fcomp_opt,0
uifc_winmode_t wmode = WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_fcomps)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,0,&fcomp_opt,0
,"Compressible File Type",opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_fcomps)
i++;
break;
case 0:
uifc.input(WIN_MID|WIN_SAV,0,0
,"Compressible File Type Extension"
......@@ -952,13 +1018,13 @@ void xfer_opts()
sprintf(opt[i],"%c %s"
,cfg.prot[i]->mnemonic,cfg.prot[i]->name);
opt[i][0]=0;
i=WIN_ACT|WIN_SAV; /* save cause size can change */
uifc_winmode_t wmode = WIN_ACT|WIN_SAV; /* WIN_SAV because size can change */
if(cfg.total_prots<MAX_OPTS)
i|=WIN_INS|WIN_XTR;
wmode |= WIN_INS|WIN_XTR;
if(cfg.total_prots)
i|=WIN_DEL|WIN_COPY|WIN_CUT;
wmode |= WIN_DEL|WIN_COPY|WIN_CUT;
if(savprot.mnemonic)
i|=WIN_PASTE;
wmode |= WIN_PASTE;
uifc.helpbuf=
"`File Transfer Protocols:`\n"
"\n"
......@@ -973,7 +1039,7 @@ void xfer_opts()
"don't wish it to be available for a certain method of transfer, leave\n"
"the command line for that method blank.\n"
;
i=uifc.list(i,0,0,34,&prot_dflt,&prot_bar,"File Transfer Protocols",opt);
i=uifc.list(wmode,0,0,34,&prot_dflt,&prot_bar,"File Transfer Protocols",opt);
if(i==-1)
break;
int msk = i & MSK_ON;
......@@ -1059,11 +1125,24 @@ void xfer_opts()
sprintf(opt[j++],"%-30.30s%s", "Socket I/O"
,cfg.prot[i]->misc&PROT_SOCKET ? "Yes":"No");
opt[j][0]=0;
switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,70,&prot_opt,0
wmode = WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_prots)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,70,&prot_opt,0
,"File Transfer Protocol",opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_prots)
i++;
break;
case 0:
str[0]=cfg.prot[i]->mnemonic;
str[1]=0;
......
......@@ -1886,11 +1886,24 @@ void xedit_cfg()
;
SAFEPRINTF(str,"%s Editor",cfg.xedit[i]->name);
switch(uifc.list(WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT,0,0,70,&dfltopt,0
uifc_winmode_t wmode = WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_xedits)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,70,&dfltopt,0
,str,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_xedits)
i++;
break;
case 0:
uifc.helpbuf=
"`External Editor Name:`\n"
......@@ -2646,11 +2659,24 @@ void hotkey_cfg(void)
"execute an external program or module anywhere in the BBS.\n"
;
sprintf(str,"Ctrl-%c Hot Key Event",cfg.hotkey[i]->key+'@');
switch(uifc.list(WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT,0,0,60,&dfltopt,0
uifc_winmode_t wmode = WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT|WIN_EXTKEYS;
if(i > 0)
wmode |= WIN_LEFTKEY;
if(i + 1 < cfg.total_hotkeys)
wmode |= WIN_RIGHTKEY;
switch(uifc.list(wmode,0,0,60,&dfltopt,0
,str,opt)) {
case -1:
done=1;
break;
case -CIO_KEY_LEFT-2:
if(i > 0)
i--;
break;
case -CIO_KEY_RIGHT-2:
if(i + 1 < cfg.total_hotkeys)
i++;
break;
case 0:
uifc.helpbuf=
"`Global Hot-Ctrl Key:`\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment