UIEvents.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. //
  2. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #pragma once
  23. #include "../Core/Object.h"
  24. namespace Atomic
  25. {
  26. // UIUpdate event
  27. EVENT(E_UIUPDATE, UIUpdate)
  28. {
  29. }
  30. EVENT(E_WIDGETEVENT, WidgetEvent)
  31. {
  32. PARAM(P_HANDLER, Handler); // UIWidget pointer of widget's OnEvent we are in
  33. PARAM(P_TARGET, Target); // UIWidget pointer
  34. PARAM(P_TYPE, Type); // EVENT_TYPE enum
  35. PARAM(P_X, X); // int
  36. PARAM(P_Y, Y); // int
  37. PARAM(P_DELTAX, DeltaX); // int
  38. PARAM(P_DELTAY, DeltaY); // int
  39. PARAM(P_COUNT, Count); // int
  40. PARAM(P_KEY, Key); // int
  41. PARAM(P_SPECIALKEY, SpecialKey); // enum SPECIAL_KEY
  42. PARAM(P_MODIFIERKEYS, ModifierKeys); // enum MODIFIER_KEYS
  43. PARAM(P_REFID, RefID); // string (TBID)
  44. PARAM(P_TOUCH, Touch); // bool
  45. // EventHandled can be set by event receivers to stop event bubble
  46. PARAM(P_HANDLED, Handled); // [OUT] -> bool
  47. }
  48. EVENT(E_WIDGETLOADED, WidgetLoaded)
  49. {
  50. PARAM(P_WIDGET, Widget); // UIWidget pointer
  51. }
  52. EVENT(E_WIDGETFOCUSCHANGED, WidgetFocusChanged)
  53. {
  54. PARAM(P_WIDGET, Widget); // UIWidget pointer
  55. PARAM(P_FOCUSED, Focused); // bool
  56. }
  57. EVENT(E_WIDGETDELETED, WidgetDeleted)
  58. {
  59. PARAM(P_WIDGET, Widget); // UIWidget pointer
  60. }
  61. EVENT(E_DRAGBEGIN, DragBegin)
  62. {
  63. PARAM(P_TARGET, Source); // UIWidget source
  64. PARAM(P_DRAGOBJECT, DragObject); // UIDragObject pointer
  65. }
  66. EVENT(E_DRAGENTERWIDGET, DragEnterWidget)
  67. {
  68. PARAM(P_WIDGET, Widget); // UIWidget pointer
  69. PARAM(P_DRAGOBJECT, DragObject); // UIDragObject pointer
  70. }
  71. EVENT(E_DRAGEXITWIDGET, DragExitWidget)
  72. {
  73. PARAM(P_WIDGET, Widget); // UIWidget pointer
  74. PARAM(P_DRAGOBJECT, DragObject); // UIDragObject pointer
  75. }
  76. EVENT(E_DRAGENDED, DragEnded)
  77. {
  78. PARAM(P_TARGET, Target); // UIWidget pointer
  79. PARAM(P_DRAGOBJECT, DragObject); // UIDragObject pointer
  80. }
  81. EVENT(E_POPUPMENUSELECT, PopupMenuSelect)
  82. {
  83. PARAM(P_BUTTON, Button); // UIButton that created popup
  84. PARAM(P_REFID, RefID); // string tbid
  85. }
  86. EVENT(E_UISHORTCUT, UIShortcut)
  87. {
  88. PARAM(P_KEY, Key); // int
  89. PARAM(P_QUALIFIERS, Qualifiers); // int
  90. }
  91. EVENT(E_UIWIDGETFOCUSCHANGED, UIWidgetFocusChanged)
  92. {
  93. PARAM(P_WIDGET, Widget); // UIWidget pointer
  94. PARAM(P_FOCUSED, Focused); // bool
  95. }
  96. EVENT(E_UIWIDGETFOCUSESCAPED, UIWidgetFocusEscaped)
  97. {
  98. }
  99. EVENT(E_UIWIDGETEDITCOMPLETE, UIWidgetEditComplete)
  100. {
  101. PARAM(P_WIDGET, Widget); // UIWidget pointer
  102. }
  103. EVENT(E_UIUNHANDLEDSHORTCUT, UIUnhandledShortcut)
  104. {
  105. PARAM(P_REFID, RefID); // string tbid
  106. }
  107. EVENT(E_UILISTVIEWSELECTIONCHANGED, UIListViewSelectionChanged)
  108. {
  109. PARAM(P_REFID, RefID); // string tbid
  110. PARAM(P_SELECTED, Selected); // bool
  111. }
  112. }