diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-30 10:42:59 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-30 10:42:59 -0400 |
| commit | 071ebcf5be6a0c62f502901e1713cc7ba82fac47 (patch) | |
| tree | 64021d17c122e53d6223a3221b4a1662b96b3292 /basicctrls_windows.c | |
| parent | cedb545e5cd14b8900a28918a04055d145e20d28 (diff) | |
Fixed Windows Spinbox sizing for now.
Diffstat (limited to 'basicctrls_windows.c')
| -rw-r--r-- | basicctrls_windows.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/basicctrls_windows.c b/basicctrls_windows.c index b75633e..eefd4f8 100644 --- a/basicctrls_windows.c +++ b/basicctrls_windows.c @@ -161,5 +161,27 @@ void setGroupSubclass(HWND hwnd, void *data) xpanic("error subclassing Group to give it its own event handler", GetLastError()); } -// provided for cgo's benefit -LPWSTR xUPDOWN_CLASSW = UPDOWN_CLASSW; +HWND newUpDown(HWND prevUpDown) +{ + HWND hwnd; + HWND parent; + + parent = msgwin; // for the first up-down + if (prevUpDown != NULL) { + parent = GetParent(prevUpDown); + if (parent == NULL) + xpanic("error getting parent of old up-down in Spinbox resize for new up-down", GetLastError()); + if (DestroyWindow(prevUpDown) == 0) + xpanic("error destroying previous up-down in Spinbox resize", GetLastError()); + } + hwnd = CreateWindowExW(0, + UPDOWN_CLASSW, L"", + // no WS_VISIBLE; we set visibility ourselves + WS_CHILD | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_HOTTRACK | UDS_NOTHOUSANDS | UDS_SETBUDDYINT, + // this is important; it's necessary for autosizing to work + 0, 0, 0, 0, + parent, NULL, hInstance, NULL); + if (hwnd == NULL) + xpanic("error creating up-down control for Spinbox", GetLastError()); + return hwnd; +} |
