diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-09 13:10:32 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-09 13:10:32 -0400 |
| commit | 8b80b8c05d8d1d338b34b46d32b2ed817db27c15 (patch) | |
| tree | 3eff93140a34e43e62dcfce19a9336d288a7d353 | |
| parent | 6d93fce5b5eb26b78d003fc79cd0592f697d75e3 (diff) | |
Implemented uiCheckbox(Set)Checked() on Windows.
| -rw-r--r-- | new/checkbox_windows.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/new/checkbox_windows.c b/new/checkbox_windows.c index ffb78f8..8c04268 100644 --- a/new/checkbox_windows.c +++ b/new/checkbox_windows.c @@ -107,3 +107,23 @@ void uiCheckboxOnToggled(uiControl *c, void (*f)(uiControl *, void *), void *dat cc->onToggled = f; cc->onToggledData = data; } + +int uiCheckboxChecked(uiControl *c) +{ + HWND hwnd; + + hwnd = (HWND) uiControlHandle(c); + return SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED; +} + +void uiCheckboxSetChecked(uiControl *c, int checked) +{ + HWND hwnd; + WPARAM check; + + hwnd = (HWND) uiControlHandle(c); + check = BST_CHECKED; + if (!checked) + check = BST_UNCHECKED; + SendMessage(hwnd, BM_SETCHECK, check, 0); +} |
