ui/win32/grid.h

changeset 813
6d9066951cdb
parent 667
35c64574f862
child 814
bcb3c7d486f3
equal deleted inserted replaced
812:29c19fcae088 813:6d9066951cdb
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 #ifndef GRID_H 28 #ifndef GRID_H
29 #define GRID_H 29 #define GRID_H
30 30
31 #include "container.h" 31 #include "../ui/win32.h"
32 #include <stdbool.h> 32 #include <stdbool.h>
33 #include <cx/array_list.h> 33 #include <cx/array_list.h>
34
35 typedef struct GridElm {
36 W32Widget *widget;
37 short x;
38 short y;
39 GridLayoutInfo layout;
40 } GridElm;
41 34
42 typedef struct GridLayoutInfo { 35 typedef struct GridLayoutInfo {
43 short margin_left; 36 short margin_left;
44 short margin_right; 37 short margin_right;
45 short margin_top; 38 short margin_top;
46 short margin_bottom; 39 short margin_bottom;
47 short colspan; 40 short colspan;
48 short rowspan; 41 short rowspan;
49 short preferred_width; 42 int preferred_width;
50 short preferred_height; 43 int preferred_height;
51 bool hexpand; 44 bool hexpand;
52 bool vexpand; 45 bool vexpand;
53 bool hfill; 46 bool hfill;
54 bool vfill; 47 bool vfill;
55 } GridLayoutInfo; 48 } GridLayoutInfo;
49
50 typedef struct GridElm {
51 W32Widget *widget;
52 int posx;
53 int posy;
54 int width;
55 int height;
56 short gridx;
57 short gridy;
58 GridLayoutInfo layout;
59 } GridElm;
56 60
57 typedef struct UiGridLayout { 61 typedef struct UiGridLayout {
58 HWND hwnd; 62 HWND hwnd;
59 63
60 short padding; 64 short padding;
66 */ 70 */
67 CxList *widgets; 71 CxList *widgets;
68 72
69 } UiGridLayout; 73 } UiGridLayout;
70 74
71 UiGridLayout* ui_grid_container(UiObject *obj, HWND control, short padding, short columnspacing, short rowspacing); 75 UiGridLayout* ui_grid_container(const CxAllocator *a, HWND control, short padding, short columnspacing, short rowspacing);
72 76
73 void ui_grid_add_widget( 77 void ui_grid_add_widget(
74 UiGridLayout *grid, 78 UiGridLayout *grid,
75 short x, 79 short x,
76 short y, 80 short y,

mercurial