patch-1.3.91 linux/scripts/lxdialog/menubox.c
Next file: linux/scripts/lxdialog/util.c
Previous file: linux/scripts/lxdialog/dialog.h
Back to the patch index
Back to the overall index
- Lines: 58
- Date:
Thu Apr 18 14:38:54 1996
- Orig file:
v1.3.90/linux/scripts/lxdialog/menubox.c
- Orig date:
Wed Mar 27 08:19:29 1996
diff -u --recursive --new-file v1.3.90/linux/scripts/lxdialog/menubox.c linux/scripts/lxdialog/menubox.c
@@ -34,7 +34,7 @@
strncpy(menu_item, item, menu_width);
menu_item[menu_width] = 0;
- j = first_alpha(menu_item);
+ j = first_alpha(menu_item, "YyNnMm");
/* Clear 'residue' of last item */
wattrset (win, menubox_attr);
@@ -205,13 +205,13 @@
i = max_choice;
else {
for (i = choice+1; i < max_choice; i++) {
- j = first_alpha(items[(scroll+i)*2+1]);
+ j = first_alpha(items[(scroll+i)*2+1], "YyNnMm");
if (key == tolower(items[(scroll+i)*2+1][j]))
break;
}
if (i == max_choice)
for (i = 0; i < max_choice; i++) {
- j = first_alpha(items[(scroll+i)*2+1]);
+ j = first_alpha(items[(scroll+i)*2+1], "YyNnMm");
if (key == tolower(items[(scroll+i)*2+1][j]))
break;
}
@@ -308,15 +308,20 @@
print_buttons(dialog, height, width, button);
wrefresh (dialog);
break;
+ case ' ':
case 's':
case 'y':
case 'n':
case 'm':
delwin (dialog);
fprintf(stderr, "%s\n", items[(scroll + choice) * 2]);
- if (key == 'y') return 3;
- if (key == 'n') return 4;
- if (key == 'm') return 5;
+ switch (key) {
+ case 's': return 3;
+ case 'y': return 3;
+ case 'n': return 4;
+ case 'm': return 5;
+ case ' ': return 6;
+ }
return 0;
case 'h':
case '?':
@@ -327,7 +332,7 @@
fprintf(stderr, "%s \"%s\"\n",
items[(scroll + choice) * 2],
items[(scroll + choice) * 2 + 1] +
- first_alpha(items[(scroll + choice) * 2 + 1]));
+ first_alpha(items[(scroll + choice) * 2 + 1],""));
else
fprintf(stderr, "%s\n", items[(scroll + choice) * 2]);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this