Implemented uiCheckbox(Set)Checked() on Windows.

This commit is contained in:
Pietro Gagliardi 2015-04-09 13:10:32 -04:00
parent 6d93fce5b5
commit 8b80b8c05d
1 changed files with 20 additions and 0 deletions

View File

@ -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);
}