application/main.c

changeset 821
2aa2f75f8da4
parent 818
8185cd761897
child 822
54e43e4efac2
equal deleted inserted replaced
820:7ce561f92632 821:2aa2f75f8da4
468 case 4: return ui_fileicon(16); 468 case 4: return ui_fileicon(16);
469 case 5: return "file"; 469 case 5: return "file";
470 case 6: return (void*)(intptr_t)123; 470 case 6: return (void*)(intptr_t)123;
471 case 7: return "edit me"; 471 case 7: return "edit me";
472 case 8: return "edit me too"; 472 case 8: return "edit me too";
473 case 9: return (void*)(intptr_t)1;
473 } 474 }
474 return NULL; 475 return NULL;
475 } 476 }
476 477
477 UiBool table_getstyle(UiList *list, void *elm, int row, int col, void *userdata, UiTextStyle *style) { 478 UiBool table_getstyle(UiList *list, void *elm, int row, int col, void *userdata, UiTextStyle *style) {
670 } 671 }
671 ui_newline(obj); 672 ui_newline(obj);
672 } 673 }
673 } 674 }
674 ui_tab(obj, "Tab 1") { 675 ui_tab(obj, "Tab 1") {
675 UiModel *model = ui_model(obj->ctx, UI_ICON_TEXT, "col1", UI_INTEGER, "col2", UI_ICON, "col3", UI_ICON_TEXT, "col4", UI_INTEGER, "col5", UI_STRING_EDITABLE, "edit6", UI_STRING_EDITABLE, "edit7", -1); 676 UiModel *model = ui_model(obj->ctx, UI_ICON_TEXT, "col1", UI_INTEGER, "col2", UI_ICON, "col3", UI_ICON_TEXT, "col4", UI_INTEGER, "col5", UI_STRING_EDITABLE, "edit6", UI_STRING_EDITABLE, "edit7", UI_BOOL_EDITABLE, "Check", -1);
676 model->columnsize[0] = -1; 677 model->columnsize[0] = -1;
677 ui_table(obj, .model = model, .list = doc->list2, .colspan = 2, .fill = TRUE, .contextmenu = menubuilder, .multiselection = TRUE, .fill = TRUE, 678 ui_table(obj, .model = model, .list = doc->list2, .colspan = 2, .fill = TRUE, .contextmenu = menubuilder, .multiselection = TRUE, .fill = TRUE,
678 .getvalue = table_getvalue, .getstyle = table_getstyle, .onsave = list_save, 679 .getvalue = table_getvalue, .getstyle = table_getstyle, .onsave = list_save,
679 .onactivate = action_table_activate, .onactivatedata = "activate", 680 .onactivate = action_table_activate, .onactivatedata = "activate",
680 .onselection = action_table_activate, .onselectiondata = "selection"); 681 .onselection = action_table_activate, .onselectiondata = "selection");

mercurial