Lines Matching refs:item
45 * to calculate the widest item entry, then work out how many columns
47 * be. Once the layout is determined the neighbours of each item is
48 * calculated and the item structures updated.
70 /* fill in the row and column value of the item */
86 * Calculate the neighbours for an item in menu.
92 ITEM *item;
96 item = menu->items[item_no];
100 item->up = item;
101 item->down = item;
103 item->up = NULL;
104 item->down = NULL;
112 item->up =
115 item->up = NULL;
117 item->up = menu->items[item_no - 1];
121 if (item->row == 0) {
124 + item->col;
131 if (item->row == 0) {
132 neighbour = menu->item_rows * item->col
142 item->up = menu->items[neighbour];
144 item->up = NULL;
151 item->down = menu->items[0];
153 item->down = NULL;
155 item->down = menu->items[item_no + 1];
159 if (item->row == menu->item_rows - 1) {
160 neighbour = item->col;
165 neighbour = item->col;
170 if (item->row == menu->item_rows - 1) {
171 neighbour = item->col * menu->item_rows;
176 neighbour = item->col
183 item->down = menu->items[neighbour];
185 item->down = NULL;
191 item->left = item;
192 item->right = item;
194 item->left = NULL;
195 item->right = NULL;
202 item->left =
205 item->left = NULL;
207 item->left = menu->items[item_no - 1];
211 if (item->col == 0) {
219 if (item->col == 0) {
221 * (menu->item_cols - 1) + item->row;
229 item->left = menu->items[neighbour];
231 item->left = NULL;
238 item->right = menu->items[0];
240 item->right = NULL;
242 item->right = menu->items[item_no + 1];
246 if (item->col == menu->item_cols - 1) {
251 neighbour = item->row * menu->item_cols;
256 if (item->col == menu->item_cols - 1) {
257 neighbour = item->row;
262 neighbour = item->row;
268 item->right = menu->items[neighbour];
270 item->right = NULL;
276 * Goto the item pointed to by item and adjust the menu structure
280 _menui_goto_item(MENU *menu, ITEM *item, int new_top_row)
285 if (item == NULL)
299 if (menu->cur_item != item->index) {
304 menu->cur_item = item->index;
305 menu->cur_row = item->row;
306 menu->cur_col = item->col;
379 * index of the item that matched the pattern.
426 * Draw an item in the subwindow complete with appropriate highlighting.
429 _menui_draw_item(MENU *menu, int item)
436 menu->items[item]->row - menu->top_row,
437 menu->items[item]->col * (menu->col_width + 1));
439 if (menu->cur_item == item)
441 if ((menu->items[item]->opts & O_SELECTABLE) != O_SELECTABLE)
449 if ((menu->items[item]->selected == 1) ||
451 (menu->cur_item == item))) {
474 for (j=0; j < menu->items[item]->name.length; j++)
476 menu->items[item]->name.string[j]);
478 pad_len = menu->col_width - menu->items[item]->name.length
481 pad_len -= menu->items[item]->description.length - 1;
484 for (j = 0; j < menu->items[item]->description.length; j++) {
486 menu->items[item]->description.string[j]);
492 menu->items[item]->visible = 1;
502 if ((menu->items[item]->col > 0) &&
503 (menu->items[item]->col < (menu->item_cols - 1))) {
505 menu->items[item]->row - menu->top_row,
506 menu->items[item]->col * (menu->col_width + 1) - 1);
590 * Calculate the widest menu item and stash it in the menu struct.
612 * Redraw the menu on the screen. If the current item has changed then
613 * unhighlight the old item and highlight the new one.
630 /* redo the old item as a normal one. */
633 /* and then redraw the current item */