ui/ui/container.h

branch
newapi
changeset 190
70fd1b24e395
parent 187
24ce2c326d85
child 193
74c688cc1839
equal deleted inserted replaced
189:4daddc326877 190:70fd1b24e395
33 33
34 #ifdef __cplusplus 34 #ifdef __cplusplus
35 extern "C" { 35 extern "C" {
36 #endif 36 #endif
37 37
38 typedef struct UiContainerArgs {
39 UiTri fill;
40 UiBool hexpand;
41 UiBool vexpand;
42 int colspan;
43 int rowspan;
44
45 int margin;
46 int spacing;
47 int columnspacing;
48 int rowspacing;
49 } UiContainerArgs;
38 50
39 #define UI_CTN(obj, ctn) for(ctn;ui_container_finish(obj);ui_container_begin_close(obj)) 51 #define UI_CTN(obj, ctn) for(ctn;ui_container_finish(obj);ui_container_begin_close(obj))
40 #define UI_VBOX(obj) for(ui_vbox(obj);ui_container_finish(obj);ui_container_begin_close(obj)) 52
41 #define UI_HBOX(obj) for(ui_hbox(obj);ui_container_finish(obj);ui_container_begin_close(obj)) 53 #define ui_vbox(obj, ...) for(ui_vbox_create(obj, (UiContainerArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
42 #define UI_VBOX_SP(obj, margin, spacing) for(ui_vbox_sp(obj,margin,spacing);ui_container_finish(obj);ui_container_begin_close(obj)) 54 #define ui_hbox(obj, ...) for(ui_hbox_create(obj, (UiContainerArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
43 #define UI_HBOX_SP(obj, margin, spacing) for(ui_hbox_sp(obj,margin,spacing);ui_container_finish(obj);ui_container_begin_close(obj)) 55 #define ui_grid(obj, ...) for(ui_grid_create(obj, (UiContainerArgs){ __VA_ARGS__ });ui_container_finish(obj);ui_container_begin_close(obj))
44 #define UI_GRID(obj) for(ui_grid(obj);ui_container_finish(obj);ui_container_begin_close(obj)) 56
45 #define UI_GRID_SP(obj, margin, columnspacing, rowspacing) for(ui_grid_sp(obj,margin,columnspacing,rowspacing);ui_container_finish(obj);ui_container_begin_close(obj))
46
47 57
48 void ui_end(UiObject *obj); 58 void ui_end(UiObject *obj);
49 59
50 UIWIDGET ui_vbox(UiObject *obj); 60 UIWIDGET ui_vbox_create(UiObject *obj, UiContainerArgs args);
51 UIWIDGET ui_hbox(UiObject *obj); 61 UIWIDGET ui_hbox_create(UiObject *obj, UiContainerArgs args);
52 UIWIDGET ui_vbox_sp(UiObject *obj, int margin, int spacing);
53 UIWIDGET ui_hbox_sp(UiObject *obj, int margin, int spacing);
54 62
55 UIWIDGET ui_grid(UiObject *obj); 63 UIWIDGET ui_grid_create(UiObject *obj, UiContainerArgs args);
56 UIWIDGET ui_grid_sp(UiObject *obj, int margin, int columnspacing, int rowspacing);
57 64
58 UIWIDGET ui_scrolledwindow(UiObject *obj); 65 UIWIDGET ui_scrolledwindow(UiObject *obj);
59 66
60 UIWIDGET ui_sidebar(UiObject *obj); 67 UIWIDGET ui_sidebar(UiObject *obj);
61 68

mercurial