diff --git a/redo/windows/tab.c b/redo/windows/tab.c index 54c4f80b..41d320b2 100644 --- a/redo/windows/tab.c +++ b/redo/windows/tab.c @@ -80,7 +80,7 @@ static void tabResize(uiControl *c, intmax_t x, intmax_t y, intmax_t width, intm { struct tab *t = (struct tab *) c; LRESULT n; - struct tabPage *page; + uiControl *page; RECT r; uiSizing *dchild; @@ -88,7 +88,7 @@ static void tabResize(uiControl *c, intmax_t x, intmax_t y, intmax_t width, intm n = curpage(t); if (n == (LRESULT) (-1)) return; - page = ptrArrayIndex(t->pages, struct tabPage *, n); + page = ptrArrayIndex(t->pages, uiControl *, n); dchild = uiControlSizing(uiControl(t)); @@ -102,13 +102,15 @@ static void tabResize(uiControl *c, intmax_t x, intmax_t y, intmax_t width, intm SendMessageW(t->hwnd, TCM_ADJUSTRECT, (WPARAM) FALSE, (LPARAM) (&r)); mapWindowRect(NULL, dchild->Sys->CoordFrom, &r); +/*TODO if (page->margined) { r.left += uiWindowsDlgUnitsToX(tabMargin, d->Sys->BaseX); r.top += uiWindowsDlgUnitsToY(tabMargin, d->Sys->BaseY); r.right -= uiWindowsDlgUnitsToX(tabMargin, d->Sys->BaseX); r.bottom -= uiWindowsDlgUnitsToY(tabMargin, d->Sys->BaseY); } - uiControlResize(page->control, r.left, r.top, r.right - r.left, r.bottom - r.top, dchild); +*/ + uiControlResize(page, r.left, r.top, r.right - r.left, r.bottom - r.top, dchild); uiFreeSizing(dchild); } diff --git a/redo/windows/tabpage.c b/redo/windows/tabpage.c index c9508c7d..98f75483 100644 --- a/redo/windows/tabpage.c +++ b/redo/windows/tabpage.c @@ -1,5 +1,5 @@ // 30 may 2015 -#include "uicontrol_windows.h" +#include "uipriv_windows.h" // This is a special internal control type that handles tab pages. // This doesn't use the container class, but rather a subclassed WC_DIALOG, as that supports tab textures properly. @@ -33,7 +33,7 @@ uiControl *newTabPage(uiControl *child) t = (struct tabPage *) uiWindowsNewSingleHWNDControl(tabPageType()); t->hwnd = uiWindowsUtilCreateControlHWND(WS_EX_CONTROLPARENT, - WC_DIALOGW, L"", + WC_DIALOG, L"", 0, hInstance, NULL, FALSE); @@ -44,10 +44,12 @@ uiControl *newTabPage(uiControl *child) // TODO subclass hwnd to handle events + // needs to be done here, otherwise the uiControlSetParent() below will crash + // TODO split into separate functions + uiControl(t)->Handle = tabPageHandle; + t->control = child; uiControlSetParent(t->control, uiControl(t)); - uiControl(t)->Handle = tabPageHandle; - return uiControl(t); }