33 |
33 |
34 #include "tree.h" |
34 #include "tree.h" |
35 |
35 |
36 #include "container.h" |
36 #include "container.h" |
37 #include "../common/object.h" |
37 #include "../common/object.h" |
|
38 #include "../common/context.h" |
38 #include "../../ucx/utils.h" |
39 #include "../../ucx/utils.h" |
39 |
40 |
40 UIWIDGET ui_table(UiObject *obj, UiList *model, UiModelInfo *modelinfo) { |
41 UIWIDGET ui_table(UiObject *obj, UiList *model, UiModelInfo *modelinfo) { |
41 // TODO: check if modelinfo is complete |
42 // TODO: check if modelinfo is complete |
42 |
43 |
216 UiListSelection *selection = ui_list_selection(sel); |
217 UiListSelection *selection = ui_list_selection(sel); |
217 |
218 |
218 UiEvent e; |
219 UiEvent e; |
219 e.obj = event->obj; |
220 e.obj = event->obj; |
220 e.window = event->obj->window; |
221 e.window = event->obj->window; |
221 e.document = event->obj->document; |
222 e.document = event->obj->ctx->document; |
222 e.eventdata = selection; |
223 e.eventdata = selection; |
223 e.intval = selection->count > 0 ? selection->rows[0] : -1; |
224 e.intval = selection->count > 0 ? selection->rows[0] : -1; |
224 event->activate(&e, event->userdata); |
225 event->activate(&e, event->userdata); |
225 |
226 |
226 free(event->last_selection->rows); |
227 free(event->last_selection->rows); |
236 UiListSelection *selection = ui_list_selection(sel); |
237 UiListSelection *selection = ui_list_selection(sel); |
237 if(!ui_compare_list_selection(selection, event->last_selection)) { |
238 if(!ui_compare_list_selection(selection, event->last_selection)) { |
238 UiEvent e; |
239 UiEvent e; |
239 e.obj = event->obj; |
240 e.obj = event->obj; |
240 e.window = event->obj->window; |
241 e.window = event->obj->window; |
241 e.document = event->obj->document; |
242 e.document = event->obj->ctx->document; |
242 e.eventdata = selection; |
243 e.eventdata = selection; |
243 e.intval = selection->count > 0 ? selection->rows[0] : -1; |
244 e.intval = selection->count > 0 ? selection->rows[0] : -1; |
244 event->selection(&e, event->userdata); |
245 event->selection(&e, event->userdata); |
245 } |
246 } |
246 if(event->last_selection) { |
247 if(event->last_selection) { |