Finished Windows conversion. Works perfectly!
This commit is contained in:
parent
924d6d6a7c
commit
d84df8f38f
|
@ -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);
|
||||
}
|
||||
|
|
20
control.c
20
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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 *);
|
||||
|
|
Loading…
Reference in New Issue