Fixed build issues. Now I just need to hook resizing into uiWindow and implement a control and we'll be set...

This commit is contained in:
Pietro Gagliardi 2015-04-07 03:12:34 -04:00
parent a3c26ff652
commit c404590960
5 changed files with 13 additions and 4 deletions

View File

@ -84,7 +84,7 @@ uiInitError *uiInit(uiInitOptions *o)
// give each control a reasonable initial parent
// don't free the initial parent!
// TODO tune this better; it shouldn't be closed, for instance
initialParent = uiWindowHandle(uiNewWindow("", 0, 0));
initialParent = (HWND) uiWindowHandle(uiNewWindow("", 0, 0));
uiFree(err);
return NULL;

View File

@ -100,7 +100,7 @@ uiControl *uiWindowsNewControl(uiWindowsNewControlParams *p)
c->onCommandNotifyData = p->onCommandNotifyData;
c->preferredSize = p->preferredSize;
if ((*fv_SetWindowSubclass)(c->hwnd, singleSubclassProc, 0, c) == FALSE)
if ((*fv_SetWindowSubclass)(c->hwnd, singleSubclassProc, 0, (DWORD_PTR) c) == FALSE)
logLastError("error subclassing Windows control in uiWindowsNewControl()");
return (uiControl *) c;

View File

@ -24,4 +24,6 @@ void uiWindowShow(uiWindow *);
void uiWindowHide(uiWindow *);
void uiWindowOnClosing(uiWindow *, int (*)(uiWindow *, void *), void *);
typedef struct uiControl uiControl;
#endif

View File

@ -36,6 +36,13 @@ enum {
msgNOTIFY,
};
// TODO move this to the right place
struct uiSizing {
int baseX;
int baseY;
LONG internalLeading;
};
// alloc_windows.c
extern void *uiAlloc(size_t);
// TODO use this in existing files

View File

@ -14,7 +14,7 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA
{
uiWindow *w;
CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam;
LRESULT lr;
LRESULT lResult;
w = (uiWindow *) GetWindowLongPtrW(hwnd, GWLP_USERDATA);
if (w == NULL) {
@ -23,7 +23,7 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA
// fall through to DefWindowProc() anyway
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
if (sharedWindowProc(hwnd, uMsg, wParam, lParam, &lResult) != FALSE)
if (sharedWndProc(hwnd, uMsg, wParam, lParam, &lResult) != FALSE)
return lResult;
switch (uMsg) {
case WM_CLOSE: