diff options
| author | Pietro Gagliardi <[email protected]> | 2015-01-07 21:34:12 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-01-07 21:34:12 -0500 |
| commit | 7eaadad25ca26c254139e3cdeb31d4cb9eb67f46 (patch) | |
| tree | 3dd08bbc3bf2d4e99755d96f09713ffd5670dfbf /wintable/test.c | |
| parent | 10cee922233d33df57e5f6195cb685b59d2bccaa (diff) | |
Implemented checkbox notifications.
Diffstat (limited to 'wintable/test.c')
| -rw-r--r-- | wintable/test.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/wintable/test.c b/wintable/test.c index f09d609..f58a92e 100644 --- a/wintable/test.c +++ b/wintable/test.c @@ -51,6 +51,8 @@ void mainwinResize(HWND hwnd, UINT state, int cx, int cy) MoveWindow(tablehwnd, 0, 0, cx, cy, TRUE); } +BOOL checkboxstates[100]; + LRESULT CALLBACK mainwndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { NMHDR *nmhdr = (NMHDR *) lParam; @@ -58,6 +60,8 @@ LRESULT CALLBACK mainwndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) WCHAR *text; int n; + if (uMsg == WM_CREATE) + ZeroMemory(checkboxstates, 100 * sizeof (BOOL)); switch (uMsg) { HANDLE_MSG(hwnd, WM_CREATE, mainwinCreate); HANDLE_MSG(hwnd, WM_SIZE, mainwinResize); @@ -78,7 +82,7 @@ LRESULT CALLBACK mainwndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case tableColumnImage: return (LRESULT) mkbitmap(); case tableColumnCheckbox: - ; // TODO + return (LRESULT) (checkboxstates[nm->row]); } panic("(test program) unreachable"); case tableNotificationFinishedWithCellData: @@ -92,8 +96,9 @@ LRESULT CALLBACK mainwndproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; } return 0; - case tableNotificationToggleCellCheckbox: - ; // TODO + case tableNotificationCellCheckboxToggled: + checkboxstates[nm->row] = !checkboxstates[nm->row]; + return 0; } break; } |
