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;
|
intmax_t minimumWidth, minimumHeight;
|
||||||
uiWindowsSizing *d;
|
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);
|
uiWindowsEnsureMoveWindow(b->hwnd, x, y, width, height);
|
||||||
|
|
||||||
if (b->controls->len == 0)
|
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);
|
bc = ptrArrayIndex(b->controls, struct child *, i);
|
||||||
//TODO if (!uiControlContainerVisible(bc->c))
|
//TODO if (!uiControlContainerVisible(bc->c))
|
||||||
//TODO continue;
|
//TODO continue;
|
||||||
//TODO childRelayout(bc, x, y, ctrlWidth(bc), ctrlHeight(bc));
|
childRelayout(bc, x, y, ctrlWidth(bc), ctrlHeight(bc));
|
||||||
if (b->vertical)
|
if (b->vertical)
|
||||||
y += ctrlHeight(bc) + ypadding;
|
y += ctrlHeight(bc) + ypadding;
|
||||||
else
|
else
|
||||||
|
|
|
@ -46,6 +46,7 @@ struct child *newChildWithTabPage(uiControl *child, uiControl *parent, HWND pare
|
||||||
tabpage = newTabPage();
|
tabpage = newTabPage();
|
||||||
c = newChild(child, parent, tabpage);
|
c = newChild(child, parent, tabpage);
|
||||||
uiWindowsEnsureSetParent(tabpage, parentHWND);
|
uiWindowsEnsureSetParent(tabpage, parentHWND);
|
||||||
|
c->tabpage = tabpage;
|
||||||
return c;
|
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)
|
static void tabRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t width, intmax_t height)
|
||||||
{
|
{
|
||||||
/* TODO
|
|
||||||
uiTab *t = uiTab(c);
|
uiTab *t = uiTab(c);
|
||||||
LRESULT n;
|
LRESULT n;
|
||||||
uiControl *page;
|
struct child *page;
|
||||||
RECT r;
|
RECT r;
|
||||||
uiWindowsSizing *dchild;
|
|
||||||
|
|
||||||
(*(t->baseResize))(uiControl(t), x, y, width, height, d);
|
uiWindowsEnsureMoveWindow(t->hwnd, x, y, width, height);
|
||||||
n = curpage(t);
|
n = curpage(t);
|
||||||
if (n == (LRESULT) (-1))
|
if (n == (LRESULT) (-1))
|
||||||
return;
|
return;
|
||||||
page = ptrArrayIndex(t->pages, struct child *, n);
|
page = ptrArrayIndex(t->pages, struct child *, n);
|
||||||
|
|
||||||
dchild = uiControlSizing(uiControl(t));
|
|
||||||
|
|
||||||
// now we need to figure out what rect the child goes
|
// 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.left = x;
|
||||||
r.top = y;
|
r.top = y;
|
||||||
r.right = x + width;
|
r.right = x + width;
|
||||||
r.bottom = y + height;
|
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));
|
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);
|
childRelayout(page, r.left, r.top, r.right - r.left, r.bottom - r.top);
|
||||||
|
|
||||||
uiFreeSizing(dchild);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tabContainerUpdateState(uiControl *c)
|
static void tabContainerUpdateState(uiControl *c)
|
||||||
|
|
Loading…
Reference in New Issue