Partial uiTab rewiring.
This commit is contained in:
parent
4714bbacd5
commit
5ea3307027
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue