| 230 ui_button_args_set_labeltype(args, (int)val->value.integer); |
230 ui_button_args_set_labeltype(args, (int)val->value.integer); |
| 231 } |
231 } |
| 232 |
232 |
| 233 return args; |
233 return args; |
| 234 } |
234 } |
| |
235 |
| |
236 UiToggleArgs* json2toggle_args(const CxJsonValue *value) { |
| |
237 UiToggleArgs *args = ui_toggle_args_new(); |
| |
238 if(value->type != CX_JSON_OBJECT) { |
| |
239 return args; |
| |
240 } |
| |
241 |
| |
242 init_common_args(value, args, &button_args); |
| |
243 init_groups(value, args, (argfunc_set_intarray)ui_button_args_set_groups); |
| |
244 |
| |
245 CxJsonValue *val = cxJsonObjGet(value, "label"); |
| |
246 if(val && val->type == CX_JSON_STRING) { |
| |
247 ui_toggle_args_set_label(args, val->value.string.ptr); |
| |
248 } |
| |
249 |
| |
250 val = cxJsonObjGet(value, "icon"); |
| |
251 if(val && val->type == CX_JSON_STRING) { |
| |
252 ui_toggle_args_set_icon(args, val->value.string.ptr); |
| |
253 } |
| |
254 |
| |
255 val = cxJsonObjGet(value, "tooltip"); |
| |
256 if(val && val->type == CX_JSON_STRING) { |
| |
257 ui_toggle_args_set_tooltip(args, val->value.string.ptr); |
| |
258 } |
| |
259 |
| |
260 val = cxJsonObjGet(value, "labeltype"); |
| |
261 if(val && val->type == CX_JSON_INTEGER) { |
| |
262 ui_toggle_args_set_labeltype(args, (int)val->value.integer); |
| |
263 } |
| |
264 |
| |
265 val = cxJsonObjGet(value, "enable_group"); |
| |
266 if(val && val->type == CX_JSON_INTEGER) { |
| |
267 ui_toggle_args_set_enablegroup(args, (int)val->value.integer); |
| |
268 } |
| |
269 |
| |
270 return args; |
| |
271 } |