diff --git a/redo/windows/box.c b/redo/windows/box.c index ebb4f800..cc0a9893 100644 --- a/redo/windows/box.c +++ b/redo/windows/box.c @@ -122,7 +122,6 @@ static void boxRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t wi intmax_t minimumWidth, minimumHeight; uiWindowsSizing *d; -printf("got here %d %d %d %d\n", (int)x, (int)y, (int)width, (int)height); uiWindowsEnsureMoveWindow(b->hwnd, x, y, width, height); if (b->controls->len == 0) @@ -191,7 +190,7 @@ printf("got here %d %d %d %d\n", (int)x, (int)y, (int)width, (int)height); bc = ptrArrayIndex(b->controls, struct child *, i); //TODO if (!uiControlContainerVisible(bc->c)) //TODO continue; -//TODO childRelayout(bc, x, y, ctrlWidth(bc), ctrlHeight(bc)); + childRelayout(bc, x, y, ctrlWidth(bc), ctrlHeight(bc)); if (b->vertical) y += ctrlHeight(bc) + ypadding; else diff --git a/redo/windows/child.c b/redo/windows/child.c index 1b6adb24..4e1019dc 100644 --- a/redo/windows/child.c +++ b/redo/windows/child.c @@ -46,6 +46,7 @@ struct child *newChildWithTabPage(uiControl *child, uiControl *parent, HWND pare tabpage = newTabPage(); c = newChild(child, parent, tabpage); uiWindowsEnsureSetParent(tabpage, parentHWND); + c->tabpage = tabpage; return c; } diff --git a/redo/windows/tab.c b/redo/windows/tab.c index 7e7761c9..565740a5 100644 --- a/redo/windows/tab.c +++ b/redo/windows/tab.c @@ -104,35 +104,29 @@ static void minimumSize(uiWindowsControl *c, uiWindowsSizing *d, intmax_t *width static void tabRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height) { -/* TODO uiTab *t = uiTab(c); LRESULT n; - uiControl *page; + struct child *page; RECT r; - uiWindowsSizing *dchild; - (*(t->baseResize))(uiControl(t), x, y, width, height, d); + uiWindowsEnsureMoveWindow(t->hwnd, x, y, width, height); n = curpage(t); if (n == (LRESULT) (-1)) return; page = ptrArrayIndex(t->pages, struct child *, n); - dchild = uiControlSizing(uiControl(t)); - // now we need to figure out what rect the child goes - // this rect needs to be in toplevel window coordinates, but TCM_ADJUSTRECT wants a window rect, which is screen coordinates + // this rect needs to be in parent window coordinates, but TCM_ADJUSTRECT wants a window rect, which is screen coordinates r.left = x; r.top = y; r.right = x + width; r.bottom = y + height; - mapWindowRect(dchild->Sys->CoordFrom, NULL, &r); + // TODO use the real parent; see below + mapWindowRect(t->hwnd, NULL, &r); SendMessageW(t->hwnd, TCM_ADJUSTRECT, (WPARAM) FALSE, (LPARAM) (&r)); - mapWindowRect(NULL, dchild->Sys->CoordFrom, &r); + mapWindowRect(NULL, t->hwnd, &r); - uiControlResize(page, r.left, r.top, r.right - r.left, r.bottom - r.top, dchild); - - uiFreeSizing(dchild); -*/ + childRelayout(page, r.left, r.top, r.right - r.left, r.bottom - r.top); } static void tabContainerUpdateState(uiControl *c)