From 6b9f1f282fc0aeb2654538a60a6f81dd99421ae1 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 19 Feb 2015 22:33:44 -0500 Subject: [PATCH] Added tableNotificationSelectionChanged on the Windows Table and hooked it up to package ui's Table. --- table_windows.c | 4 +++- wintable/includethis.h | 4 ++++ wintable/select.h | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/table_windows.c b/table_windows.c index dbbcde2..8d92a8e 100644 --- a/table_windows.c +++ b/table_windows.c @@ -30,7 +30,9 @@ static LRESULT CALLBACK tableSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM case tableNotificationCellCheckboxToggled: tableToggled(gotable, tnm->row, tnm->column); return 0; - // TODO selection changed + case tableNotificationSelectionChanged: + tableSelectionChanged(gotable); + return 0; } return (*fv_DefSubclassProc)(hwnd, uMsg, wParam, lParam); /* TODO diff --git a/wintable/includethis.h b/wintable/includethis.h index 25836ef..4c7ee2a 100644 --- a/wintable/includethis.h +++ b/wintable/includethis.h @@ -40,6 +40,10 @@ enum { // data is zero // no return tableNotificationCellCheckboxToggled, + // sent even on deselection (in that case, row == -1 and column == -1) + // data is zero + // no return + tableNotificationSelectionChanged, }; typedef struct tableNM tableNM; diff --git a/wintable/select.h b/wintable/select.h index 898865a..6ece240 100644 --- a/wintable/select.h +++ b/wintable/select.h @@ -105,6 +105,9 @@ noScroll: NotifyWinEvent(EVENT_OBJECT_SELECTION, t->hwnd, OBJID_CLIENT, t->selectedRow); // TODO send EVENT_OBJECT_STATECHANGED too? // TODO send EVENT_OBJECT_FOCUS + + // TODO before or after NotifyWinEvent()? (see what other things I'm doing) + notify(t, tableNotificationSelectionChanged, t->selectedRow, t->selectedColumn, 0); } // TODO make this needless