ui/winui/table.cpp

changeset 26
40d6af793c1a
parent 18
af411868ab9b
equal deleted inserted replaced
25:915131bc3233 26:40d6af793c1a
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