summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--new/container_windows.c12
-rw-r--r--new/control.c20
-rw-r--r--new/entry_windows.c4
-rw-r--r--new/newcontrol_windows.c2
-rw-r--r--new/ui.h3
5 files changed, 30 insertions, 11 deletions
diff --git a/new/container_windows.c b/new/container_windows.c
index 2f05711..cf19ad4 100644
--- a/new/container_windows.c
+++ b/new/container_windows.c
@@ -88,12 +88,12 @@ void resize(uiControl *control, HWND parent, RECT r, RECT margin)
logLastError("error restoring previous font into device context in resize()");
if (ReleaseDC(parent, dc) == 0)
logLastError("error releasing DC in resize()");
- r.left += uiDlgUnitToX(margin.left, d.baseX);
- r.top += uiDlgUnitToY(margin.top, d.baseY);
- r.right -= uiDlgUnitToX(margin.right, d.baseX);
- r.bottom -= uiDlgUnitToY(margin.bottom, d.baseY);
- d.xPadding = uiDlgUnitToX(winXPadding, d.baseX);
- d.yPadding = uiDlgUnitToY(winYPadding, d.baseY);
+ r.left += uiDlgUnitToX(margin.left, sys.baseX);
+ r.top += uiDlgUnitToY(margin.top, sys.baseY);
+ r.right -= uiDlgUnitToX(margin.right, sys.baseX);
+ r.bottom -= uiDlgUnitToY(margin.bottom, sys.baseY);
+ d.xPadding = uiDlgUnitToX(winXPadding, sys.baseX);
+ d.yPadding = uiDlgUnitToY(winYPadding, sys.baseY);
d.sys = &sys;
uiControlResize(control, r.left, r.top, r.right - r.left, r.bottom - r.top, &d);
}
diff --git a/new/control.c b/new/control.c
index ad03c49..aab5ea0 100644
--- a/new/control.c
+++ b/new/control.c
@@ -11,4 +11,22 @@ uintptr_t uiControlHandle(uiControl *c)
return (*(c->handle))(c);
}
-// TODO do this for the others
+void uiControlSetParent(uiControl *c, uintptr_t parent)
+{
+ (*(c->setParent))(c, parent);
+}
+
+void uiControlRemoveParent(uiControl *c)
+{
+ (*(c->removeParent))(c);
+}
+
+void uiControlPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height)
+{
+ (*(c->preferredSize))(c, d, width, height);
+}
+
+void uiControlResize(uiControl *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height, uiSizing *d)
+{
+ (*(c->resize))(c, x, y, width, height, d);
+}
diff --git a/new/entry_windows.c b/new/entry_windows.c
index 506df77..23796d9 100644
--- a/new/entry_windows.c
+++ b/new/entry_windows.c
@@ -4,12 +4,12 @@
struct entry {
};
-static BOOL onWM_COMMAND(uiControl *c, WPARAM wParam, LPARAM lParam, void *data, LRESULT *lResult)
+static BOOL onWM_COMMAND(uiControl *c, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
{
return FALSE;
}
-static BOOL onWM_NOTIFY(uiControl *c, WPARAM wParam, LPARAM lParam, void *data, LRESULT *lResult)
+static BOOL onWM_NOTIFY(uiControl *c, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
{
return FALSE;
}
diff --git a/new/newcontrol_windows.c b/new/newcontrol_windows.c
index 3a561c6..d2f4508 100644
--- a/new/newcontrol_windows.c
+++ b/new/newcontrol_windows.c
@@ -3,7 +3,7 @@
typedef struct singleHWND singleHWND;
-struct uiSingleHWNDControl {
+struct singleHWND {
HWND hwnd;
BOOL (*onWM_COMMAND)(uiControl *, WPARAM, LPARAM, LRESULT *);
BOOL (*onWM_NOTIFY)(uiControl *, WPARAM, LPARAM, LRESULT *);
diff --git a/new/ui.h b/new/ui.h
index 82d549b..f54b183 100644
--- a/new/ui.h
+++ b/new/ui.h
@@ -18,10 +18,11 @@ void uiQuit(void);
void uiFreeText(char *);
typedef struct uiSizing uiSizing;
+typedef struct uiSizingSys uiSizingSys;
struct uiSizing {
intmax_t xPadding;
intmax_t yPadding;
- struct uiSizingSys *sys;
+ uiSizingSys *sys;
};
typedef struct uiControl uiControl;