diff options
| author | Pietro Gagliardi <[email protected]> | 2015-01-06 17:27:41 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-01-06 17:27:41 -0500 |
| commit | 22123fb676d26d309d428a892c453e35e684e367 (patch) | |
| tree | 9552f1a91a8b8995065e74573e8f59f448f2b08c /wintable/events.h | |
| parent | 720049bfd3c6d205859f3150dee33dee78dc3dc3 (diff) | |
Merged wintable/new/ into wintable/.
Diffstat (limited to 'wintable/events.h')
| -rw-r--r-- | wintable/events.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/wintable/events.h b/wintable/events.h new file mode 100644 index 0000000..fbd1522 --- /dev/null +++ b/wintable/events.h @@ -0,0 +1,62 @@ +// 5 december 2014 + +// TODO handler functions don't work here because you can't have more than one for the mouse ones... + +static const handlerfunc keyDownHandlers[] = { + keyDownSelectHandler, + NULL, +}; + +static const handlerfunc keyUpHandlers[] = { + NULL, +}; + +static const handlerfunc charHandlers[] = { + NULL, +}; + +static const handlerfunc mouseMoveHandlers[] = { + checkboxMouseMoveHandler, + NULL, +}; + +static const handlerfunc mouseLeaveHandlers[] = { + checkboxMouseLeaveHandler, + NULL, +}; + +static const handlerfunc lbuttonDownHandlers[] = { + mouseDownSelectHandler, + NULL, +}; + +static const handlerfunc lbuttonUpHandlers[] = { + checkboxMouseUpHandler, + NULL, +}; + +// TODO remove or something? depends on if we implement combobox and how +static const handlerfunc mouseWheelHandlers[] = { + NULL, +}; + +// TODO WM_MOUSEHOVER, other mouse buttons + +HANDLER(eventHandlers) +{ + switch (uMsg) { +#define eventHandler(msg, array) \ + case msg: \ + return runHandlers(array, t, uMsg, wParam, lParam, lResult); + eventHandler(WM_KEYDOWN, keyDownHandlers) + eventHandler(WM_KEYUP, keyUpHandlers) + eventHandler(WM_CHAR, charHandlers) + eventHandler(WM_MOUSEMOVE, mouseMoveHandlers) + eventHandler(WM_MOUSELEAVE, mouseLeaveHandlers) + eventHandler(WM_LBUTTONDOWN, lbuttonDownHandlers) + eventHandler(WM_LBUTTONUP, lbuttonUpHandlers) + eventHandler(WM_MOUSEWHEEL, mouseWheelHandlers) +#undef eventHandler + } + return FALSE; +} |
