summaryrefslogtreecommitdiff
path: root/wintable
diff options
context:
space:
mode:
Diffstat (limited to 'wintable')
-rw-r--r--wintable/api.h15
-rw-r--r--wintable/includethis.h6
2 files changed, 21 insertions, 0 deletions
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;
}
diff --git a/wintable/includethis.h b/wintable/includethis.h
index f40c6f3..422b101 100644
--- a/wintable/includethis.h
+++ b/wintable/includethis.h
@@ -19,6 +19,12 @@ enum {
// both will be -1 for no selection
// if either is NULL, that value is not written
tableGetSelection,
+ // wParam - pointer to intptr_t containing selected row
+ // lParam - pointer to intptr_t containing selected column
+ // if lParam is NULL, do not change selected column (selects column 0 if nothing previously selected; TODO explicitly document this?)
+ // TODO allow wParam to be NULL too; should both being NULL select nothing or keep the current selection?
+ // this WILL result in a selection changed notification (TODO work into the package ui Table)
+ tableSetSelection,
};
enum {