Home | History | Annotate | Download | only in libmenu

Lines Matching refs:menu

32 #include <menu.h>
38 * The guts of the menu library. This function processes the character
46 menu_driver(MENU *menu, int c)
53 if (menu == NULL)
55 if (menu->posted == 0)
57 if (menu->items == NULL)
59 if (*menu->items == NULL)
61 if (menu->in_init == 1)
65 if (menu->items[menu->cur_item] == NULL)
68 drv_new_item = menu->items[menu->cur_item];
69 it = menu->cur_item;
70 drv_top_row = menu->top_row;
80 && (menu->pattern == NULL))
82 free(menu->pattern);
83 menu->pattern = NULL;
84 menu->plen = 0;
85 menu->match_len = 0;
109 if ((drv_top_row + menu->rows - 1)> menu->item_rows)
114 drv_scroll = menu->item_rows - menu->rows
115 - menu->top_row;
116 if (drv_scroll > menu->rows) {
117 drv_scroll = menu->rows;
129 if (menu->rows < menu->top_row) {
130 drv_scroll = menu->rows;
132 drv_scroll = menu->top_row;
142 drv_new_item = menu->items[0];
145 drv_new_item = menu->items[menu->item_count - 1];
148 if ((menu->cur_item + 1) >= menu->item_count) {
149 if ((menu->opts & O_NONCYCLIC)
153 drv_new_item = menu->items[0];
157 menu->items[menu->cur_item + 1];
161 if (menu->cur_item == 0) {
162 if ((menu->opts & O_NONCYCLIC)
166 drv_new_item = menu->items[
167 menu->item_count - 1];
171 menu->items[menu->cur_item - 1];
175 if ((menu->opts & (O_RADIO | O_ONEVALUE)) != 0) {
176 if ((menu->opts & O_RADIO) == O_RADIO) {
186 for (i = 0; i < menu->item_count; i++) {
187 if ((menu->items[i]->selected) &&
189 menu->items[i]->selected ^= 1;
190 _menui_draw_item(menu,
191 menu->items[i]->index);
197 _menui_draw_item(menu, drv_new_item->index);
206 /* update item in menu */
207 _menui_draw_item(menu,
219 if (menu->pattern == NULL)
222 if (menu->plen == 0)
224 menu->pattern[menu->plen--] = '\0';
227 if (menu->pattern == NULL)
230 status = _menui_match_pattern(menu, 0,
233 drv_new_item = menu->items[it];
236 if (menu->pattern == NULL)
239 status = _menui_match_pattern(menu, 0,
242 drv_new_item = menu->items[it];
250 status = _menui_match_pattern(menu, (unsigned char) c,
252 drv_new_item = menu->items[it];
260 if ((drv_new_item->index == menu->cur_item)
261 && ((menu->opts & O_SHOWMATCH) == O_SHOWMATCH)) {
262 pos_menu_cursor(menu);
275 if (drv_new_item->row >= (drv_top_row + menu->rows))
276 drv_top_row = drv_new_item->row - menu->rows + 1;
278 if ((drv_new_item->index != menu->cur_item)
279 || (drv_top_row != menu->top_row))
280 _menui_goto_item(menu, drv_new_item, drv_top_row);