From 7eaadad25ca26c254139e3cdeb31d4cb9eb67f46 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 7 Jan 2015 21:34:12 -0500 Subject: Implemented checkbox notifications. --- wintable/test.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'wintable/test.c') 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; } -- cgit v1.2.3