ui/wpf/container.c

changeset 101
1c943d43fa81
parent 88
04c81be1c5a0
child 136
1df2fb3d079c
--- a/ui/wpf/container.c	Sun Jan 17 19:19:28 2016 +0100
+++ b/ui/wpf/container.c	Wed Jan 20 11:35:01 2016 +0100
@@ -35,7 +35,7 @@
 UIWIDGET ui_vbox(UiObject *obj) {
     UiContainer *ct = uic_get_current_container(obj);
     
-    UIWIDGET *vbox = UIvbox(ct);
+    UIWIDGET vbox = UIvbox(ct);
     
     UiObject *newobj = uic_object_new(obj, vbox);
     newobj->container = (UiContainer*)vbox;
@@ -47,7 +47,7 @@
 UIWIDGET ui_hbox(UiObject *obj) {
     UiContainer *ct = uic_get_current_container(obj);
     
-    UIWIDGET *hbox = UIhbox(ct);
+    UIWIDGET hbox = UIhbox(ct);
     
     UiObject *newobj = uic_object_new(obj, hbox);
     newobj->container = (UiContainer*)hbox;
@@ -56,6 +56,21 @@
     return hbox;
 }
 
+UIWIDGET ui_grid(UiObject *obj) {
+    return ui_grid_sp(obj, 0, 0, 0);
+}
+
+UIWIDGET ui_grid_sp(UiObject *obj, int margin, int columnspacing, int rowspacing) {
+    UiContainer *ct = uic_get_current_container(obj);
+    
+    UIWIDGET grid = UIgrid(ct, margin, columnspacing, rowspacing);
+    
+    UiObject *newobj = uic_object_new(obj, grid);
+    newobj->container = (UiContainer*)grid;
+    uic_obj_add(obj, newobj);
+    
+    return grid;
+}
 
 /*
  * -------------------- Layout Functions --------------------
@@ -69,7 +84,17 @@
     UIlayout_fill(ct, fill);
 }
 
+void ui_layout_hexpand(UiObject *obj, UiBool expand) {
+    UiContainer *ct = uic_get_current_container(obj);
+    UIlayout_hexpand(ct, expand);
+}
+
+void ui_layout_vexpand(UiObject *obj, UiBool expand) {
+    UiContainer *ct = uic_get_current_container(obj);
+    UIlayout_vexpand(ct, expand);
+}
+
 void ui_newline(UiObject *obj) {
     UiContainer *ct = uic_get_current_container(obj);
-    
+    UIlayout_newline(ct);
 }
\ No newline at end of file

mercurial