31 |
31 |
32 #include "container.h" |
32 #include "container.h" |
33 #include "../common/object.h" |
33 #include "../common/object.h" |
34 |
34 |
35 UIWIDGET ui_vbox(UiObject *obj) { |
35 UIWIDGET ui_vbox(UiObject *obj) { |
|
36 return ui_vbox_sp(obj, 0, 0); |
|
37 } |
|
38 |
|
39 UIWIDGET ui_hbox(UiObject *obj) { |
|
40 return ui_hbox_sp(obj, 0, 0); |
|
41 } |
|
42 |
|
43 UIWIDGET ui_vbox_sp(UiObject *obj, int margin, int spacing) { |
36 UiContainer *ct = uic_get_current_container(obj); |
44 UiContainer *ct = uic_get_current_container(obj); |
37 |
45 |
38 UIWIDGET vbox = UIvbox(ct); |
46 UIWIDGET vbox = UIvbox(ct, margin, spacing); |
39 |
47 |
40 UiObject *newobj = uic_object_new(obj, vbox); |
48 UiObject *newobj = uic_object_new(obj, vbox); |
41 newobj->container = (UiContainer*)vbox; |
49 newobj->container = (UiContainer*)vbox; |
42 uic_obj_add(obj, newobj); |
50 uic_obj_add(obj, newobj); |
43 |
51 |
44 return vbox; |
52 return vbox; |
45 } |
53 } |
46 |
54 |
47 UIWIDGET ui_hbox(UiObject *obj) { |
55 UIWIDGET ui_hbox_sp(UiObject *obj, int margin, int spacing) { |
48 UiContainer *ct = uic_get_current_container(obj); |
56 UiContainer *ct = uic_get_current_container(obj); |
49 |
57 |
50 UIWIDGET hbox = UIhbox(ct); |
58 UIWIDGET hbox = UIhbox(ct, margin, spacing); |
51 |
59 |
52 UiObject *newobj = uic_object_new(obj, hbox); |
60 UiObject *newobj = uic_object_new(obj, hbox); |
53 newobj->container = (UiContainer*)hbox; |
61 newobj->container = (UiContainer*)hbox; |
54 uic_obj_add(obj, newobj); |
62 uic_obj_add(obj, newobj); |
55 |
63 |
69 newobj->container = (UiContainer*)grid; |
77 newobj->container = (UiContainer*)grid; |
70 uic_obj_add(obj, newobj); |
78 uic_obj_add(obj, newobj); |
71 |
79 |
72 return grid; |
80 return grid; |
73 } |
81 } |
|
82 |
|
83 UIWIDGET ui_scrolledwindow(UiObject *obj) { |
|
84 UiContainer *ct = uic_get_current_container(obj); |
|
85 |
|
86 UIWIDGET scrolledwindow = UIscrolledwindow(ct); |
|
87 |
|
88 UiObject *newobj = uic_object_new(obj, scrolledwindow); |
|
89 newobj->container = (UiContainer*)scrolledwindow; |
|
90 uic_obj_add(obj, newobj); |
|
91 |
|
92 return scrolledwindow; |
|
93 } |
|
94 |
|
95 /* |
|
96 * TODO: sidebar |
|
97 */ |
|
98 |
|
99 UIWIDGET ui_tabview(UiObject *obj) { |
|
100 UiContainer *ct = uic_get_current_container(obj); |
|
101 |
|
102 UIWIDGET tabview = UItabview(ct); |
|
103 |
|
104 UiObject *newobj = uic_object_new(obj, tabview); |
|
105 newobj->container = (UiContainer*)tabview; |
|
106 uic_obj_add(obj, newobj); |
|
107 |
|
108 return tabview; |
|
109 } |
|
110 |
|
111 void ui_tab(UiObject *obj, char *title) { |
|
112 UiContainer *ct = uic_get_current_container(obj); |
|
113 UItab(ct, title); |
|
114 } |
|
115 |
74 |
116 |
75 /* |
117 /* |
76 * -------------------- Layout Functions -------------------- |
118 * -------------------- Layout Functions -------------------- |
77 * |
119 * |
78 * functions for setting layout attributes for the current container |
120 * functions for setting layout attributes for the current container |