From 924352d76a2bdc54415c18246a57bf29322f7344 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 19 Feb 2015 23:25:51 -0500 Subject: Added tableSetSelection to the new Windows Table and hooked it up to the package ui Table. --- wintable/api.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'wintable/api.h') diff --git a/wintable/api.h b/wintable/api.h index 78bf514..5016710 100644 --- a/wintable/api.h +++ b/wintable/api.h @@ -38,6 +38,7 @@ static void setRowCount(struct table *t, intptr_t rc) HANDLER(apiHandlers) { intptr_t *rcp; + intptr_t row; switch (uMsg) { case WM_SETFONT: @@ -72,6 +73,20 @@ HANDLER(apiHandlers) *rcp = t->selectedColumn; *lResult = 0; return TRUE; + case tableSetSelection: + // TODO does doselect() do validation? + rcp = (intptr_t *) wParam; + row = *rcp; + rcp = (intptr_t *) lParam; + if (rcp == NULL) + if (row == -1) + doselect(t, -1, -1); + else // select column 0, just like keyboard selections; TODO what if there aren't any columns? + doselect(t, row, 0); + else + doselect(t, row, *rcp); + *lResult = 0; + return TRUE; } return FALSE; } -- cgit v1.2.3