ui/winui/table.cpp

branch
newapi
changeset 248
22257f5f4019
parent 243
9f66c31a27ed
equal deleted inserted replaced
247:4b21af9d8c5a 248:22257f5f4019
109 // bind var 109 // bind var
110 UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.list, args.varname, UI_VAR_LIST); 110 UiVar* var = uic_widget_var(obj->ctx, current->ctx, args.list, args.varname, UI_VAR_LIST);
111 if (var) { 111 if (var) {
112 UiList* list = (UiList*)var->value; 112 UiList* list = (UiList*)var->value;
113 list->update = ui_table_update; 113 list->update = ui_table_update;
114 list->getselection = ui_table_selection;
114 list->obj = uitable; 115 list->obj = uitable;
115 uitable->update(list, 0); 116 uitable->update(list, 0);
116 } 117 }
117 118
118 // create toolkit wrapper object and register destructor 119 // create toolkit wrapper object and register destructor
130 131
131 extern "C" void ui_table_update(UiList * list, int i) { 132 extern "C" void ui_table_update(UiList * list, int i) {
132 UiTable* table = (UiTable*)list->obj; 133 UiTable* table = (UiTable*)list->obj;
133 table->clear(); 134 table->clear();
134 table->update(list, i); 135 table->update(list, i);
136 }
137
138 extern "C" UiListSelection ui_table_selection(UiList * list) {
139 UiTable* table = (UiTable*)list->obj;
140 return table->uiselection();
135 } 141 }
136 142
137 UiTable::UiTable(UiObject *obj, winrt::Microsoft::UI::Xaml::Controls::ScrollViewer scrollW, winrt::Microsoft::UI::Xaml::Controls::Grid grid) { 143 UiTable::UiTable(UiObject *obj, winrt::Microsoft::UI::Xaml::Controls::ScrollViewer scrollW, winrt::Microsoft::UI::Xaml::Controls::Grid grid) {
138 this->obj = obj; 144 this->obj = obj;
139 145

mercurial