ui/win32/grid.c

changeset 813
6d9066951cdb
parent 667
35c64574f862
child 815
7ddf5fb7ec2a
equal deleted inserted replaced
812:29c19fcae088 813:6d9066951cdb
29 #include "grid.h" 29 #include "grid.h"
30 30
31 #include "../../ucx/cx/array_list.h" 31 #include "../../ucx/cx/array_list.h"
32 #include "../common/context.h" 32 #include "../common/context.h"
33 33
34 UiGridLayout* ui_grid_container(UiObject *obj, HWND control, short padding, short columnspacing, short rowspacing) { 34 UiGridLayout* ui_grid_container(const CxAllocator *a, HWND control, short padding, short columnspacing, short rowspacing) {
35 UiGridLayout *grid = cxZalloc(obj->ctx->allocator, sizeof(UiGridLayout)); 35 UiGridLayout *grid = cxZalloc(a, sizeof(UiGridLayout));
36 grid->hwnd = control; 36 grid->hwnd = control;
37 grid->widgets = cxArrayListCreate(obj->ctx->allocator, NULL, sizeof(GridElm), 32); 37 grid->widgets = cxArrayListCreate(a, NULL, sizeof(GridElm), 32);
38 grid->padding = padding; 38 grid->padding = padding;
39 grid->columnspacing = columnspacing; 39 grid->columnspacing = columnspacing;
40 grid->rowspacing = rowspacing; 40 grid->rowspacing = rowspacing;
41 return grid; 41 return grid;
42 } 42 }
48 W32Widget *widget, 48 W32Widget *widget,
49 GridLayoutInfo *layout) 49 GridLayoutInfo *layout)
50 { 50 {
51 GridElm elm; 51 GridElm elm;
52 elm.widget = widget; 52 elm.widget = widget;
53 elm.x = x; 53 elm.posx = 0;
54 elm.y = y; 54 elm.posy = 0;
55 elm.width = 0;
56 elm.height = 0;
57 elm.gridx = x;
58 elm.gridy = y;
55 elm.layout = *layout; 59 elm.layout = *layout;
56 cxListAdd(grid->widgets, elm); 60 cxListAdd(grid->widgets, &elm);
57 } 61 }
58 62
59 void ui_grid_layout(UiGridLayout *grid) { 63 void ui_grid_layout(UiGridLayout *grid) {
60 // TODO 64 // TODO
61 } 65 }

mercurial