/* ========================== Menu_AddItem ========================== */ void Menu_AddItem (menuframework_s *menu, void *item) { int i; menulist_s *list; if (menu->nitems == 0) menu->nslots = 0; if (menu->nitems < MAXMENUITEMS) { menu->items[menu->nitems] = item; ( (menucommon_s *)menu->items[menu->nitems] )->parent = menu; menu->nitems++; } menu->nslots = Menu_TallySlots(menu); list = (menulist_s *)item; switch (list->generic.type) { case MTYPE_SPINCONTROL: for (i=0; list->itemnames[i]; i++); list->numitemnames = i; break; } }
void Menu_AddItem(menuframework_s * menu, void *item) { if (menu->nitems == 0) menu->nslots = 0; if (menu->nitems < MAXMENUITEMS) { menu->items[menu->nitems] = item; ((menucommon_s *) menu->items[menu->nitems])->parent = menu; menu->nitems++; } menu->nslots = Menu_TallySlots(menu); }