diff options
author | jkh <jkh@FreeBSD.org> | 1996-04-19 10:39:16 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-04-19 10:39:16 +0000 |
commit | 2ee0ebfbc48f3dfca6fe15fcf91e167a1ea0ac24 (patch) | |
tree | fbf9d5e00618e52da9eb68025c49b3ade09aaa92 /gnu/lib/libdialog | |
parent | d96c3e1df47edc4eae861f4af7207066bc9e7129 (diff) | |
download | FreeBSD-src-2ee0ebfbc48f3dfca6fe15fcf91e167a1ea0ac24.zip FreeBSD-src-2ee0ebfbc48f3dfca6fe15fcf91e167a1ea0ac24.tar.gz |
Fix a bug which did not properly bias checklist items by their scroll
factor.
Diffstat (limited to 'gnu/lib/libdialog')
-rw-r--r-- | gnu/lib/libdialog/checklist.c | 15 | ||||
-rw-r--r-- | gnu/lib/libdialog/radiolist.c | 3 |
2 files changed, 10 insertions, 8 deletions
diff --git a/gnu/lib/libdialog/checklist.c b/gnu/lib/libdialog/checklist.c index 9a510f8..c90ce9a 100644 --- a/gnu/lib/libdialog/checklist.c +++ b/gnu/lib/libdialog/checklist.c @@ -315,7 +315,8 @@ draw: st = ditems[scroll + choice].fire(&ditems[scroll + choice]); if (st & DITEM_REDRAW) { for (i = 0; i < max_choice; i++) { - status[i] = ditems[i].checked ? ditems[i].checked(&ditems[i]) : FALSE; + status[scroll + i] = ditems[scroll + i].checked ? + ditems[scroll + i].checked(&ditems[scroll + i]) : FALSE; print_item(list, items[(scroll + i) * 3], items[(scroll + i) * 3 + 1], status[scroll + i], i, i == choice, DREF(ditems, scroll + i)); } @@ -341,14 +342,14 @@ draw: break; } } - status[scroll+choice] = ditems[scroll+choice].checked ? - ditems[scroll+choice].checked(&ditems[scroll+choice]) : FALSE; - lbra = ditems[scroll+choice].lbra; - rbra = ditems[scroll+choice].rbra; - mark = ditems[scroll+choice].mark; + status[scroll + choice] = ditems[scroll + choice].checked ? + ditems[scroll + choice].checked(&ditems[scroll + choice]) : FALSE; + lbra = ditems[scroll + choice].lbra; + rbra = ditems[scroll + choice].rbra; + mark = ditems[scroll + choice].mark; } else - status[scroll+choice] = !status[scroll+choice]; + status[scroll + choice] = !status[scroll + choice]; getyx(dialog, cur_y, cur_x); /* Save cursor position */ wmove(list, choice, check_x); wattrset(list, check_selected_attr); diff --git a/gnu/lib/libdialog/radiolist.c b/gnu/lib/libdialog/radiolist.c index 63c9350..4d40e0b 100644 --- a/gnu/lib/libdialog/radiolist.c +++ b/gnu/lib/libdialog/radiolist.c @@ -322,7 +322,8 @@ draw: st = ditems[scroll + choice].fire(&ditems[scroll + choice]); if (st & DITEM_REDRAW) { for (i = 0; i < max_choice; i++) { - status[i] = ditems[i].checked ? ditems[i].checked(&ditems[i]) : FALSE; + status[scroll + i] = ditems[scroll + i].checked ? + ditems[scroll + i].checked(&ditems[scroll + i]) : FALSE; print_item(list, items[(scroll + i) * 3], items[(scroll + i) * 3 + 1], status[scroll + i], i, i == choice, DREF(ditems, scroll + i)); |