static VALUE rbncurs_c_menu_sub(VALUE rb_menu) { MENU *menu = get_menu(rb_menu); return wrap_window(menu_sub(menu)); }
/** * Navigate state. * Navigates the menu structure using the following buttons: * - up => go to previous item * - down => go to next item * - left => go to parent item * - right => go to child item */ static QState mmi_navigate(struct mmi_ao *me) { switch (Q_SIG(me)) { case Q_ENTRY_SIG: update_screen(me); return Q_HANDLED(); case Q_EXIT_SIG: return Q_HANDLED(); case SIG_ENCODER: switch (menu_cur->typ) { case MENU_TYP_PARAM: if (modify_param(menu_cur->param, Q_PAR(me), me->shift)) { print_param(menu_cur->param); if (menu_cur->cmd != CMD_NONE) QActive_post((QActive *) me, SIG_MMI_CMD, menu_cur->cmd); } break; default: break; } return Q_HANDLED(); case SIG_MMI_CMD: return execute_cmd(me, Q_PAR(me)); case SIG_MMI_SHOW_MSG: return Q_TRAN(mmi_show_msg); case SIG_KEY_PRESS: switch (Q_PAR(me)) { case KEY_UP: // Go to previous item if (menu_prev()) update_screen(me); break; case KEY_DOWN: // Go to next item if (menu_next()) update_screen(me); break; case KEY_LEFT: // Go to parent item if (menu_parent()) update_screen(me); break; case KEY_RIGHT: // Go to sub item if (menu_sub()) update_screen(me); break; case KEY_ENTER: me->shift = 1; switch (menu_cur->typ) { case MENU_TYP_CMD: // Execute command if (menu_cur->cmd) QActive_post((QActive *) me, SIG_MMI_CMD, menu_cur->cmd); break; case MENU_TYP_SUB: // Go to sub item if (menu_sub()) update_screen(me); break; default: break; } break; } return Q_HANDLED(); case SIG_KEY_RELEASE: switch (Q_PAR(me)) { case KEY_ENTER: me->shift = 0; default: break; } return Q_HANDLED(); case SIG_PROG_START: return Q_TRAN(mmi_busy); break; } return Q_SUPER(&QHsm_top); }