ui/wpf/container.c

changeset 101
1c943d43fa81
parent 88
04c81be1c5a0
child 136
1df2fb3d079c
equal deleted inserted replaced
100:d276306d801f 101:1c943d43fa81
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 UiContainer *ct = uic_get_current_container(obj); 36 UiContainer *ct = uic_get_current_container(obj);
37 37
38 UIWIDGET *vbox = UIvbox(ct); 38 UIWIDGET vbox = UIvbox(ct);
39 39
40 UiObject *newobj = uic_object_new(obj, vbox); 40 UiObject *newobj = uic_object_new(obj, vbox);
41 newobj->container = (UiContainer*)vbox; 41 newobj->container = (UiContainer*)vbox;
42 uic_obj_add(obj, newobj); 42 uic_obj_add(obj, newobj);
43 43
45 } 45 }
46 46
47 UIWIDGET ui_hbox(UiObject *obj) { 47 UIWIDGET ui_hbox(UiObject *obj) {
48 UiContainer *ct = uic_get_current_container(obj); 48 UiContainer *ct = uic_get_current_container(obj);
49 49
50 UIWIDGET *hbox = UIhbox(ct); 50 UIWIDGET hbox = UIhbox(ct);
51 51
52 UiObject *newobj = uic_object_new(obj, hbox); 52 UiObject *newobj = uic_object_new(obj, hbox);
53 newobj->container = (UiContainer*)hbox; 53 newobj->container = (UiContainer*)hbox;
54 uic_obj_add(obj, newobj); 54 uic_obj_add(obj, newobj);
55 55
56 return hbox; 56 return hbox;
57 } 57 }
58 58
59 UIWIDGET ui_grid(UiObject *obj) {
60 return ui_grid_sp(obj, 0, 0, 0);
61 }
62
63 UIWIDGET ui_grid_sp(UiObject *obj, int margin, int columnspacing, int rowspacing) {
64 UiContainer *ct = uic_get_current_container(obj);
65
66 UIWIDGET grid = UIgrid(ct, margin, columnspacing, rowspacing);
67
68 UiObject *newobj = uic_object_new(obj, grid);
69 newobj->container = (UiContainer*)grid;
70 uic_obj_add(obj, newobj);
71
72 return grid;
73 }
59 74
60 /* 75 /*
61 * -------------------- Layout Functions -------------------- 76 * -------------------- Layout Functions --------------------
62 * 77 *
63 * functions for setting layout attributes for the current container 78 * functions for setting layout attributes for the current container
67 void ui_layout_fill(UiObject *obj, UiBool fill) { 82 void ui_layout_fill(UiObject *obj, UiBool fill) {
68 UiContainer *ct = uic_get_current_container(obj); 83 UiContainer *ct = uic_get_current_container(obj);
69 UIlayout_fill(ct, fill); 84 UIlayout_fill(ct, fill);
70 } 85 }
71 86
87 void ui_layout_hexpand(UiObject *obj, UiBool expand) {
88 UiContainer *ct = uic_get_current_container(obj);
89 UIlayout_hexpand(ct, expand);
90 }
91
92 void ui_layout_vexpand(UiObject *obj, UiBool expand) {
93 UiContainer *ct = uic_get_current_container(obj);
94 UIlayout_vexpand(ct, expand);
95 }
96
72 void ui_newline(UiObject *obj) { 97 void ui_newline(UiObject *obj) {
73 UiContainer *ct = uic_get_current_container(obj); 98 UiContainer *ct = uic_get_current_container(obj);
74 99 UIlayout_newline(ct);
75 } 100 }

mercurial