patch-1.3.65 linux/scripts/lxdialog/menubox.c
Next file: linux/CREDITS
Previous file: linux/scripts/README.Menuconfig
Back to the patch index
Back to the overall index
- Lines: 98
- Date:
Fri Feb 16 08:04:58 1996
- Orig file:
v1.3.64/linux/scripts/lxdialog/menubox.c
- Orig date:
Wed Feb 7 15:11:46 1996
diff -u --recursive --new-file v1.3.64/linux/scripts/lxdialog/menubox.c linux/scripts/lxdialog/menubox.c
@@ -27,9 +27,9 @@
* Print menu item
*/
static void
-print_item (WINDOW * win, const char *item, int choice, int selected)
+print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey)
{
- int j, i;
+ int i, j;
j = first_alpha(item);
@@ -40,8 +40,10 @@
waddch (win, ' ');
wattrset (win, selected ? item_selected_attr : item_attr);
mvwaddstr (win, choice, item_x, (char *)item);
- wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
- mvwaddch(win, choice, item_x+j, item[j]);
+ if (hotkey) {
+ wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
+ mvwaddch(win, choice, item_x+j, item[j]);
+ }
}
/*
@@ -174,8 +176,10 @@
}
/* Print the menu */
- for (i=0; i < max_choice; i++)
- print_item (menu, items[(first_item + i) * 2 + 1], i, i == choice);
+ for (i=0; i < max_choice; i++) {
+ print_item (menu, items[(first_item + i) * 2 + 1], i, i == choice,
+ (items[(first_item + i)*2][0] != ':'));
+ }
wnoutrefresh (menu);
@@ -209,14 +213,15 @@
if (menu_height > 1) {
/* De-highlight current first item */
- print_item (menu, items[scroll * 2 + 1],
- 0, FALSE);
+ print_item (menu, items[scroll*2+1], 0, FALSE,
+ (items[scroll*2][0] != ':'));
scrollok (menu, TRUE);
wscrl (menu, -1);
scrollok (menu, FALSE);
}
scroll--;
- print_item (menu, items[scroll * 2 + 1], 0, TRUE);
+ print_item (menu, items[scroll * 2 + 1], 0, TRUE,
+ (items[scroll*2][0] != ':'));
wnoutrefresh (menu);
print_arrows(dialog, choice, item_no, scroll,
@@ -235,15 +240,17 @@
if (menu_height > 1) {
/* De-highlight current last item */
print_item (menu, items[(scroll + max_choice - 1)
- * 2 + 1], max_choice - 1, FALSE);
+ * 2 + 1], max_choice - 1, FALSE,
+ (items[(scroll+max_choice-1)*2][0] != ':'));
scrollok (menu, TRUE);
scroll (menu);
scrollok (menu, FALSE);
}
scroll++;
- print_item (menu,
- items[(scroll + max_choice - 1) * 2 + 1],
- max_choice - 1, TRUE);
+ print_item (menu, items[(scroll+max_choice-1)*2+1],
+ max_choice-1, TRUE,
+ (items[(scroll+max_choice-1)*2][0] != ':'));
+
wnoutrefresh (menu);
print_arrows(dialog, choice, item_no, scroll,
@@ -259,13 +266,13 @@
if (i != choice) {
/* De-highlight current item */
getyx (dialog, cur_y, cur_x); /* Save cursor position */
- print_item (menu, items[(scroll + choice) * 2 + 1],
- choice, FALSE);
+ print_item (menu, items[(scroll+choice)*2+1], choice, FALSE,
+ (items[(scroll+choice)*2][0] != ':'));
/* Highlight new item */
choice = i;
- print_item (menu, items[(scroll + choice) * 2 + 1],
- choice, TRUE);
+ print_item (menu, items[(scroll+choice)*2+1], choice, TRUE,
+ (items[(scroll+choice)*2][0] != ':'));
wnoutrefresh (menu);
wmove (dialog, cur_y, cur_x);
wrefresh (dialog);
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