ui/win32/container.h

changeset 813
6d9066951cdb
parent 670
d676b2c5e93b
child 814
bcb3c7d486f3
equal deleted inserted replaced
812:29c19fcae088 813:6d9066951cdb
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #ifndef CONTAINER_H 29 #ifndef CONTAINER_H
30 #define CONTAINER_H
30 31
31 #include "../ui/container.h" 32 #include "../ui/container.h"
33 #include "grid.h"
32 34
33 #define CONTAINER_H 35 #ifdef __cplusplus
36 extern "C" {
37 #endif
34 38
35 #define UI_APPLY_LAYOUT(layout, args) \
36 layout.fill = args->fill; \
37 layout.hexpand = args->hexpand; \
38 layout.vexpand = args->vexpand; \
39 layout.hfill = args->hfill; \
40 layout.vfill = args->vfill; \
41 layout.override_defaults = args->override_defaults; \
42 layout.colspan = args->colspan; \
43 layout.rowspan = args->rowspan
44 39
45 typedef struct UiLayout UiLayout;
46
47 struct UiLayout {
48 UiBool fill;
49 UiBool newline;
50 char *label;
51 UiBool hexpand;
52 UiBool vexpand;
53 UiBool hfill;
54 UiBool vfill;
55 UiBool override_defaults;
56 int width;
57 int colspan;
58 int rowspan;
59 };
60 40
61 enum UiBoxOrientation { 41 enum UiBoxOrientation {
62 UI_BOX_VERTICAL = 0, 42 UI_BOX_VERTICAL = 0,
63 UI_BOX_HORIZONTAL 43 UI_BOX_HORIZONTAL
64 }; 44 };
80 } UiRect; 60 } UiRect;
81 61
82 62
83 struct UiContainerPrivate { 63 struct UiContainerPrivate {
84 UiContainerX container; 64 UiContainerX container;
85 void (*prepare)(UiContainerPrivate*, UiRect*); 65 HWND (*parent)(UiContainerPrivate*);
86 void (*add)(UiContainerPrivate*, UiRect*, W32Widget*); 66 void (*add)(UiContainerPrivate*, W32Widget*, UiLayout*);
87 UiContainerType type; 67 UiContainerType type;
88 UiLayout layout; 68 UiLayout layout;
89 }; 69 };
90 70
71 struct UiGridLayoutContainer {
72 UiContainerPrivate container;
73 UiGridLayout layout;
74 int x;
75 int y;
76 };
77
78 #ifdef __cplusplus
79 }
80 #endif
81
91 #endif //CONTAINER_H 82 #endif //CONTAINER_H

mercurial