summaryrefslogtreecommitdiff
path: root/wintable/main.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-01-07 17:05:38 -0500
committerPietro Gagliardi <[email protected]>2015-01-07 17:05:38 -0500
commit4f557f484c65e11f7ba35aa3aca8c72a6ad2a73e (patch)
treee8667618007ed782cf29e76683f03ac2cb5b475b /wintable/main.h
parent3b81ebab986d619742fffc052d4fca6a8c5080fd (diff)
Added facilities for notifications.
Diffstat (limited to 'wintable/main.h')
-rw-r--r--wintable/main.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/wintable/main.h b/wintable/main.h
index 3999d7b..670f620 100644
--- a/wintable/main.h
+++ b/wintable/main.h
@@ -11,6 +11,7 @@
// - make sure all error messages involving InvalidateRect() are consistent with regards to "redrawing" and "queueing for redraw"
// - collect all resize-related tasks in a single function (so things like adding columns will refresh everything, not just horizontal scrolls; also would fix initial coordinates)
// - checkbox columns don't clip to the column width
+// - send standard notification codes
#define tableWindowClass L"gouitable"
@@ -28,6 +29,35 @@ enum {
nTableColumnTypes,
};
+// notification codes
+// note that these are positive; see http://blogs.msdn.com/b/oldnewthing/archive/2009/08/21/9877791.aspx
+// each of these is of type tableNM
+// all fields except data will always be set
+enum {
+ // data parameter is always 0
+ // for tableColumnText return should be WCHAR *
+ // for tableColumnImage return should be HBITMAP
+ // for tableColumnCheckbox return is nonzero for checked, zero for unchecked
+ tableNotificationGetColumnData,
+ // data parameter is pointer, same as tableNotificationGetColumnData
+ // not sent for checkboxes
+ // no return
+ tableNotificationFreeColumnData,
+ // data is zero
+ // no return
+ tableNotificationToggleColumnCheck,
+};
+
+typedef struct tableNM tableNM;
+
+struct tableNM {
+ NMHDR nmhdr;
+ intptr_t row;
+ intptr_t column;
+ int columnType;
+ uintptr_t data;
+};
+
static void (*tablePanic)(const char *, DWORD) = NULL;
#define panic(...) (*tablePanic)(__VA_ARGS__, GetLastError())
#define abort $$$$ // prevent accidental use of abort()
@@ -65,6 +95,9 @@ struct table {
struct tableAcc *ta;
};
+// forward declaration (TODO needed?)
+static LRESULT notify(struct table *, UINT, intptr_t, intptr_t, uintptr_t);
+
#include "util.h"
#include "coord.h"
#include "scroll.h"