Partial uiTab rewiring.

This commit is contained in:
Pietro Gagliardi 2015-09-01 09:39:25 -04:00
parent 4714bbacd5
commit 5ea3307027
3 changed files with 9 additions and 15 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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)