| 47 bool vfill; |
54 bool vfill; |
| 48 } GridLayoutInfo; |
55 } GridLayoutInfo; |
| 49 |
56 |
| 50 typedef struct GridElm { |
57 typedef struct GridElm { |
| 51 W32Widget *widget; |
58 W32Widget *widget; |
| 52 int posx; |
|
| 53 int posy; |
|
| 54 int width; |
|
| 55 int height; |
|
| 56 short gridx; |
59 short gridx; |
| 57 short gridy; |
60 short gridy; |
| 58 GridLayoutInfo layout; |
61 GridLayoutInfo layout; |
| 59 } GridElm; |
62 } GridElm; |
| 60 |
63 |
| 61 typedef struct UiGridLayout { |
64 typedef struct UiGridLayout { |
| 62 HWND hwnd; |
65 HWND hwnd; |
| 63 |
66 |
| 64 short padding_top; |
67 GridEdgeInsets padding; |
| 65 short padding_bottom; |
|
| 66 short padding_left; |
|
| 67 short padding_right; |
|
| 68 short columnspacing; |
68 short columnspacing; |
| 69 short rowspacing; |
69 short rowspacing; |
| |
70 |
| |
71 int preferred_width; |
| |
72 int preferred_height; |
| 70 |
73 |
| 71 /* |
74 /* |
| 72 * list element type: GridElm |
75 * list element type: GridElm |
| 73 */ |
76 */ |
| 74 CxList *widgets; |
77 CxList *widgets; |
| 75 |
78 |
| |
79 int max_column; |
| |
80 int max_row; |
| |
81 |
| 76 } UiGridLayout; |
82 } UiGridLayout; |
| 77 |
83 |
| 78 UiGridLayout* ui_grid_container(const CxAllocator *a, HWND control, short padding, short columnspacing, short rowspacing); |
84 typedef struct GridDef { |
| |
85 int size; |
| |
86 int pos; |
| |
87 int preferred_size; |
| |
88 BOOLEAN expand; |
| |
89 } GridDef; |
| |
90 |
| |
91 UiGridLayout* ui_grid_layout_create(const CxAllocator *a, HWND control, short columnspacing, short rowspacing); |
| 79 |
92 |
| 80 void ui_grid_add_widget( |
93 void ui_grid_add_widget( |
| 81 UiGridLayout *grid, |
94 UiGridLayout *grid, |
| 82 short x, |
95 short x, |
| 83 short y, |
96 short y, |
| 84 W32Widget *widget, |
97 W32Widget *widget, |
| 85 GridLayoutInfo *layout); |
98 GridLayoutInfo *layout); |
| 86 |
99 |
| 87 void ui_grid_layout(UiGridLayout *grid); |
100 void ui_grid_layout(UiGridLayout *grid, int width, int height); |
| 88 |
101 |
| 89 #endif //GRID_H |
102 #endif //GRID_H |