ui/win32/container.h

changeset 814
bcb3c7d486f3
parent 813
6d9066951cdb
child 815
7ddf5fb7ec2a
equal deleted inserted replaced
813:6d9066951cdb 814:bcb3c7d486f3
1 /* 1 /*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3 * 3 *
4 * Copyright 2025 Olaf Wintermann. All rights reserved. 4 * Copyright 2025 Olaf Wintermann. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met: 7 * modification, are permitted provided that the following conditions are met:
28 28
29 #ifndef CONTAINER_H 29 #ifndef CONTAINER_H
30 #define CONTAINER_H 30 #define CONTAINER_H
31 31
32 #include "../ui/container.h" 32 #include "../ui/container.h"
33 #include "toolkit.h"
33 #include "grid.h" 34 #include "grid.h"
34 35
35 #ifdef __cplusplus 36 #ifdef __cplusplus
36 extern "C" { 37 extern "C" {
37 #endif 38 #endif
38 39
39 40
41 typedef struct UiGridLayoutContainer UiGridLayoutContainer;
40 42
41 enum UiBoxOrientation { 43 enum UiBoxOrientation {
42 UI_BOX_VERTICAL = 0, 44 UI_BOX_VERTICAL = 0,
43 UI_BOX_HORIZONTAL 45 UI_BOX_HORIZONTAL
44 }; 46 };
63 struct UiContainerPrivate { 65 struct UiContainerPrivate {
64 UiContainerX container; 66 UiContainerX container;
65 HWND (*parent)(UiContainerPrivate*); 67 HWND (*parent)(UiContainerPrivate*);
66 void (*add)(UiContainerPrivate*, W32Widget*, UiLayout*); 68 void (*add)(UiContainerPrivate*, W32Widget*, UiLayout*);
67 UiContainerType type; 69 UiContainerType type;
68 UiLayout layout; 70 HWND hwnd;
69 }; 71 };
70 72
71 struct UiGridLayoutContainer { 73 struct UiGridLayoutContainer {
72 UiContainerPrivate container; 74 UiContainerPrivate container;
73 UiGridLayout layout; 75 UiGridLayout layout;
74 int x; 76 int x;
75 int y; 77 int y;
76 }; 78 };
77 79
80 UiContainerPrivate* ui_obj_container(UiObject *obj);
81 HWND ui_container_get_parent(UiContainerPrivate *ctn);
82 void ui_container_add(UiContainerPrivate *ctn, W32Widget *widget, UiLayout *layout);
83
84 UiContainerX* ui_grid_container_create(UiObject *obj, HWND hwnd, short padding_top, short padding_bottom, short padding_left, short padding_right);
85 void ui_grid_container_add(UiContainerPrivate *ctn, W32Widget *widget, UiLayout *layout);
86
78 #ifdef __cplusplus 87 #ifdef __cplusplus
79 } 88 }
80 #endif 89 #endif
81 90
82 #endif //CONTAINER_H 91 #endif //CONTAINER_H

mercurial