Decided something for how to actually perform a resize for a child control. This solidifies one-HWND-per-control.

This commit is contained in:
Pietro Gagliardi 2016-04-27 12:18:58 -04:00
parent 4866168ecf
commit f83e39e033
2 changed files with 4 additions and 2 deletions

View File

@ -40,6 +40,7 @@ static void windowRelayout(uiWindow *w)
int x, y, width, height;
RECT r;
int mx, my;
HWND child;
if (w->child == NULL)
return;
@ -53,7 +54,8 @@ static void windowRelayout(uiWindow *w)
y += my;
width -= 2 * mx;
height -= 2 * my;
// TODO
child = (HWND) uiControlHandle(w->child);
uiWindowsEnsureMoveWindowDuringResize(child, x, y, width, height);
}
static LRESULT CALLBACK windowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

View File

@ -29,6 +29,6 @@ void uiWindowsEnsureMoveWindowDuringResize(HWND hwnd, intmax_t x, intmax_t y, in
r.top = y;
r.right = x + width;
r.bottom = y + height;
if (SetWindowPos(hwnd, NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOZORDER) == 0)
if (SetWindowPos(hwnd, NULL, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER) == 0)
logLastError(L"error moving window");
}