| 84 } |
84 } |
| 85 ui_reset_layout(layout); |
85 ui_reset_layout(layout); |
| 86 current = widget; |
86 current = widget; |
| 87 } |
87 } |
| 88 |
88 |
| 89 UIWIDGET ui_box(UiObject *obj, UiContainerArgs args, QBoxLayout::Direction dir) { |
89 UIWIDGET ui_box(UiObject *obj, UiContainerArgs *args, QBoxLayout::Direction dir) { |
| 90 UiContainerPrivate *ctn = (UiContainerPrivate*)ui_obj_container(obj); |
90 UiContainerPrivate *ctn = (UiContainerPrivate*)ui_obj_container(obj); |
| 91 UI_APPLY_LAYOUT(ctn->layout, args); |
91 UI_APPLY_LAYOUT(ctn->layout, args); |
| 92 |
92 |
| 93 QWidget *widget = new QWidget(); |
93 QWidget *widget = new QWidget(); |
| 94 QBoxLayout *box = new QBoxLayout(dir); |
94 QBoxLayout *box = new QBoxLayout(dir); |
| 98 ui_container_add(obj, new UiBoxContainer(box)); |
98 ui_container_add(obj, new UiBoxContainer(box)); |
| 99 |
99 |
| 100 return widget; |
100 return widget; |
| 101 } |
101 } |
| 102 |
102 |
| 103 UIWIDGET ui_vbox_create(UiObject *obj, UiContainerArgs args) { |
103 UIWIDGET ui_vbox_create(UiObject *obj, UiContainerArgs *args) { |
| 104 return ui_box(obj, args, QBoxLayout::TopToBottom); |
104 return ui_box(obj, args, QBoxLayout::TopToBottom); |
| 105 } |
105 } |
| 106 |
106 |
| 107 UIWIDGET ui_hbox_create(UiObject *obj, UiContainerArgs args) { |
107 UIWIDGET ui_hbox_create(UiObject *obj, UiContainerArgs *args) { |
| 108 return ui_box(obj, args, QBoxLayout::LeftToRight); |
108 return ui_box(obj, args, QBoxLayout::LeftToRight); |
| 109 } |
109 } |
| 110 |
110 |
| 111 |
111 |
| 112 /* -------------------- UiGridContainer -------------------- */ |
112 /* -------------------- UiGridContainer -------------------- */ |
| 231 grid->setRowStretch(y, 1); |
231 grid->setRowStretch(y, 1); |
| 232 grid->addItem(filler, y, 0, 1, 1, 0); |
232 grid->addItem(filler, y, 0, 1, 1, 0); |
| 233 } |
233 } |
| 234 } |
234 } |
| 235 |
235 |
| 236 UIEXPORT UIWIDGET ui_grid_create(UiObject *obj, UiContainerArgs args) { |
236 UIEXPORT UIWIDGET ui_grid_create(UiObject *obj, UiContainerArgs *args) { |
| 237 UiContainerPrivate *ctn = (UiContainerPrivate*)ui_obj_container(obj); |
237 UiContainerPrivate *ctn = (UiContainerPrivate*)ui_obj_container(obj); |
| 238 UI_APPLY_LAYOUT(ctn->layout, args); |
238 UI_APPLY_LAYOUT(ctn->layout, args); |
| 239 |
239 |
| 240 QWidget *widget = new QWidget(); |
240 QWidget *widget = new QWidget(); |
| 241 QGridLayout *grid = new QGridLayout(); |
241 QGridLayout *grid = new QGridLayout(); |
| 242 widget->setLayout(grid); |
242 widget->setLayout(grid); |
| 243 ctn->add(widget, true); |
243 ctn->add(widget, true); |
| 244 |
244 |
| 245 ui_container_add(obj, new UiGridContainer( |
245 ui_container_add(obj, new UiGridContainer( |
| 246 grid, |
246 grid, |
| 247 args.margin, |
247 args->margin, |
| 248 args.columnspacing, |
248 args->columnspacing, |
| 249 args.rowspacing, |
249 args->rowspacing, |
| 250 args.def_hexpand, |
250 args->def_hexpand, |
| 251 args.def_vexpand, |
251 args->def_vexpand, |
| 252 args.def_hfill, |
252 args->def_hfill, |
| 253 args.def_vfill)); |
253 args->def_vfill)); |
| 254 |
254 |
| 255 return widget; |
255 return widget; |
| 256 } |
256 } |
| 257 |
257 |
| 258 |
258 |