summaryrefslogtreecommitdiff
path: root/wintable/new/select.h
diff options
context:
space:
mode:
Diffstat (limited to 'wintable/new/select.h')
-rw-r--r--wintable/new/select.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/wintable/new/select.h b/wintable/new/select.h
new file mode 100644
index 0000000..c849802
--- /dev/null
+++ b/wintable/new/select.h
@@ -0,0 +1,23 @@
+// 13 december 2014
+
+// damn winsock
+static void doselect(struct table *t, intptr_t row, intptr_t column)
+{
+ t->selectedRow = row;
+ t->selectedColumn = column;
+ // TODO scroll to ensure the full cell is visible
+ // TODO redraw only the old and new columns /if there was no scrolling/
+ InvalidateRect(t->hwnd, NULL, TRUE);
+}
+
+// TODO which WM_xBUTTONDOWNs?
+HANDLER(mouseDownSelectHandler)
+{
+ struct rowcol rc;
+
+ rc = lParamToRowColumn(t, lParam);
+ // don't check if lParamToRowColumn() returned row -1 or column -1; we want deselection behavior
+ doselect(t, rc.row, rc.column);
+ *lResult = 0;
+ return TRUE;
+}