ui/common/menu.c

changeset 101
7b3a3130be44
parent 100
d2bd73d28ff1
equal deleted inserted replaced
100:d2bd73d28ff1 101:7b3a3130be44
173 void ui_menu_radioitem_create(UiMenuToggleItemArgs args) { 173 void ui_menu_radioitem_create(UiMenuToggleItemArgs args) {
174 UiMenuCheckItem* item = malloc(sizeof(UiMenuCheckItem)); 174 UiMenuCheckItem* item = malloc(sizeof(UiMenuCheckItem));
175 mitem_set_id(&item->item); 175 mitem_set_id(&item->item);
176 item->item.prev = NULL; 176 item->item.prev = NULL;
177 item->item.next = NULL; 177 item->item.next = NULL;
178 item->item.type = UI_MENU_CHECK_ITEM; 178 item->item.type = UI_MENU_RADIO_ITEM;
179 179
180 item->label = nl_strdup(args.label); 180 item->label = nl_strdup(args.label);
181 item->stockid = nl_strdup(args.stockid); 181 item->stockid = nl_strdup(args.stockid);
182 item->icon = nl_strdup(args.icon); 182 item->icon = nl_strdup(args.icon);
183 item->varname = nl_strdup(args.varname); 183 item->varname = nl_strdup(args.varname);
196 item->item.type = UI_MENU_ITEM_LIST; 196 item->item.type = UI_MENU_ITEM_LIST;
197 item->getvalue = args.getvalue; 197 item->getvalue = args.getvalue;
198 item->callback = args.onselect; 198 item->callback = args.onselect;
199 item->userdata = args.onselectdata; 199 item->userdata = args.onselectdata;
200 item->varname = nl_strdup(args.varname); 200 item->varname = nl_strdup(args.varname);
201 item->addseparator = args.addseparator;
201 202
202 add_item((UiMenuItemI*)item); 203 add_item((UiMenuItemI*)item);
203 } 204 }
204 205
205 void ui_menu_checkitemlist_create(UiMenuItemListArgs args) { 206 void ui_menu_checkitemlist_create(UiMenuItemListArgs args) {
323 while(m) { 324 while(m) {
324 UiMenuItemI *next = m->next; 325 UiMenuItemI *next = m->next;
325 free_menuitem(m); 326 free_menuitem(m);
326 m = next; 327 m = next;
327 } 328 }
328 cxListDestroy(builder->current); 329 cxListFree(builder->current);
329 free(builder); 330 free(builder);
330 } 331 }

mercurial