From a7293951f75d92a80d4d986ec7dda3fa25ab640b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 7 Apr 2015 04:02:21 -0400 Subject: Wrote up the initial uiButton implementation. It (mostly; just needs text and for that I need to add a uiControlHandle()) works! --- new/newcontrol_windows.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'new/newcontrol_windows.c') diff --git a/new/newcontrol_windows.c b/new/newcontrol_windows.c index f301a54..c26cbab 100644 --- a/new/newcontrol_windows.c +++ b/new/newcontrol_windows.c @@ -10,6 +10,7 @@ struct uiSingleHWNDControl { BOOL (*onWM_NOTIFY)(uiControl *, WPARAM, LPARAM, void *, LRESULT *); void *onCommandNotifyData; void (*preferredSize)(uiControl *, int, int, LONG, intmax_t *, intmax_t *); + void *data; }; #define S(c) ((uiSingleHWNDControl *) (c)) @@ -100,8 +101,15 @@ uiControl *uiWindowsNewControl(uiWindowsNewControlParams *p) c->onCommandNotifyData = p->onCommandNotifyData; c->preferredSize = p->preferredSize; + c->data = p->data; + if ((*fv_SetWindowSubclass)(c->hwnd, singleSubclassProc, 0, (DWORD_PTR) c) == FALSE) logLastError("error subclassing Windows control in uiWindowsNewControl()"); return (uiControl *) c; } + +void *uiWindowsControlData(uiControl *c) +{ + return S(c)->data; +} -- cgit v1.2.3