| 93 |
93 |
| 94 |
94 |
| 95 |
95 |
| 96 /* -------------------- public container functions --------------------- */ |
96 /* -------------------- public container functions --------------------- */ |
| 97 |
97 |
| 98 static UIWIDGET ui_box_create(UiObject *obj, UiContainerArgs args, NSUserInterfaceLayoutOrientation orientation) { |
98 static UIWIDGET ui_box_create(UiObject *obj, UiContainerArgs *args, NSUserInterfaceLayoutOrientation orientation) { |
| 99 BoxContainer *box = [[BoxContainer alloc] init:orientation spacing:args.spacing]; |
99 BoxContainer *box = [[BoxContainer alloc] init:orientation spacing:args->spacing]; |
| 100 box.translatesAutoresizingMaskIntoConstraints = false; |
100 box.translatesAutoresizingMaskIntoConstraints = false; |
| 101 |
101 |
| 102 // add box to the parent |
102 // add box to the parent |
| 103 UiLayout layout = UI_INIT_LAYOUT(args); |
103 UiLayout layout = UI_INIT_LAYOUT(args); |
| 104 ui_container_add(obj, box, &layout, TRUE); |
104 ui_container_add(obj, box, &layout, TRUE); |
| 107 uic_object_push_container(obj, ui_create_container(obj, box)); |
107 uic_object_push_container(obj, ui_create_container(obj, box)); |
| 108 |
108 |
| 109 return (__bridge void*)box; |
109 return (__bridge void*)box; |
| 110 } |
110 } |
| 111 |
111 |
| 112 UIWIDGET ui_vbox_create(UiObject *obj, UiContainerArgs args) { |
112 UIWIDGET ui_vbox_create(UiObject *obj, UiContainerArgs *args) { |
| 113 return ui_box_create(obj, args, NSUserInterfaceLayoutOrientationVertical); |
113 return ui_box_create(obj, args, NSUserInterfaceLayoutOrientationVertical); |
| 114 } |
114 } |
| 115 |
115 |
| 116 UIWIDGET ui_hbox_create(UiObject *obj, UiContainerArgs args) { |
116 UIWIDGET ui_hbox_create(UiObject *obj, UiContainerArgs *args) { |
| 117 return ui_box_create(obj, args, NSUserInterfaceLayoutOrientationHorizontal); |
117 return ui_box_create(obj, args, NSUserInterfaceLayoutOrientationHorizontal); |
| 118 } |
118 } |
| 119 |
119 |
| 120 UIWIDGET ui_grid_create(UiObject *obj, UiContainerArgs args) { |
120 UIWIDGET ui_grid_create(UiObject *obj, UiContainerArgs *args) { |
| 121 GridLayout *grid = [[GridLayout alloc] init]; |
121 GridLayout *grid = [[GridLayout alloc] init]; |
| 122 grid.translatesAutoresizingMaskIntoConstraints = false; |
122 grid.translatesAutoresizingMaskIntoConstraints = false; |
| 123 |
123 |
| 124 // add box to the parent |
124 // add box to the parent |
| 125 UiLayout layout = UI_INIT_LAYOUT(args); |
125 UiLayout layout = UI_INIT_LAYOUT(args); |