diff --git a/redo/GNUbase.mk b/redo/GNUbase.mk index 95524c41..f388a961 100644 --- a/redo/GNUbase.mk +++ b/redo/GNUbase.mk @@ -1,5 +1,5 @@ # 22 april 2015 -# TODO figure out why ui.h is being regenerated always +# TODO figure out why ui.h is being regenerated always? and it seems despite that it doesn't affect existing dependencies? OUTBASE = new OUTDIR = out diff --git a/redo/windows/container.c b/redo/windows/container.c index cbcb40d3..f8ecc5a7 100644 --- a/redo/windows/container.c +++ b/redo/windows/container.c @@ -3,8 +3,6 @@ // Code for containers. uiMakeContainer() creates a singleHWND of this window class. -#define containerClass L"libui_uiContainerClass" - static LRESULT CALLBACK containerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { /* TODO diff --git a/redo/windows/control.c b/redo/windows/control.c index 6344e93d..61e71278 100644 --- a/redo/windows/control.c +++ b/redo/windows/control.c @@ -177,9 +177,10 @@ static void singleSysFunc(uiControl *c, uiControlSysFuncParams *p) complain("unknown p->Func %d in singleSysFunc()", p->Func); } -static void singleStartZOrder(uiControl *c, uiControlSysFuncParams *p) +static int singleStartZOrder(uiControl *c, uiControlSysFuncParams *p) { // TODO + return 0; } static LRESULT CALLBACK singleSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) diff --git a/redo/windows/group.c b/redo/windows/group.c index 625bd192..344d6910 100644 --- a/redo/windows/group.c +++ b/redo/windows/group.c @@ -45,7 +45,7 @@ static void groupPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intma { struct group *g = (struct group *) c; - uiControlPreferredSize(uiControl(g->bin), d, width, height); + uiControlPreferredSize(g->child, d, width, height); *width += uiWindowsDlgUnitsToX(groupUnmarginedXMargin, d->Sys->BaseX) * 2; *height += uiWindowsDlgUnitsToY(groupUnmarginedYMarginTop, d->Sys->BaseY) + uiWindowsDlgUnitsToY(groupUnmarginedYMarginBottom, d->Sys->BaseY); } @@ -65,7 +65,7 @@ static void groupComputeChildSize(uiControl *c, intmax_t *x, intmax_t *y, intmax RECT r; if (GetClientRect(g->hwnd, &r) == 0) - logLastError("error getting uiGroup client rect for bin resize in groupResize()"); + logLastError("error getting uiGroup client rect for computing child size in groupResize()"); r.left += uiWindowsDlgUnitsToX(groupUnmarginedXMargin, d->Sys->BaseX); r.top += uiWindowsDlgUnitsToY(groupUnmarginedYMarginTop, d->Sys->BaseY); r.right -= uiWindowsDlgUnitsToX(groupUnmarginedXMargin, d->Sys->BaseX); diff --git a/redo/windows/init.c b/redo/windows/init.c index d546d3c6..4ac11501 100644 --- a/redo/windows/init.c +++ b/redo/windows/init.c @@ -58,7 +58,7 @@ static BOOL WINAPI consoleCtrlHandler(DWORD dwCtrlType) case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: // the handler is run in a separate thread - SendMessageW(initialParent, msgConsoleEndSession, 0, 0); + SendMessageW(utilWindow, msgConsoleEndSession, 0, 0); // we handled it here // this WON'T terminate the program because this is a DLL // at least, that's the best I can gather from the MSDN page on the handler function @@ -90,10 +90,6 @@ const char *uiInit(uiInitOptions *o) if ((si.dwFlags & STARTF_USESHOWWINDOW) != 0) nCmdShow = si.wShowWindow; - ce = initCommonControls(); - if (ce != NULL) - return loadLastError(ce); - hDefaultIcon = LoadIconW(NULL, IDI_APPLICATION); if (hDefaultIcon == NULL) return loadLastError("loading default icon for window classes"); diff --git a/redo/windows/parent.c b/redo/windows/parent.c index 8b71d32e..c7d13e83 100644 --- a/redo/windows/parent.c +++ b/redo/windows/parent.c @@ -108,7 +108,6 @@ BOOL handleParentMessages(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LR { HWND control; NMHDR *nm = (NMHDR *) lParam; - RECT r; switch (uMsg) { case WM_COMMAND: @@ -131,7 +130,7 @@ BOOL handleParentMessages(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LR case WM_CTLCOLORSTATIC: case WM_CTLCOLORBTN: if (parentBrush != NULL) - if (DeleteObject(c->brush) == 0) + if (DeleteObject(parentBrush) == 0) logLastError("error deleting old background brush in containerWndProc()"); if (SetBkMode((HDC) wParam, TRANSPARENT) == 0) logLastError("error setting transparent background mode to controls in containerWndProc()"); diff --git a/redo/windows/resize.c b/redo/windows/resize.c index 8d946dd2..26a65a81 100644 --- a/redo/windows/resize.c +++ b/redo/windows/resize.c @@ -26,7 +26,8 @@ void doResizes(void) uiControl *c, *parent; intmax_t x, y, width, height; uiSizing d; - uiSizngSys sys; + uiSizingSys sys; + HWND hwnd; while (resizes->len != 0) { c = ptrArrayIndex(resizes, uiControl *, 0); @@ -34,7 +35,7 @@ void doResizes(void) parent = uiControlParent(c); if (parent == NULL) // not in a parent; can't resize continue; // this is for uiBox, etc. - d.sys = &sys; + d.Sys = &sys; uiControlGetSizing(parent, &d); uiControlComputeChildSize(parent, &x, &y, &width, &height, &d); uiControlResize(c, x, y, width, height, &d); @@ -75,7 +76,7 @@ void uiWindowsGetSizing(uiControl *c, uiSizing *d) hwnd = (HWND) uiControlHandle(c); - dc = GetDC(c->hwnd); + dc = GetDC(hwnd); if (dc == NULL) logLastError("error getting DC in uiWindowsGetSizing()"); prevfont = (HFONT) SelectObject(dc, hMessageFont); @@ -94,9 +95,9 @@ void uiWindowsGetSizing(uiControl *c, uiSizing *d) if (SelectObject(dc, prevfont) != hMessageFont) logLastError("error restoring previous font into device context in uiWindowsGetSizing()"); - if (ReleaseDC(c->hwnd, dc) == 0) + if (ReleaseDC(hwnd, dc) == 0) logLastError("error releasing DC in uiWindowsGetSizing()"); - d->XPadding = uiWindowsDlgUnitsToX(winXPadding, sys.BaseX); - d->YPadding = uiWindowsDlgUnitsToY(winYPadding, sys.BaseY); + d->XPadding = uiWindowsDlgUnitsToX(winXPadding, d->Sys->BaseX); + d->YPadding = uiWindowsDlgUnitsToY(winYPadding, d->Sys->BaseY); } diff --git a/redo/windows/uipriv_windows.h b/redo/windows/uipriv_windows.h index 4ba05976..60932eed 100644 --- a/redo/windows/uipriv_windows.h +++ b/redo/windows/uipriv_windows.h @@ -89,6 +89,7 @@ extern ATOM registerWindowClass(HICON, HCURSOR); extern void unregisterWindowClass(void); // container.c +#define containerClass L"libui_uiContainerClass" extern ATOM initContainer(HICON, HCURSOR); extern void uninitContainer(void);