diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-07 04:02:21 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-07 04:02:21 -0400 |
| commit | a7293951f75d92a80d4d986ec7dda3fa25ab640b (patch) | |
| tree | bf62429cdf82a14d955eaf6c080fa8d415cb2fa7 /new/newcontrol_windows.c | |
| parent | 54dd1f40017dc31cc5f302cf67cd15ecb562daa1 (diff) | |
Wrote up the initial uiButton implementation. It (mostly; just needs text and for that I need to add a uiControlHandle()) works!
Diffstat (limited to 'new/newcontrol_windows.c')
| -rw-r--r-- | new/newcontrol_windows.c | 8 |
1 files changed, 8 insertions, 0 deletions
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; +} |
