More compiler error fixes and TODOs.

This commit is contained in:
Pietro Gagliardi 2015-05-16 01:55:34 -04:00
parent 5f92f8a78b
commit d5a87a0be5
8 changed files with 15 additions and 19 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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()");

View File

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

View File

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