| 26 * POSSIBILITY OF SUCH DAMAGE. |
26 * POSSIBILITY OF SUCH DAMAGE. |
| 27 */ |
27 */ |
| 28 |
28 |
| 29 #include "container.h" |
29 #include "container.h" |
| 30 |
30 |
| |
31 #include "../common/context.h" |
| |
32 |
| |
33 UiContainerPrivate* ui_obj_container(UiObject *obj) { |
| |
34 return (UiContainerPrivate*)obj->container_end; |
| |
35 } |
| |
36 |
| |
37 HWND ui_container_get_parent(UiContainerPrivate *ctn) { |
| |
38 return ctn->parent ? ctn->parent(ctn) : ctn->hwnd; |
| |
39 } |
| |
40 |
| |
41 void ui_container_add(UiContainerPrivate *ctn, W32Widget *widget, UiLayout *layout) { |
| |
42 ctn->add(ctn, widget, layout); |
| |
43 ctn->container.newline = FALSE; |
| |
44 } |
| |
45 |
| 31 |
46 |
| 32 /* ---------------------------- Box Container ---------------------------- */ |
47 /* ---------------------------- Box Container ---------------------------- */ |
| 33 |
48 |
| 34 static UIWIDGET box_create(UiObject *obj, UiContainerArgs *args, UiBoxOrientation orientation) { |
49 static UIWIDGET box_create(UiObject *obj, UiContainerArgs *args, UiBoxOrientation orientation) { |
| 35 return NULL; |
50 return NULL; |
| 44 UIWIDGET ui_hbox_create(UiObject *obj, UiContainerArgs *args) { |
59 UIWIDGET ui_hbox_create(UiObject *obj, UiContainerArgs *args) { |
| 45 return box_create(obj, args, UI_BOX_HORIZONTAL); |
60 return box_create(obj, args, UI_BOX_HORIZONTAL); |
| 46 } |
61 } |
| 47 |
62 |
| 48 |
63 |
| |
64 /* ---------------------------- Grid Container ---------------------------- */ |
| |
65 |
| |
66 UIWIDGET ui_grid_create(UiObject *obj, UiContainerArgs *args) { |
| |
67 return NULL; |
| |
68 } |
| |
69 |
| |
70 UiContainerX* ui_grid_container_create(UiObject *obj, HWND hwnd, short padding_top, short padding_bottom, short padding_left, short padding_right) { |
| |
71 UiGridLayoutContainer *container = cxZalloc(obj->ctx->allocator, sizeof(UiGridLayoutContainer)); |
| |
72 container->container.hwnd = hwnd; |
| |
73 container->container.add = ui_grid_container_add; |
| |
74 return (UiContainerX*)container; |
| |
75 } |
| |
76 |
| |
77 void ui_grid_container_add(UiContainerPrivate *ctn, W32Widget *widget, UiLayout *layout) { |
| |
78 // TODO |
| |
79 } |