Lines Matching full:choice

72  * Translate a choice from items[] to a row-number in an unbounded column,
76 index2row(ALL_DATA * all, int choice, int selected) in index2row() argument
81 if (okIndex(all, choice)) { in index2row()
85 TRACE(("!... choice %d: %p vs row %d: %p\n", in index2row()
86 choice, all->items + choice, in index2row()
88 if (myItem(data, row) == all->items + choice) { in index2row()
94 TRACE(("! index2row(choice %d, %s) = %d\n", choice, mySide(selected), result)); in index2row()
108 TRACE(("!... row %d: %p vs choice %d: %p\n", in row2index()
121 * Print list item. The 'selected' parameter is true if 'choice' is the
170 int choice, in print_1_list() argument
174 DIALOG_LISTITEM *target = (okIndex(all, choice) in print_1_list()
175 ? all->items + choice in print_1_list()
183 TRACE(("! print_1_list %d %s, top %d\n", choice, mySide(selected), top_row)); in print_1_list()
208 * further movement is possible, return the same choice as given.
211 prev_item(ALL_DATA * all, int choice, int selected) in prev_item() argument
213 int result = choice; in prev_item()
214 int row = index2row(all, choice, selected); in prev_item()
219 TRACE(("! prev_item choice %d, %s = %d\n", choice, mySide(selected), result)); in prev_item()
224 * Return true if the given choice is on the first page in the current column.
227 stop_prev(ALL_DATA * all, int choice, int selected) in stop_prev() argument
229 return (prev_item(all, choice, selected) == choice); in stop_prev()
233 check_hotkey(DIALOG_LISTITEM * items, int choice, int selected) in check_hotkey() argument
237 if ((items[choice].state != 0) == selected) { in check_hotkey()
240 ? items[choice].text in check_hotkey()
241 : items[choice].name))) { in check_hotkey()
250 * further movement is possible, return the same choice as given.
253 next_item(ALL_DATA * all, int choice, int selected) in next_item() argument
256 int result = choice; in next_item()
257 int row = index2row(all, choice, selected); in next_item()
258 TRACE(("! given item %d, testing next-item on row %d\n", choice, row + 1)); in next_item()
262 TRACE(("! next_item(%d, %s) ->%d\n", choice, mySide(selected), result)); in next_item()
267 * Return the first choice from items[] for the given column.
290 * Return the last choice from items[] for the given column.
334 * Find the closest item in the given column starting with the given choice.
337 closest_item(ALL_DATA * all, int choice, int selected) in closest_item() argument
339 int prev = choice; in closest_item()
340 int next = choice; in closest_item()
341 int result = choice; in closest_item()
344 for (n = choice; n >= 0; --n) { in closest_item()
350 for (n = choice; n < all->item_no; ++n) { in closest_item()
356 if (prev != choice) { in closest_item()
358 if (next != choice) { in closest_item()
359 if ((choice - prev) > (next - choice)) { in closest_item()
363 } else if (next != choice) { in closest_item()
366 TRACE(("! XXX closest item choice %d, %s = %d\n", in closest_item()
367 choice, mySide(selected), result)); in closest_item()
373 int choice) in print_both() argument
379 TRACE(("! print_both %d\n", choice)); in print_both()
388 print_1_list(all, choice, selected); in print_both()
408 set_top_item(ALL_DATA * all, int choice, int selected) in set_top_item() argument
410 if (choice != all->list[selected].top_index) { in set_top_item()
413 choice)); in set_top_item()
414 all->list[selected].top_index = choice; in set_top_item()
443 append_right_side(ALL_DATA * all, int choice) in append_right_side() argument
449 myItem(data, j) = &all->items[choice]; in append_right_side()
456 amend_right_side(ALL_DATA * all, int choice) in amend_right_side() argument
461 if (myItem(data, j) == &all->items[choice]) { in amend_right_side()
713 /* ensure we are scrolled to show the current choice */ in dlg_buildlist()
1018 DLG_TRACE(("# <--CHOICE %d\n", i)); in dlg_buildlist()
1134 int choice; in dlg_buildlist() local
1145 choice = row2index(&all, row, k); in dlg_buildlist()
1146 if (choice == cur_item) in dlg_buildlist()
1148 redo[j++] = items[choice]; in dlg_buildlist()